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