Extend Teamsite actions - content-management-system

I was wondering if it possible to extend Teamsite functionality? For example, I would like to add my own button under Actions -> MyAction which would perform my java based operation (update pages or something)?

For custom menu actions you'll need to make modifications to
<iw-home>/local/config/lib/content_center/customer_src/etc/conf/customer/ui_custom.xml
There should be some examples in the file unless you've erased the contents. The basic format is as follows:
<action-list id="iw.ccpro.filesys.menubar">
<menu id="iw.ccpro.action.menu">
<link id="company.ccpro.list_directory.custMenuAction.link"
label="Custom Action"
description="Custom Action Description"
url="/iw-bin/custom_menu_action.ipl"
target="_blank"
icon="/base/images/customIcon.gif"
/>
</menu>
</action-list>
For a Java based operation you would just change the url to your servlet path.
For example:
url="<iw-hostname>/iw-cc/command/customJavaAction"

Related

Custom-UI: Force Developer-Tab to be visible

I have a MS-Word template where the user sometimes will have to edit content controls.
Therefore I would like to force the developer tab to be visible whenever a document based on this template is opened.
I changed the CustomUI:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab idMso="TabDeveloper" visible="true" />
</tabs>
</ribbon>
</customUI>
No error is thrown when the document is opened - but the Developer tab isn't visible.
Any thing else I have to consider, to force the tab to be visible?
(Vice versa works: hiding a visible Developer-Tab by setting visible to false)
(There is no VBA attached to the document.)
OK - sometimes a short break helps:
I am adding a custom tab containing the relevant buttons from the developer tab. Plus: renaming them :-)
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="Abnahme" label="Abnahmedokument">
<group id="x" label="Eingabefelder">
<button idMso="ContentControlText" label="neues Eingabefeld" size="large"/>
<button idMso="ControlProperties" label="Eingabefeld bearbeiten" size="large"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
I know of no method other than user education.
You could, in your distribution template, add your own duplicate tab or a tab that has the controls for Content Controls. Better practice is probably to put the Content Control tools on your own additional tab and ignore the Developer Tab.
See also Hide/Show all tabs on Ribbon except Custom tabs which also says there is no method available via VBA.
The following caveat is for someone finding your question in a web search and thinking about using the Word.OfficeUI file and finding this question in a web search. It does not appear that you are doing that.
For customization distribution, the UI editor in Word is a very poor tool. It is intended for personal use.
The Word.OfficeUI file produced by Word will overwrite any user customizations including QAT customizations. Placing that on a user's computer is mean and dictatorial just like overwriting the Normal template. It is a bad practice.
For distribution, you should be editing the XML of a global template. Likewise, such a template is the best method of distributing other user interface customizations like macros and building blocks. The methods for doing this are explored in the book RibbonX: Customizing the Ribbon User Interface and on Greg Maxey's page: Customize the Office Ribbon: It doesn't take rocket science.

Bind command to hub section header click in Windows 10 Universal App

Suppose I got a hub page (HubPageView) and a couple of hub sections inside that page e.g.
<Hub Header="{Binding AppName}">
<HubSection IsHeaderInteractive="True"
Header="Section 1">
...
</HubSection>
...
</Hub>
When rendered the above shows as "Section 1 See more" and I take it that if the user taps "See more" the app is supposed to navigate to, say, Section1PageView.
I'm trying hard to follow the MVVM pattern so I'd like to bind the tap to a command (NavigateToSection1Command) instead of using the ItemClick event - how do I accomplish this?
The Hub class has a SectionHeaderClick event to which you could attach an EventTriggerBehavior and bind your Command to it.
<Page xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
<Hub Header="{Binding AppName}">
<i:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="SectionHeaderClick">
<core:InvokeCommandAction Command="{Binding NavigateToSectionCommand}" />
</core:EventTriggerBehavior>
</i:Interaction.Behaviors>
</Hub>
</Page>
The SectionHeaderClick is the event that MS put for us to interact with the Hub Header, but the way it works will make MVVM's life harder. You see, that event passes the Section object that was clicked as an argument. You will lose that by attaching a command, as there is no built in way to pass an event argument to a command and there will be no way to tell which section the command was fired from.
That being said, I think that placing a Button or TextBlock at the HubSection's Header and attaching a EventTriggerBehavior to it`s Click event would better suit your needs.
Ps: You will have to add a Reference to the Behaviors SDK. Go to Add References > Universal Windows > Extensions, then check Behaviors SDK (XAML)

