AnsweredAssumed Answered

custom action

Question asked by tavvolley on Oct 2, 2014
Hello everyone!! I've to update an application for alfresco 4.2.3.1 enterprice.

In this application there is a custom action on particular folder, it is a folder that contain a pec email and folder's node could be have two aspect :

cm:emailed (all pec riceived)

pdm:isProtocolled (only if pec is protocolled)

for this particular folder i can protocol it (if it's not protocolled), so into the folder-detail I can see a button that handle the event: protocolPec. 

this is the implementations:

file <alfrscoHome>/tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension/pec-share-config.xml


   <actions>
      …

            <action id="pec-protocol" type="javascript" label="Protocolla PEC">
               <param name="function">onActionProtocolPec</param>
               <evaluator>evaluator.doclib.pec.isReceived</evaluator>
               <evaluator negate="true">evaluator.doclib.pec.isProtocolled</evaluator>
            </action>
        </actions>
        <actionGroups>
      <actionGroup id="document-browse">
               <action index="095" id="pec-sendmail" />
           </actionGroup>
           <actionGroup id="document-details">
              <action index="095" id="pec-sendmail" />
           </actionGroup>
           <actionGroup id="folder-browse">
              <action index="094" id="pec-replymail" />
               <action index="095" id="pec-forwardmail" />
               <action index="096" id="pec-exportmail" />
               <action index="097" id="pec-protocol" />
           </actionGroup>
           <actionGroup id="folder-details">
              <action index="094" id="pec-replymail" />
               <action index="095" id="pec-forwardmail" />
               <action index="096" id="pec-exportmail" />
               <action index="097" id="pec-protocol" />
           </actionGroup>
   </actionGroups>


file <alfrscoHome>/tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension/pec-context.xml:

<!– Evaluator –>
   <bean id="evaluator.doclib.pec.isReceived" parent="evaluator.doclib.action.hasAspect">
      <property name="aspects">
         <list>
            <value>cm:emailed</value>
         </list>
      </property>
   </bean>
  
   <bean id="evaluator.doclib.pec.isProtocolled" parent="evaluator.doclib.action.hasAspect">
      <property name="aspects">
         <list>
            <value>pec:protocol</value>
         </list>
      </property>
   </bean>

this work fine for all the old alfresco's version. It didn't work with alfresco 4.2.f community (and up) and 4.1 enterprice (and up). In this versions I can't see the button.

I have made many tests:
-I have commented the evaluator. I think that the button will appear on all folders but  it didn't appair.
-I have put the code into the file (<alfrscoHome>/tomcat/webapps/share/WEB-INF/classes/share-documentlibrary-config.xml and <alfrscoHome>/tomcat/webapps/share/WEB-INF/classes/slingshot-documentlibrary-context.xml) but the button didn't appair
-I have also commented all occurence of
 <action index="100" id="folder-download"/> 
but i see always the button download (I don't know why it happen).
how can i see the button? please help
I have also read this article :
https://issues.alfresco.com/jira/browse/ACE-953
Alfresco 4.2 have the same problem?


ps: this is the address's tutorial : http://docs.alfresco.com/4.2/concepts/doclib-web-tier.html

Outcomes