1
22
23 package com.liferay.portal.service.impl;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portal.model.OrgLabor;
28 import com.liferay.portal.security.permission.ActionKeys;
29 import com.liferay.portal.service.base.OrgLaborServiceBaseImpl;
30 import com.liferay.portal.service.permission.OrganizationPermissionUtil;
31
32 import java.util.List;
33
34
40 public class OrgLaborServiceImpl extends OrgLaborServiceBaseImpl {
41
42 public OrgLabor addOrgLabor(
43 long organizationId, int typeId, int sunOpen, int sunClose,
44 int monOpen, int monClose, int tueOpen, int tueClose, int wedOpen,
45 int wedClose, int thuOpen, int thuClose, int friOpen, int friClose,
46 int satOpen, int satClose)
47 throws PortalException, SystemException {
48
49 OrganizationPermissionUtil.check(
50 getPermissionChecker(), organizationId, ActionKeys.UPDATE);
51
52 return orgLaborLocalService.addOrgLabor(
53 organizationId, typeId, sunOpen, sunClose, monOpen, monClose,
54 tueOpen, tueClose, wedOpen, wedClose, thuOpen, thuClose, friOpen,
55 friClose, satOpen, satClose);
56 }
57
58 public void deleteOrgLabor(long orgLaborId)
59 throws PortalException, SystemException {
60
61 OrgLabor orgLabor = orgLaborPersistence.findByPrimaryKey(orgLaborId);
62
63 OrganizationPermissionUtil.check(
64 getPermissionChecker(), orgLabor.getOrganizationId(),
65 ActionKeys.UPDATE);
66
67 orgLaborLocalService.deleteOrgLabor(orgLaborId);
68 }
69
70 public OrgLabor getOrgLabor(long orgLaborId)
71 throws PortalException, SystemException {
72
73 OrgLabor orgLabor = orgLaborPersistence.findByPrimaryKey(orgLaborId);
74
75 OrganizationPermissionUtil.check(
76 getPermissionChecker(), orgLabor.getOrganizationId(),
77 ActionKeys.VIEW);
78
79 return orgLabor;
80 }
81
82 public List<OrgLabor> getOrgLabors(long organizationId)
83 throws PortalException, SystemException {
84
85 OrganizationPermissionUtil.check(
86 getPermissionChecker(), organizationId, ActionKeys.VIEW);
87
88 return orgLaborLocalService.getOrgLabors(organizationId);
89 }
90
91 public OrgLabor updateOrgLabor(
92 long orgLaborId, int typeId, int sunOpen, int sunClose, int monOpen,
93 int monClose, int tueOpen, int tueClose, int wedOpen, int wedClose,
94 int thuOpen, int thuClose, int friOpen, int friClose, int satOpen,
95 int satClose)
96 throws PortalException, SystemException {
97
98 OrgLabor orgLabor = orgLaborPersistence.findByPrimaryKey(orgLaborId);
99
100 OrganizationPermissionUtil.check(
101 getPermissionChecker(), orgLabor.getOrganizationId(),
102 ActionKeys.UPDATE);
103
104 return orgLaborLocalService.updateOrgLabor(
105 orgLaborId, typeId ,sunOpen, sunClose, monOpen, monClose, tueOpen,
106 tueClose, wedOpen, wedClose, thuOpen, thuClose, friOpen, friClose,
107 satOpen, satClose);
108 }
109
110 }