1
14
15 package com.liferay.portlet.journal.workflow;
16
17 import com.liferay.portal.service.ServiceContext;
18 import com.liferay.portal.workflow.BaseWorkflowHandler;
19 import com.liferay.portlet.asset.model.AssetRenderer;
20 import com.liferay.portlet.journal.asset.JournalArticleAssetRenderer;
21 import com.liferay.portlet.journal.model.JournalArticle;
22 import com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil;
23
24
31 public class JournalArticleWorkflowHandler extends BaseWorkflowHandler {
32
33 public static final String CLASS_NAME = JournalArticle.class.getName();
34
35 public String getClassName() {
36 return CLASS_NAME;
37 }
38
39 public String getType() {
40 return TYPE_CONTENT;
41 }
42
43 public JournalArticle updateStatus(
44 long companyId, long groupId, long userId, long classPK, int status)
45 throws Exception {
46
47 ServiceContext serviceContext = new ServiceContext();
48
49 serviceContext.setScopeGroupId(groupId);
50
51 return JournalArticleLocalServiceUtil.updateStatus(
52 userId, classPK, status, serviceContext);
53 }
54
55 protected AssetRenderer getAssetRenderer(long classPK) throws Exception {
56 JournalArticle article = JournalArticleLocalServiceUtil.getArticle(
57 classPK);
58
59 return new JournalArticleAssetRenderer(article);
60 }
61
62 }