08-25-2014 08:39 AM
DocLibAction
according to this site http://blog.arvixe.com/add-custom-action-in-alfresco-share/. But in Java action I am not able to get values from form and node of action is null
. When I try to write down Action
variable, result is Action[ id=a951d684-1caf-48a8-a142-c646cfda10bd, node=null ]
.
<config evaluator="string-compare" condition="doc-tagging">
<forms>
<form>
<field-visibility>
<show id="tagname" name="tagname" />
</field-visibility>
<appearance>
<field id="tagname" label-id="doc-tagging.field.tagname">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
…
<config evaluator="string-compare" condition="DocLibActions">
<actions>
<action id="document-tagging" type="javascript" label="actions.document.tagging" icon="folder-move-to">
<param name="function">onActionFormDialog</param>
<param name="itemKind">action</param>
<param name="itemId">doc-tagging</param>
<param name="mode">create</param>
<param name="destination">{node.nodeRef}</param>
<param name="successMessage">message.tagging.success</param>
<param name="failureMessage">message.tagging.failure</param>
</action>
</actions>
<actionGroups>
<actionGroup id="document-browse">
<action index="370" id="document-tagging" />
</actionGroup>
<actionGroup id="document-details">
<action index="400" id="document-tagging" />
</actionGroup>
</actionGroups>
</config>
<bean id="doc-tagging" class="com.mycompany.cms.action.DocumentTaggingActionExecuter" parent="action-executer">
<property name="nodeService">
<ref bean="NodeService" />
</property>
</bean>
public class DocumentTaggingActionExecuter extends ActionExecuterAbstractBase {
private NodeService nodeService;
public void setNodeService(NodeService nodeService) {
this.nodeService = nodeService;
}
protected void executeImpl(Action action, NodeRef arg1) {
System.out.println("action: " + action.toString());
System.out.println("tagname = " + (String) action.getParameterValue("tagname"));
}
protected void addParameterDefinitions(List<ParameterDefinition> arg0) {}
}
action: Action[ id=a951d684-1caf-48a8-a142-c646cfda10bd, node=null ]
tagname: null
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.