2015-10-20 61 views
2

我在股票配置,custom.xml如何在自定义操作中显示动态消息?

<action id="deploy-asset-qa" type="javascript" label="Deploy File to QA..." icon="document-move-to"> 
    <param name="function">onActionSimpleRepoAction</param> 
    <permissions> 
     <permission allow="true">Write</permission> 
    </permissions> 
    <param name="action">deploy-asset-qa</param> 
    <param name="successMessage">message.deployment-success-qa</param> 
    <param name="failureMessage">message.deployment-failure-qa</param> 
</action> 

这个伟大的工程设立这样一个工作自定义操作,但是这只能说明硬编码的消息,如果它是成功还是失败。

我想给用户提供更好的反馈的动态错误消息。

如何在自定义操作中显示动态消息?

我使用的是Alfresco Community 5.0.d

+0

你是什么意思的动态消息? –

+0

successMessage或failureMessage的参数指向一个属性文件值,该值在小弹出窗口中显示静态文本。目前他们说“部署到质量保证是成功的”或“部署到质量保证失败”,但我想显示一个更具描述性的信息,说明为什么它不能帮助用户。 – MJSalinas

+0

@MJSalinas你能解释清楚吗? – kgthegreat

回答

0

是的,你可以这样做。尝试以下步骤。我给你一个通用的场景,你可以申请你的情况。

1)From Share UI, I click on custom action 
2)This action will call your Repo data webscript to check datatype OR whatever is your logic. 
3)You can define specific Success/Failure message as part of your data webscript's JSON response. 
4)You can access this response and so this custom message in Share client side js 
5)Display this message to users. 

For Failure I would suggest You can add, specific template file with failure status code and Failure message. 
Ex: customAction.get.json.500.ftl , customAction.get.json.400.ftl etc.. 

Hope it helps! 
相关问题