1
22
23 package com.liferay.portlet.journal.service.impl;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portal.security.permission.ActionKeys;
28 import com.liferay.portal.service.ServiceContext;
29 import com.liferay.portlet.journal.model.JournalStructure;
30 import com.liferay.portlet.journal.service.base.JournalStructureServiceBaseImpl;
31 import com.liferay.portlet.journal.service.permission.JournalPermission;
32 import com.liferay.portlet.journal.service.permission.JournalStructurePermission;
33
34
41 public class JournalStructureServiceImpl
42 extends JournalStructureServiceBaseImpl {
43
44 public JournalStructure addStructure(
45 long groupId, String structureId, boolean autoStructureId,
46 String parentStructureId, String name, String description,
47 String xsd, ServiceContext serviceContext)
48 throws PortalException, SystemException {
49
50 JournalPermission.check(
51 getPermissionChecker(), groupId, ActionKeys.ADD_STRUCTURE);
52
53 return journalStructureLocalService.addStructure(
54 getUserId(), groupId, structureId, autoStructureId,
55 parentStructureId, name, description, xsd, serviceContext);
56 }
57
58 public JournalStructure copyStructure(
59 long groupId, String oldStructureId, String newStructureId,
60 boolean autoStructureId)
61 throws PortalException, SystemException {
62
63 JournalPermission.check(
64 getPermissionChecker(), groupId, ActionKeys.ADD_STRUCTURE);
65
66 return journalStructureLocalService.copyStructure(
67 getUserId(), groupId, oldStructureId, newStructureId,
68 autoStructureId);
69 }
70
71 public void deleteStructure(long groupId, String structureId)
72 throws PortalException, SystemException {
73
74 JournalStructurePermission.check(
75 getPermissionChecker(), groupId, structureId, ActionKeys.DELETE);
76
77 journalStructureLocalService.deleteStructure(groupId, structureId);
78 }
79
80 public JournalStructure getStructure(long groupId, String structureId)
81 throws PortalException, SystemException {
82
83 JournalStructurePermission.check(
84 getPermissionChecker(), groupId, structureId, ActionKeys.VIEW);
85
86 return journalStructureLocalService.getStructure(groupId, structureId);
87 }
88
89 public JournalStructure updateStructure(
90 long groupId, String structureId, String parentStructureId,
91 String name, String description, String xsd,
92 ServiceContext serviceContext)
93 throws PortalException, SystemException {
94
95 JournalStructurePermission.check(
96 getPermissionChecker(), groupId, structureId, ActionKeys.UPDATE);
97
98 return journalStructureLocalService.updateStructure(
99 groupId, structureId, parentStructureId, name, description, xsd,
100 serviceContext);
101 }
102
103 }