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
40 public class JournalStructureServiceImpl
41 extends JournalStructureServiceBaseImpl {
42
43 public JournalStructure addStructure(
44 long groupId, String structureId, boolean autoStructureId,
45 String parentStructureId, String name, String description,
46 String xsd, ServiceContext serviceContext)
47 throws PortalException, SystemException {
48
49 JournalPermission.check(
50 getPermissionChecker(), groupId, ActionKeys.ADD_STRUCTURE);
51
52 return journalStructureLocalService.addStructure(
53 getUserId(), groupId, structureId, autoStructureId,
54 parentStructureId, name, description, xsd, serviceContext);
55 }
56
57 public JournalStructure copyStructure(
58 long groupId, String oldStructureId, String newStructureId,
59 boolean autoStructureId)
60 throws PortalException, SystemException {
61
62 JournalPermission.check(
63 getPermissionChecker(), groupId, ActionKeys.ADD_STRUCTURE);
64
65 return journalStructureLocalService.copyStructure(
66 getUserId(), groupId, oldStructureId, newStructureId,
67 autoStructureId);
68 }
69
70 public void deleteStructure(long groupId, String structureId)
71 throws PortalException, SystemException {
72
73 JournalStructurePermission.check(
74 getPermissionChecker(), groupId, structureId, ActionKeys.DELETE);
75
76 journalStructureLocalService.deleteStructure(groupId, structureId);
77 }
78
79 public JournalStructure getStructure(long groupId, String structureId)
80 throws PortalException, SystemException {
81
82 JournalStructurePermission.check(
83 getPermissionChecker(), groupId, structureId, ActionKeys.VIEW);
84
85 return journalStructureLocalService.getStructure(groupId, structureId);
86 }
87
88 public JournalStructure updateStructure(
89 long groupId, String structureId, String parentStructureId,
90 String name, String description, String xsd,
91 ServiceContext serviceContext)
92 throws PortalException, SystemException {
93
94 JournalStructurePermission.check(
95 getPermissionChecker(), groupId, structureId, ActionKeys.UPDATE);
96
97 return journalStructureLocalService.updateStructure(
98 groupId, structureId, parentStructureId, name, description, xsd,
99 serviceContext);
100 }
101
102 }