Jsp Alfresco中带有参数的新自定义操作

Jsp Alfresco中带有参数的新自定义操作,jsp,custom-action,alfresco,Jsp,Custom Action,Alfresco,我想执行与规则关联的自定义操作。我在本页的帮助下创建了项目结构: 我在项目开发中使用了此指南 我的问题是:我创建了自定义操作。我在Alfresco UI中选择它并按下“设置值并添加”按钮,但当我引入参数值时,它不会保存。我不知道我是否需要在某个地方初始化它。。。但是,只有在执行自定义操作时,才会调用“prepareForSave”方法。然后参数的值永远不会持续,我不知道如何做 我已在方法addParameterDefinitions中定义了参数: protected void addParame

我想执行与规则关联的自定义操作。我在本页的帮助下创建了项目结构: 我在项目开发中使用了此指南

我的问题是:我创建了自定义操作。我在Alfresco UI中选择它并按下“设置值并添加”按钮,但当我引入参数值时,它不会保存。我不知道我是否需要在某个地方初始化它。。。但是,只有在执行自定义操作时,才会调用“prepareForSave”方法。然后参数的值永远不会持续,我不知道如何做

我已在方法addParameterDefinitions中定义了参数:

protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
        paramList.add(new ParameterDefinitionImpl(PARAM_CUSTOM_URL, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_CUSTOM_URL)));

}
受保护的void addParameterDefinitions(列表参数列表){
添加(新参数定义impl(PARAM_CUSTOM_URL,DataTypeDefinition.TEXT,true,getParamDisplayLabel(PARAM_CUSTOM_URL));
}
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>

......
:
......
我的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});
       }       

}
公共类UrlActionHandler扩展了BaseActionHandler{
受保护的静态最终记录器日志=LoggerFactory.getLogger(UrlActionHandler.class);
/**
* 
*/
私有静态最终长serialVersionUID=1L;
公共最终静态字符串PROP\u CUSTOM\u URL=“CUSTOM URL”;
公共字符串getJSPPath(){
返回“/jsp/actions/customurl action executer.jsp”;
}           
public void prepareForSave(地图操作道具、地图回复道具){
repoProps.put(UrlActionExecuter.PARAM_CUSTOM_URL,(String)actionProps.get(PROP_CUSTOM_URL));
}
public void prepareForEdit(地图操作道具、地图报告道具){
actionProps.put(PROP_CUSTOM_URL,(String)repoProps.get(UrlActionExecuter.PARAM_CUSTOM_URL));
}
公共字符串生成器摘要(FacesContext上下文、IWizardBean向导、Map actionProps){
stringurl=(String)actionProps.get(PROP\u CUSTOM\u url);
如果(url==null){
url=“”;
}           
returnmessageformat.format(Application.getMessage(上下文,“自定义url操作执行器”),新对象[]{url});
}       
}
web-client-config-custom.xml文件:

<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>


我的问题解决了!在我的jsp代码中有一个bug,它缺少一个ID。。。谢谢大家!嗨,克里斯蒂娜,你需要回答你自己的问题,然后问题就结束了。直到你这样做,这将保持开放4年后,它仍然是开放的。