AnsweredAssumed Answered

form for Doclib action

Question asked by .jan on Mar 14, 2016
Hello,
I want to show my custom popup form after user click on folder action. I have action definition in share-config-custom.xml:
<blockcode>
<config evaluator="string-compare" condition="DocLibActions">
        <actions>
         <action id="folder-edit-permission-alias" type="javascript" label="actions.create-project" icon="folder-move-to">
              <param name="function">onEditPermissionAlias</param>            
           </action>
        </actions>
        <actionGroups>
            <actionGroup id="folder-browse">
                <action index="500" id="folder-edit-permission-alias" />           
            </actionGroup>
            <actionGroup id="folder-details">
                <action index="500" id="folder-edit-permission-alias" />           
            </actionGroup>
        </actionGroups>       
    </config>
</blockcode>
I have form definition in share-config-custom.xml:
<blockcode>
<config evaluator="string-compare" condition="onEditPermissionAliasAction">
       <forms>
         <form>
            <field-visibility>   
               <show id="name"/>                                 
            </field-visibility>
            <appearance>
               <field id="name">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
               </field>
            </appearance>
         </form>
       </forms>
    </config>
</blockcode>

And this is my action definition:
<blockcode>
(function() {
   
   YAHOO.Bubbling.fire("registerAction", {
                actionName: "onEditPermissionAlias",
                fn: function onEditPermissionAlias_action(node) {
                   var dlg = new Alfresco.module.SimpleDialog(this.id +
                            "-email-documents" +
                            Alfresco.util.generateDomId());
                   
                    var templateUrl = YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT + "components/form?itemKind={itemKind}&itemId={itemId}&destination={destination}&mode={mode}&submitType={submitType}&showCancelButton=true",
                            {                              
                             itemKind: "action",
                              itemId: "onEditPermissionAliasAction",
                              mode: "edit",
                              submitType: "json",
                              destination: node.nodeRef
                            });
                    addOptions(dlg, node);
                    dlg.options.templateUrl = templateUrl;
                    dlg.show();
                }
            });
   
   function addOptions(dlg, node) {
        dlg.setOptions({
                    width: "50em",
                    method: Alfresco.util.Ajax.POST,
                    onSuccess: {
                      fn: function success(response) {
                         Alfresco.util.PopupManager.displayMessage({text: dlg.msg("message.permission-alias-folder.success")});
                        }   
                    },
                    onFailure: {
                        fn: function fail(response) {
                            Alfresco.util.PopupManager.displayMessage({text: dlg.msg("message.permission-alias-folder.failure")});
                        }
                    },
                   
                    doBeforeDialogShow: {
                        fn: function doBeforeDialogShow(form, dialog) {
                       
                        }
                    }
                });
    } 
})();
</blockcode>

When I run Alfresco, I can see action and click it but no form is visible and there is error in share console:
ERROR [scripts.forms.FormUIGet] [http-bio-8081-exec-3] org.alfresco.repo.forms.FormNotFoundException: 02140046 A form could not be found for item: [action]onEditPermissionAliasAction

Outcomes