我使用与Tomcat服务器和Oracle 10g数据库捆绑在一起的Liferay 6.1.1-ce-ga2。 我的目标是插入一些内容,作为期刊文章,并在资产发布者(具有结构和模板,已经工作)中显示它们。
我将JournalArticleServiceSoap.addArticle(...)
与正确的字段(groupid, structureid, templateid, ...)
一起使用。内容被“正确”插入数据库中,我可以从管理员内容面板中看到它们在Web内容中。内容也以"Approved"
为状态。这可以通过设置:
serviceContext.setWorkflowAction(WorkflowConstants.ACTION_PUBLISH)
但是,我无法看到插入的内容与Asset Publisher中的其他内容一起显示,直到我再次打开它进行编辑并单击“发布”按钮(即使没有更改任何内容)。然后按预期发布内容。问题是内容的数量。它大概是600,所以我不能为每个人采取这个行动。
我不明白是什么问题以及如何解决这个问题?换句话说,我需要做些什么来使Web服务插入的Web内容在Asset Publisher中自动显示?
或者,"Publish"
究竟做了什么,所以我可以尝试使用SOAP服务(或插入后的SQL)以编程方式重现?
提前感谢您的帮助。
我也在Liferay论坛上发布了同样的问题:Problem to display JournalArticle inserted by SOAP web service
答案 0 :(得分:0)
你可以尝试记录从Liferay访问的数据库,看看你手动保存文章后会有什么变化。为此,将hibernate的日志记录级别设置为info或debug。
答案 1 :(得分:0)
ServiceContext serviceContext = new ServiceContext();
serviceContext.setAddGuestPermissions(true);
serviceContext.setAddGroupPermissions(true);
serviceContext.setScopeGroupId(groupId);
serviceContext.setWorkflowAction(WorkflowConstants.ACTION_PUBLISH);
答案 2 :(得分:0)
您必须像这样设置serviceContext:
ServiceContext serviceContext = new ServiceContext();
//serviceContext.setAddGuestPermissions(true);
//serviceContext.setAddGroupPermissions(true);
serviceContext.setScopeGroupId(groupId);
serviceContext.setWorkflowAction(1);
serviceContext.setIndexingEnabled(true);
serviceContext.setIndexingEnabled(真);非常重要。
以下代码不必重新加盖。
serviceContext.setAddGuestPermissions(true);
serviceContext.setAddGroupPermissions(true);