简体   繁体   English

如何在Liferay的Kaleo工作流程中的single-approver-definition.xml中获取页面URL?

[英]How can i get page URL in single-approver-definition.xml in Kaleo workflow in Liferay?

How can i get the page URL in single-approver-definition.xml in the e-mail template that is used to send an e-mail to the content creator once the reviewer approves or rejects the submission. 在审阅者批准或拒绝提交后,如何在电子邮件模板的single-approver-definition.xml中获得页面URL,该页面URL用来向内容创建者发送电子邮件。 The existing xml is as follows: 现有的xml如下:

<template>
    Your submission has been reviewed and the reviewer has applied the following: 
    ${taskComments}.
</template>

I tried ${serviceContext.getAttribute("contentURL")} and it didn't work. 我尝试了${serviceContext.getAttribute("contentURL")} ,但没有成功。

I want to be able to do - Your submission for ${pageURL} has been reviewed and the reviewier has applied the following: \\n ${taskComments}.\\n 我希望能够这样做- Your submission for ${pageURL} has been reviewed and the reviewier has applied the following: \\n ${taskComments}.\\n

Any suggestions will be appreciated. 任何建议将不胜感激。

I don't get what variable exactly you want to process in your notification. 我没有在通知中确切得到要处理的变量。 As I can only assume, you are using it for Web Contents and all interesting variables are stored in two places. 我只能假设,您正在将它用于Web内容,所有有趣的变量都存储在两个位置。

  1. Workflow context variables - they are available directly. 工作流上下文变量-它们直接可用。 Few examples like: 几个例子如下:

    • ${taskComments} $ {taskComments}
    • ${entryType} $ {entryType}
    • ${userId} $ {userId}
    • ${userName} $ {userName}
    • ... ...
  2. ServiceContext variables - they are available using $serviceContext. ServiceContext变量-使用$ serviceContext可以使用。 Few examples: 几个例子:

    • $serviceContext.getAttributes().get("version") $ serviceContext.getAttributes()。get(“ version”)
    • $serviceContext.getAttributes().get("articleId") $ serviceContext.getAttributes()。get(“ articleId”)
    • ${serviceContext.getPortalURL()} $ {serviceContext.getPortalURL()}
    • ... ...

For all interesting variables check this url https://www.liferay.com/web/igor.beslic/blog/-/blogs/workflow-in-action-kaleo-workflow-context-variables Some could change already, however most of them is working fine for current version. 对于所有有趣的变量,请检查以下网址https://www.liferay.com/web/igor.beslic/blog/-/blogs/workflow-in-action-kaleo-workflow-context-variables有些可能已经更改,但是大多数他们适用于当前版本。

Content changes might be made on a page, they can also be triggered through Control Panel (or the API for that matter). 内容更改可以在页面上进行,也可以通过控制面板(或与此相关的API)来触发。 When you're in a workflow, you typically don't have this context any more - if you find it somehow I'd not rely on it to be there. 当您处于工作流程中时,通常将不再有此上下文-如果您以某种方式找到它,我将不依赖它。 A workflow is unrelated to the UI and pages. 工作流程与UI和页面无关。

Also, an article might be submitted on one page, where it might be replaced/removed before it's even approved. 此外,文章可能会在一页上提交,甚至在批准之前可能会在此处替换/删除。 In that case the link wouldn't help. 在这种情况下,链接将无济于事。

What might work is to check the concept behind "Web Content Display Pages" (if your article has them configured and you deal with web content). 可行的方法是检查“ Web内容显示页面”背后的概念(如果您的文章已配置它们并且您处理Web内容)。 But the mechanics will vary depending on the actual content type you're dealing with. 但是机制会因您要处理的实际内容类型而异。 And content that goes through workflow might not be displayed on any page at all (eg when submitted through Control Panel) or on many different pages (either explicitly - Web Content Display - or implicitly - Asset Publisher). 通过工作流的内容可能根本不会显示在任何页面上(例如,通过控制面板提交时),也不会显示在许多不同的页面上(显式-Web内容显示-或隐式-Asset Publisher)。

@tomic basically provides pointers to what you have, I'm only reasoning why your initial problem is problematic to solve at best - it's not fully specifiable. @tomic基本上提供了指向您所拥有内容的指针,我只是在说为什么最初的问题充其量是无法解决的问题-尚无法完全确定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM