Custom action not working
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2015 03:31 AM
Hi all,
I am trying to create a share action, followed a few tutorials and famously Jeff Potts's creating custom action tutorial <a href="http://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html#example-1...">here</a> to no effect. Here is my share-config file:
1. share-config
The button appears on share but does nothing when clicked. I suspect my wiring is wrong. Or maybe I just went about this the wrong way.
I am trying to create a share action, followed a few tutorials and famously Jeff Potts's creating custom action tutorial <a href="http://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html#example-1...">here</a> to no effect. Here is my share-config file:
1. share-config
<config evaluator="string-compare" condition="DocLibActions"> <actions> <action id="bubble-action" type="javascript" label="Bubble Action"> <param name="function">onActionSimpleRepoAction</param> <param name="action">bubble-click</param> </action> </actions> <actionGroups> <actionGroup id="document-browse"> <action index="300" id="bubble-action" /> </actionGroup> <actionGroup id="document-details"> <action index="340" id="bubble-action" /> </actionGroup> </actionGroups> </config>
The button appears on share but does nothing when clicked. I suspect my wiring is wrong. Or maybe I just went about this the wrong way.
Labels:
- Labels:
-
Archive
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2015 04:45 AM
Hello,
I've got a similar effect when the action bean id was different than the action name in the share config:
If it's not the cause of your error, I've got no idea.
I've got a similar effect when the action bean id was different than the action name in the share config:
<!– Spring context: custom bean action definition–><bean id="bubble-click" class="somepath/YourAction.java" parent="action-executer"/><!– share custom config: the name of the action should be equals to the id of your bean –><param name="action">bubble-click</param>
If it's not the cause of your error, I've got no idea.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2015 05:22 AM
Hello Sam,
The bean id is the same. This is a strange thing though.
Thanks for the reply, I will continue to look for a solution still.
The bean id is the same. This is a strange thing though.
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'><beans> <!– Add aspect custom action –> <bean id="bubble-click" class="za.gov.parliament.customActions.BubbleClick" parent="action-executer"> <property name="publicAction"> <value>false</value> </property> </bean></beans>
Thanks for the reply, I will continue to look for a solution still.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2015 06:57 AM
It would have been too easy if it was that.
Otherwise you could check that the action indexes are not in conflict with others (E.g. share-documentlibrary-config.xml)
But I'm not sure it has a real impact if you put two actions with the same index, it probably just take the last one in the list.
I notice you set publicAction to false, have you tried to keep the default value which is true (I'm not sure about this boolean).
Otherwise you could check that the action indexes are not in conflict with others (E.g. share-documentlibrary-config.xml)
<!– an example of existing action–><action index="110" id="document-view-content" />
But I'm not sure it has a real impact if you put two actions with the same index, it probably just take the last one in the list.
I notice you set publicAction to false, have you tried to keep the default value which is true (I'm not sure about this boolean).
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2015 02:57 AM
Public action only makes it available in the Rule config drop down list, which works from there. I have tried it even after clearing Alfresco's cache still no luck.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2015 05:11 AM
Have your
za.gov.parliament.customActions.BubbleClick
any parameter?
Hyland Developer Evangelist
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2015 09:00 AM
It takes no parameters. All it has to do is print a message to the log file, logic will be added once the button is clickable.
PS: The action works if invoked as part of a rule and also as a javascript action i.e. actions.create("bubble-click").
PS: The action works if invoked as part of a rule and also as a javascript action i.e. actions.create("bubble-click").
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2015 10:38 AM
If invoked as a part of a rule or if invoked as a JavaScript action have no connection with Share webapp. The problem seems to be that Share does not find
bubble-click
action. If there are no params, the action ID is right and no client JavaScript error is thrown, it must be parameters in the definition. Try to complete declaration with:<param name="successMessage">Success</param><param name="failureMessage">Failure</param>
Hyland Developer Evangelist
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2015 11:16 AM
Omission of those two lines was the issue, it now works.
Lesson learned.
Lesson learned.
