I want to do a custom action associated to rule. I created my proyect structure with the help of this page: http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven I used this guide http://wiki.alfresco.com/wiki/Custom_Action_UI for proyect development.
我的问题是: 我制定了我的习惯行动。 我在Alfresco UI中选择了这个词,而我则在“Set Values and Add”报上,但当我介绍参数时,它就没有了。 我不知道我是否不得不在某个地方开始这样做......但“准备”的方法从未被称作,只是在实施习俗行动时。 然后,参数的价值永远不会持续下去,我不知道如何做到这一点。
定义:
protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
paramList.add(new ParameterDefinitionImpl(PARAM_CUSTOM_URL, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_CUSTOM_URL)));
}
The jsp:
<r:page titleId="title_custom_url_action_executer">
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<r:loadBundle var="msg"/>
<h:form acceptcharset="UTF-8" id="custom_url_action">
......
<tr>
<td valign="top"><h:outputText value="#{msg.custom_url}"/>:</td>
<td width="90%">
<h:inputText id="custom_url" value="#{WizardManager.bean.actionProperties.custom_url}" size="50" maxlength="1024" />
</td>
</tr>
......
</h:form>
</f:view>
</r:page>
My ActionHandler:
public class UrlActionHandler extends BaseActionHandler{
protected static final Logger LOG = LoggerFactory.getLogger(UrlActionHandler.class);
/**
*
*/
private static final long serialVersionUID = 1L;
public final static String PROP_CUSTOM_URL = "custom-url";
public String getJSPPath() {
return "/jsp/actions/custom-url-action-executer.jsp";
}
public void prepareForSave(Map<String, Serializable> actionProps, Map<String, Serializable> repoProps) {
repoProps.put(UrlActionExecuter.PARAM_CUSTOM_URL, (String)actionProps.get(PROP_CUSTOM_URL));
}
public void prepareForEdit(Map<String, Serializable> actionProps, Map<String, Serializable> repoProps) {
actionProps.put(PROP_CUSTOM_URL, (String)repoProps.get(UrlActionExecuter.PARAM_CUSTOM_URL));
}
public String generateSummary(FacesContext context, IWizardBean wizard, Map<String, Serializable> actionProps) {
String url = (String)actionProps.get(PROP_CUSTOM_URL);
if (url == null) {
url = "";
}
return MessageFormat.format(Application.getMessage(context, "custom-url-action-executer"), new Object[] {url});
}
}
网络客户-汇合系统文档:
<alfresco-config>
<config evaluator="string-compare" condition="Action Wizards">
<action-handlers>
<handler name="custom-url-action-executer" class="executer.UrlActionHandler" />
</action-handlers>
</config>
</alfresco-config>