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

0 votes

2 answers

87 views

ANSWER

Hi, you can user this xml extension:

<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>

&lt;filter-id&gt;iddelete&lt;/filter-id&gt;

</action> </extension> <extension target="org.nuxeo.ecm.platform.actions.ActionService" <point="filters">

<filter id="iddelete">

        &lt;rule grant=&quot;false&quot;&gt;
        &lt;condition&gt;Your condition&lt;/condition&gt;
         &lt;/rule&gt;

</filter> </extension> </component>

10/08/2018

Thanks for your help. I made a contribution to the ActionService point in addition of the contribution to the filter point. I think the problem is in the condition I'm using. Maybe I can't access document properties that way (because it's a list of documents?) ?

Thanks

10/11/2018



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

0 votes



Hi, Super, to recover the selected documents in Java, you must follow the following steps:

-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.

10/12/2018

It is possible to do it with the Studio ?

Unfortunately, i'm not authorized to make my own developments in Java…

10/12/2018

Hi, you can try this with your client that you used in Backend.

otherwise i don't know if we can do it in studio.

10/16/2018


Hello, So if I understand, you want to recover the documents tick in BackEnd and then you have a certain treatment on these documents.

0 votes