cancel
Showing results for 
Search instead for 
Did you mean: 

Can't deploy my action.

removedquasar
Champ in-the-making
Champ in-the-making
I have a problem: if i deploy my model content with my custom action, Alfresco won't start. If i remove the file mymodel-actions-context.xml (where is the action bean) all start correctly but of course without the action.

Where is the problem? This is my spring file mymodel-actions-context.xml:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
        <!– Set web flag action –>
        <bean id="set-web-flag" class="java.com.mymodel.action.executer.SetWebFlag" parent="action-executer">
                <property name="nodeService">
                        <ref bean="NodeService" />
                </property>
                <property name="publicAction">
                        <value>true</value>
                </property>
        </bean>
       
       
       
        <!– Action properties –>
        <bean id="extension.actionResourceBundles" parent="actionResourceBundles">
                <property name="resourceBundles">
                        <list>
                                <value>alfresco.extension.mymodelactions</value>
                        </list>
                </property>
        </bean>
</beans>

There is something wrong with the package  java.com.mymodel.action.executer?
The Alfresco Developer Guide suggest to create the package com.mymodel.action.executer inside src/java but this is no possible, all folders created inside src become package, so i have java.com.mymodel.action.executer.
4 REPLIES 4

mitpatoliya
Star Collaborator
Star Collaborator
You need not to define this bean any where you can directly use the class inside web-client-config-custom.xml file to set it as evaluator.
like this

            
  <config>
      <actions>
         <action id="start_workflow">
            <label-id>start_workflow</label-id>
            <image>/images/icons/new_workflow.gif</image>
                 <evaluator>java.com.mymodel.action.executer.SetWebFlag</evaluator>
            <action>wizard:startWorkflow</action>
            <action-listener>
               #{WizardManager.setupParameters}
            </action-listener>
            <params>
               <param name="item-to-workflow">
                  #{actionContext.id}
               </param>
            </params>
         </action>
      </actions>
   </config>

also one more thing for creating the package com.mymodel.action.executer you need to set src/java as your source folder from the build path then you can create that package  😎

removedquasar
Champ in-the-making
Champ in-the-making
But isn't enough create a bean in my spring file mymodel-actions-context.xml? That's what i read here http://wiki.alfresco.com/wiki/Custom_Actions

However if i remove my spring file (wich i posted before), Alfresco start correctly so the problem must be that spring file, what can be?

ps: if i create a folder called "java" inside the "src" folder and i set java to become source folder, Eclpise create another folder called src/java and that's not work, however for sure i set the file build.xml to check the src directory and not the src/java directory, that's should work but i have again troubles  :cry:


pps: ok solved, the java class of the action needed the loggers °W°

mitpatoliya
Star Collaborator
Star Collaborator
Ouups sorry  Smiley Surprisedops: , actually what I have suggested was for action evaluator.
So,Is it solved or??

removedquasar
Champ in-the-making
Champ in-the-making
Yeah all solved  Smiley Happy