cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Action: name of action in list not displayed properly

toltech
Champ in-the-making
Champ in-the-making
L.S.,
I finally succeeded in getting my own action class + jsp page working. I basically copied over the Move Action and made little changes in the files, filenames, class names and locations. It still moves and works and presents itself in the action list of the interface.

The only thing which is not working, is the name of the action in the "select action" list of the workspace. In this list I don't see the title but the id-name of the action (in my case "move-replaced" instead of "Move Replaced Action", which I expect.

I created the file move-replaced-action-context.xml containing a bean with id="move-replaced", in this bean there is a reference to alfresco.extension.move-replaced-action-messages.

What is the procedure to get the right title in the "select an action" list ?

These are the contents of the mentioned files:
move-replaced-action-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>
   <!– Move Replaced Action Bean –>
   <bean id="move-replaced" class="nl.toltech.alfresco.action.MoveReplacedActionExecuter" parent="action-executer">
      <property name="nodeService">
         <ref bean="NodeService" />
      </property>
   </bean>
   <bean id="extension.actionResourceBundles" parent="actionResourceBundles">
      <property name="resourceBundles">
         <list>
            <value>alfresco.extension.move-replaced-action-messages</value>
         </list>
      </property>
   </bean>
</beans>
move-replaced-action-messages.properties:

action_move_replaced=Move replaced to ''{0}''
title_action_move_replaced=Move Replaced Action

Part of web-client-config-custom.xml:
<config evaluator="string-compare" condition="Action Wizards">
        <!– add custom action handler for "Move Replaced" action –>
        <action-handlers>
                <handler name="move-replaced" class="nl.toltech.alfresco.action.MoveReplacedHandler" />
        </action-handlers>
</config>

in webclient.properties:
action_move_replaced=Move replaced to ''{0}''
title_action_move_replaced=Move Replaced Action

regards,
Robert
6 REPLIES 6

jottley
Confirmed Champ
Confirmed Champ
In your webclient.properties file add

move-replaced.title=Move Replaced Action
move-replaced.description=Move Replaced Action Description

restart Alfresco and you should see Move Replaced Action in your list of actions

toltech
Champ in-the-making
Champ in-the-making
This did not work,
I now have in webclient.properties and move-replaced-action-messages.properties the mentioned lines. I am following a howto, from this howto I copied the bean example (move-replaced-action-context.xml), in this bean declaration there is the line <value>alfresco.extension.move-replaced-action-messages</value>

Is there anything wrong in the bean declaration?

Thanks,
Robert

jottley
Confirmed Champ
Confirmed Champ
Oops.  Sorry, you are right.  Those should go in the move-replaced-action-messages.properties file.  Where is this file located?

toltech
Champ in-the-making
Champ in-the-making
The file is located in:
webapps/alfresco/WEB-INF/classes/alfresco/extension
move-replaced-action-context.xml
move-replaced-action-messages.properties

jottley
Confirmed Champ
Confirmed Champ
It sounds like the properties file is not being read (not being seen on the class path.

I place my properties files in the same package as my executer and then use that package name, for example

org.alfresco.extension.repo.content.executers

plus the properties file name (my-strings) in the value tags. So

<value>org.alfresco.extension.repo.content.executers.my-strings</value>

My bean looks something like this:

<bean id="pdfburst-messages" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
    <property name="resourceBundles">
        <list>
            <value>org.alfresco.extension.web.bean.actions.handlers.pdf-messages</value>
        </list>
    </property>
</bean>

jottley
Confirmed Champ
Confirmed Champ
At the end of your handler class did you change it to read

MessageFormat.format(Application.getMessage(context, "action_move_replaced")