cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Action extension problem

sbroussi
Champ in-the-making
Champ in-the-making
We are implementing customatisation,
but I encounter a problem to configure them.

As recommanded in the WIKI, we do not want to modify the
Alfresco XML files, but we prefer to use your "extension pattern".

I want to insert a new "custom action" and to extend an existing "actions-group":

—————– File: extension/web-client-config-custom.xml
<config evaluator="string-compare" condition="Actions">
  <actions>
    <action id="action_AttachSendMail">
      <permissions>
        <permission allow="true">Read</permission>
      </permissions>
      <label-id>attachSendMail.title</label-id>
      <image>/images/icons/create_post.gif</image>
      <action>dialog:action_AttachSendMail</action>
    </action>
  </actions>
</config>

<config evaluator="string-compare" condition="Actions">
  <actions>
    <action-group id="space_details_actions">
      <action idref="action_AttachSendMail" /> 
    </action-group>
  </actions>
</config> 


=> But this does not work.
=> If I insert them directly in the "web-client-config-actions.xml" it works.

I've searched the source code and I've found a "ActionsElementReader"
which is effectively only triggered by the "<actions>" tag:
— file: web-client-config.xml
   <element-readers>
     <element-reader element-name="actions" class="org.alfresco.web.config.ActionsElementReader" />
     …
   
The "ActionsElementReader" loops on sub-elements (action*, action-group*)
but never request an "extension configuration point"
(like: Config wizardCfg = svc.getConfig("Content Wizards"); )

=> how can I define custom action as "extension" ?
4 REPLIES 4

ero
Champ in-the-making
Champ in-the-making
No comment on this ?????

gavinc
Champ in-the-making
Champ in-the-making
Some issues with the actions overriding mechanism were fixed last Friday, so firstly I would suggest getting the latest code from SVN.

One change this introduced was to move the actions config from a config section called "Actions" to the 'global' config section, this is one of the changes that made overriding possible.

Give it another go with the latest code and let me know how it goes.

Furthermore, some examples of doing exactly what you are doing will appear on the wiki in the next few days, so stay tuned!

ero
Champ in-the-making
Champ in-the-making
Hi Gavin,

Development is based on SVN version 2898 (Tuesday).
Should you take a look because we don't have time to wait full wiki doc (See with Mike Farman).
Some small sample would be very helpful.

Regards,

Eric

gavinc
Champ in-the-making
Champ in-the-making
Hi,

As I mentioned above one of the changes was to move the actions config to the 'global' namespace…

In your web-client-config-custom.xml make sure you do not have the evaluator and condition on the config section for your actions i.e.


<config evaluator="string-compare" condition="Actions">
<actions>
<action id="action_AttachSendMail">
<permissions>
<permission allow="true">Read</permission>
</permissions>
<label-id>attachSendMail.title</label-id>
<image>/images/icons/create_post.gif</image>
<action>dialog:action_AttachSendMail</action>
</action>
</actions>
</config>

should read…..


<config>
<actions>
<action id="action_AttachSendMail">
<permissions>
<permission allow="true">Read</permission>
</permissions>
<label-id>attachSendMail.title</label-id>
<image>/images/icons/create_post.gif</image>
<action>dialog:action_AttachSendMail</action>
</action>
</actions>
</config>