Hide the delete button
I'm trying to hide the “Delete” button on the view_documents only if the selected custom document have a boolean property to 1.
I'm using the Studio only … I tried to implement a contribution to the extension point “filter” but it does not seem to work.
Here is the condition I'm using in the contribution:
<extension target="org.nuxeo.ecm.platform.actions.ActionService" point="filters">
<filter id="canDeleteScan">
<rule grant="false">
<condition>#{currentDocument.getProperty("SchemaDocument.scanner").equals("false")}</condition>
</rule>
</extension>
Does anyone have an idea ?
Thanks
Hi,
Yes, if a property of at least one of the selected documents in the list is “false”, I want to hide the “Delete” button for all of the selected documents because this one can't be deleted.
Thanks
-Create a new Bean (Controller)
In your bean, put the following code:
if (navigationContext.getCurrentDocument().isFolder()) {
return documentsListsManager.getWorkingList(DocumentsListsManager.CURRENT_DOCUMENT_SELECTION);
}
else
return null;}
-Put your Xml extension under the OSGI bundle. (MANIFEST.MF)
-If you have an l10 folder, create a .properties file that contains the path of your bean
Do not hesitate if it does not work.
Unfortunately, i'm not authorized to make my own developments in Java…
otherwise i don't know if we can do it in studio.
<component name=" your component name"> <extension target="org.nuxeo.ecm.platform.actions.ActionService" point="actions"> <action id="CURRENT_SELECTION_TRASH" > <category >CURRENT_SELECTION_LIST</category>
</action> </extension> <extension target="org.nuxeo.ecm.platform.actions.ActionService" <point="filters">
<filter id="iddelete">
</filter> </extension> </component>
Thanks