tam*_*m0r 1 api comments liferay liferay-6
我正在尝试在JSF 2.0/ICEfaces portlet应用程序中使用内置注释功能(应用程序运行正常).不幸的是,似乎没有关于评论内容的详细文档,所以我希望有人可以给我一些指示如何创建和检索应该链接到单个整数的注释.
为了更清楚......我想(重新)在我的自定义portlet中使用"页面注释"portlet的功能,但只使用底层服务,而不是UI部分.
我已经发现该portlet通过EditDiscussionAction类使用MBMessageServiceUtil.addDiscussionMessage(...).不幸的是,我不知道我应该提供什么作为参数值.有人可以对此有所了解吗?该javadoc的是那种...短;-)
public static MBMessage addDiscussionMessage(long groupId,
String className,
long classPK,
String permissionClassName,
long permissionClassPK,
long threadId,
long parentMessageId,
String subject,
String body,
ServiceContext serviceContext)
Run Code Online (Sandbox Code Playgroud)
干杯,tamm0r
这将是漫长的,但这是戏剧的游戏.
MBMessageDisplay messageDisplay =
MBMessageLocalServiceUtil.getDiscussionMessageDisplay(
themeDisplay.getUserId(), themeDisplay.getScopeGroupId(),
MyModelEntry.class.getName(), myModelEntry.getTasksEntryId(),
WorkflowConstants.STATUS_APPROVED);
Run Code Online (Sandbox Code Playgroud)
MBMessageDisplay将包含threadId和parentMessageId等重要数据,因此请务必发布此数据.
在您的帖子中提到的呼叫的"控制器"中,从请求中获取ServiceContext,如下所示:
ServiceContext serviceContext = ServiceContextFactory.getInstance(
MyModelEntry.class.getName(), actionRequest);
Run Code Online (Sandbox Code Playgroud)所以你现在拥有了所需的所有参数.
long groupId - Group (Organization or Community usually) you're writing the comment in.
String className - MyModelEntry.class.getName()
long classPK - MyModelEntry's Primary Key or ID
String permissionClassName - Model where the permission checker should look, typically the same as className
long permissionClassPK - Its Primary Key or Id
long threadId - From MBMessageDisplay.
long parentMessageId - From MBMessageDisplay.
String subject - the subject
String body - the body
ServiceContext serviceContext - from Request in step 3.
Run Code Online (Sandbox Code Playgroud)希望这可以帮助!