English 中文(简体)
具有Alfresco参数的新习俗行动
原标题:New custom action with parameters in Alfresco

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>
问题回答

暂无回答




相关问题
WIX C++ Custom Action

I have a basic WIX custom action: UINT __stdcall MyCustomAction(MSIHANDLE hInstaller) { DWORD dwSize=0; MsiGetProperty(hInstaller, TEXT("MyProperty"), TEXT("...

Execute a .exe file automatically after installation

I have a .exe file, which should be executed as soon as the installation of the main application is finished. I understand this can be achieved using Custom action. I need a little assistance in ...

Empty setup project in Visual Studio 2008

I have a ClickOnce installation I want to distribute. Some system administrators prefer a MSI installation package which, when run, installs the ClickOnce application. I ve created a Visual Studio ...

ASP.NET MVC Pass object from Custom Action Filter to Action

If I create an object in a Custom Action Filter in ASP.NET MVC in public override void OnActionExecuting(ActionExecutingContext filterContext) { DetachedCriteria criteria = DetachedCriteria.For&...

热门标签