2 Replies Latest reply on Mar 21, 2013 6:19 AM by Dominik Oriet

    How to hide specific form actions

    JE Bailey Level 2

      We have a requirement from our authors to remove unwanted form actions. I assumed that this would be permission specific and went into the content-author group and removed read ability for those actions from under /libs/foundation/form/components/form/actions/

       

      And yet they still appear.

       

      Is there another location that I shouldbe setting the permissions or do these just show up regardless?

        • 1. Re: How to hide specific form actions
          kasq Level 3

          Hi,

           

          It should works like you wrote by set proper permissions for a group of users, but I just chekced in my local repository and it is working like in your case.

           

          If you want check from where are taken form actions values in the dropdown first of all you need to check configuration for this field which is stored under:

           

          - /libs/foundation/components/form/start/dialog/items/tabs/items/second/items/actiontype

           

          As this is a widget with xtype='formactionselection' then please take a look into js file which is implementation for this widget:

           

          - /libs/cq/ui/widgets/source/widgets/wcm/FormActionSelection.js

           

          There you find that the values in the dropdown for this filed are populated by calling :

           

          - /bin/wcm/foundation/forms/actions.json

           

          and of course setting permissions should solve this problem.

           

          In my opinion this a bug or I missed something, so only thing which I can suggest at this moment is to customize a little bit this widget.

           

          For example you can create a sort of actions which are used only by users in the /apps/project_name/form/actions (copy only those which are used from /libs/foundation/form/components/form/actions/) and then customize the widget by changing a path from

           

          /bin/wcm/foundation/forms/actions.json to /apps/project_name/form/actions.json

           

          I hope this helps you somehow to understand this issue more deeply.

           

          Regards,

          kasq

          • 2. Re: How to hide specific form actions
            Dominik Oriet

            Another easy solution if you only want the actions located somewhere below /apps.

             

            1. Create an overlay of the form/start component.

             

            2. In dialog.xml change the actiontype node:

             

            <actiontype

                jcr:primaryType="cq:Widget"
                fieldLabel="Custom Action Type"
                name="./actionType"
                options="/content.query.tidy.json?statement=//apps//*/actions/*/(@jcr:title)"
                optionsTextField="jcr:title"
                optionsValueField="jcr:path"
                optionsRoot="."
                type="select"
                xtype="selection" />

            Dominik

            1 person found this helpful