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

Alfresco 如何在自定义操作上显示动态消息?,alfresco,alfresco-share,Alfresco,Alfresco Share,我在share-config-custom.xml中设置了一个这样的自定义操作 <action id="deploy-asset-qa" type="javascript" label="Deploy File to QA..." icon="document-move-to"> <param name="function">onActionSimpleRepoAction</param> <permissions>

我在share-config-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>

onActionSimpleRepoAction
写
部署资产qa
message.deployment-success-qa
message.deployment-failure-qa
这非常有效,但这只显示硬编码的消息,无论是成功还是失败

我想向用户提供更多的动态错误消息,以提供良好的反馈

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


我正在使用Alfresco Community 5.0.d

是的,您可以这样做。尝试以下步骤。我给出了一个通用的场景,你可以在你的案例中应用

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!

动态消息是什么意思?successMessage或failureMessage的参数都指向一个属性文件值,该值在一个小弹出窗口中显示静态文本。目前,他们说“部署到QA成功”或“部署到QA失败”,但我想展示一个更具描述性的消息,说明为什么它无法帮助用户解决问题。@MJSalinas你能找到答案吗?@kgthegreat nope,一位同事创建了一个动态html,然后在流程运行后弹出。它显示了这两种情况的详细信息。@kgthegreat是的,就是这样。我仍然不认为这是最好的解决方案,但它确实为我们提供了很好的定制。