How can I add action menu items for specific types?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2007 01:35 PM
Following the example, adding menu items will make them appear for all types.
How to I add them show they will only show up for certain types/subtypes?
Or just for certain paths?
Conversely is there a way to hide menu items for certain contexts?
For example, do not show the "start discussion" action on certain nodes.
thx
How to I add them show they will only show up for certain types/subtypes?
Or just for certain paths?
Conversely is there a way to hide menu items for certain contexts?
For example, do not show the "start discussion" action on certain nodes.
thx
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2007 11:55 AM
You can specify an evaluator to check various conditions
I have an action that I only want to show for nodes of type 'project'
In web-client-custom-config.xml:
And the evaluator itself
Hope this helps.
I don't know the exact syntax for hiding menu items but I'm pretty sure you can do that.
I have an action that I only want to show for nodes of type 'project'
In web-client-custom-config.xml:
<config> <actions> <action id="process_project"> <evaluator>com.mediamine.rcd.core.upload.ProcessProjectEvaluator</evaluator> <label>Process Project</label> <image>/images/icons/workflow.gif</image> <action-listener>#{UploadBean.processProject}</action-listener> </action> <action-group id="space_browse_menu"> <action idref="process_project" /> </action-group> </actions> </config>
And the evaluator itself
package com.mediamine.rcd.core.upload;import javax.faces.context.FacesContext;import org.alfresco.service.cmr.repository.NodeService;import org.alfresco.web.action.ActionEvaluator;import org.alfresco.web.app.servlet.FacesHelper;import org.alfresco.web.bean.repository.Node;import com.mediamine.rcd.core.domain.RCDModel;public class ProcessProjectEvaluator implements ActionEvaluator{ public boolean evaluate(Node node) { FacesContext fc = FacesContext.getCurrentInstance(); NodeService nodeService = (NodeService)FacesHelper.getManagedBean(fc, "NodeService"); return nodeService.hasAspect(node.getNodeRef(), RCDModel.ASPECT_UPLOADED_PROJECT); }}
Hope this helps.
I don't know the exact syntax for hiding menu items but I'm pretty sure you can do that.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2007 07:12 AM
Yes you can hide actions easily, just use the following syntax in your action group config….
<action idref="id-of-the-action" hide="true" />

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2007 10:37 AM
In 2.1 you can configure action groups by node type:
http://wiki.alfresco.com/wiki/Externalised_Client_Actions#Type_Based_Action_Configuration
Thanks,
Kevin
http://wiki.alfresco.com/wiki/Externalised_Client_Actions#Type_Based_Action_Configuration
Thanks,
Kevin
