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