Configure different Action classes for two forms on one JSP in Struts 2

I have one JSP page which has two forms with submit buttons. How to configure different action class those two forms?
For example:
form1 submit button configuration to classA and form2 submit button configuration to classB.
Is it possible?
As easy as:
<s:form>
...
<s:submit action="Action1" />
</s:form>
<s:form>
...
<s:submit action="Action2" />
</s:form>
You can even use different <s:submit> buttons for the same <s:form>
<s:form>
...
<s:submit action="Action1" />
<s:submit action="Action2" />
</s:form>
Forms and buttons are mapped to the actions, actions are mapped to the methods of classes.
You have many but not nested forms in the JSP that could map to the action using the action attribute.
The button submit should normally not include any of action or method attribute, that means it might invert the direction the action which communicates dynamically.
To use this feature with the default action mapper you have a DMI turned on.
You could have many actions mapping to the same method with different names, but you couldn't have an action in the same namespace to map different classes or methods. Those classes or methods should be in the different namespaces.
The same thing for the form, you could map the form or button with any action. Many forms could map to the same action, but you couldn't map the form with different action. For this, you have to map the button, or use javascript to modify action attribute with the different action to change the mapping.

How to display different labels for the same action in the a Project Explorer context menu item depending on the nature of the project selected?

I want to add an action on the Project Explorer context menu. Is is possible to display different labels according to the nature of the project selected if the action is defined via org.eclipse.ui.popupMenus?
I tryied defining 2 contributions and try to hide one according to the nature, but I did'n find a way to test the project nature.
You can try the method outlined in http://timezra.blogspot.com/2007/12/dynamic-labels-for-eclipse-context.html
Which is simply to create a dynamic contribution where you will get a method to return the IMenuContribution[] list, and in the code you can check on whatever condition you want and return the appropriate contribution.
Another approach is outlined in http://wiki.eclipse.org/Menu_Contributions#State_associated_with_the_command_is_propogated_to_UI_visible_elements
to have a NAME state associated with the command and update it as needed, I haven't tried it, but it seems more inline with what you ask.
<state id="NAME" class="org.eclipse.jface.menus.TextState" />

seam redirect page

I use seam to manage a viewer page.
In my page I have a div (iframe) where an html page is displayed on particular conditions.
In particular I need to change the page displayed in this div deciding from serverside.
I try to explain me better:
on commandButton click the control is passed to server (using an action). This action method set some things and know what page should be loaded after (or none in some cases).
when the control come back to the caller page, the new page setted by the action method must be called (it uses the things specified by the action method).
How can I do this?
NOTE: the oncomplete tag is not usable in this context because I have many commandButton and it is called everytime I click on one of the commandButtons.
I'm not completely sure what your trying to do.
Are these pages rendered dynamically?
You can generate HTML from the serversite and just output it using a <h:outputText id="iframediv" value="#{controller.htmlparameter}" escape="false" />
An <a4j:commandButton reRender="iframediv"> could then reRender this dynamically generated page.
If the pages are defined statically you could include them like this.
<rich:panel id="iframediv">
<a4j:outputPanel rendered="{controller.page1}">
<ui:include src="page1.xhtml" />
</a4j:outputPanel>
<a4j:outputPanel rendered="{controller.page2}">
<ui:include src="page2.xhtml" />
</a4j:outputPanel>
</rich:panel>
The controller's page1 and page2 parameters should be booleans and set by the action you've called.
Solved using javascript activated only when a particular property is present over the serverside.