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