4.0c removing UI actions works on windows but not in linux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2012 01:08 PM
I am customizing UI Actions Menus to reduce the actions that a user can take when dealing with a document. One of the UI Actions I want to remove is Publish which on windows does not show within either the document browse action menu or the document details action menu after editing the share-documentlibrary-config.xml. However, I deployed the share-documentlibrary-config.xml file from the windows instance to the linux instance location /opt/alfresco-4.0.c/tomcat/webapps/share/WEB-INF/classes/alfresco. When I restarted the linux server I see the Publish UI action in both UI Actions Menus.
Any clues would be of great help as I am new to alfresco.
Thanks
George
Here is how i am disabling the Publish UI action
<!– Publish document… set to negate="false" by ggates 2/22/2012–>
<action id="document-publish" type="javascript" label="actions.document.publish">
<param name="function">onActionPublish</param>
<evaluator negate="false">evaluator.doclib.action.isLocked</evaluator>
</action>
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2012 02:13 PM
It is not a good idea to change any of the files distributed with Alfresco unless there is no other way to do what you are trying to do. Instead, you should use the "extension" mechanism. Also, in Alfresco 4 it is really easy to turn off an action. Check it out:
1. Create a directory called web-extension under $TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco
2. Create a file called share-config-custom.xml with the following content:
<alfresco-config><config evaluator="string-compare" condition="DocLibActions"> <actions> <!– Publish document –> <action id="document-publish" type="javascript" label="actions.document.publish"> <param name="function">onActionPublish</param> <evaluator>evaluator.doclib.action.disableAction</evaluator> </action> </actions></config></alfresco-config>
3. Save the file.4. Restart Tomcat
5. The action will not appear.
All I'm doing here is overriding the definition of the "document-publish" action, and I'm giving it a new evaluator that disables the action.
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2012 03:25 PM
Thanks for the quick response
George
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2012 03:48 PM
It should work for all actions.
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2012 03:01 PM
It there a way to remove UI Actions by user? As the extension takes is out for all.
Thanks
George
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2012 04:21 PM
It is possible to write your own evaluator. It's just a Java class. So you could have an evaluator that would match on username or group name and then configure the specific user or group name in Spring, then point to the evaluator in your form config.
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2012 03:54 PM
Thanks works fine on " publish" any chance to get the portion of code to hide workflows
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2012 04:14 PM
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2012 08:03 AM
i have followed your exemple and it works perfectly on my side "publish " action is hide
this is the portion of code to do it
<alfresco-config>
<config evaluator="string-compare" condition="DocLibActions">
<actions>
<!– Publish document –>
<action id="document-publish" type="javascript" label="actions.document.publish">
<param name="function">onActionPublish</param>
<evaluator>evaluator.doclib.action.disableAction</evaluator>
</action>
</actions>
</config>
</alfresco-config>
you wrapped the action tag and changed the property of the evaluator to disable
my new query was , i want to do exactly the same with the "start worlflow action" ( hide the start workflow action )
my question was, can you write the code exemple to apply hiden action "start workflow "
ops:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2012 09:47 AM
I see, thanks for clarifying. To hide the "Start Workflow" action you'd follow the exact same procedure. In that case, the action is called "document-assign-workflow", so to hide it, you'd do this:
<!– Assign workflow –> <action id="document-assign-workflow" type="javascript" label="actions.document.assign-workflow"> <param name="function">onActionAssignWorkflow</param> <evaluator>evaluator.doclib.action.disableAction</evaluator> </action>
If you are also hiding "document-publish" or some other action, add this immediately following the other action's "</action>" tag and before the "</actions>" tag.
Jeff