1
14
15 package com.liferay.portal.service.http;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.LongWrapper;
20 import com.liferay.portal.kernel.util.MethodWrapper;
21 import com.liferay.portal.kernel.util.NullWrapper;
22 import com.liferay.portal.security.auth.HttpPrincipal;
23 import com.liferay.portal.service.UserGroupGroupRoleServiceUtil;
24
25
62 public class UserGroupGroupRoleServiceHttp {
63 public static void addUserGroupGroupRoles(HttpPrincipal httpPrincipal,
64 long userGroupId, long groupId, long[] roleIds)
65 throws com.liferay.portal.kernel.exception.PortalException,
66 com.liferay.portal.kernel.exception.SystemException {
67 try {
68 Object paramObj0 = new LongWrapper(userGroupId);
69
70 Object paramObj1 = new LongWrapper(groupId);
71
72 Object paramObj2 = roleIds;
73
74 if (roleIds == null) {
75 paramObj2 = new NullWrapper("[J");
76 }
77
78 MethodWrapper methodWrapper = new MethodWrapper(UserGroupGroupRoleServiceUtil.class.getName(),
79 "addUserGroupGroupRoles",
80 new Object[] { paramObj0, paramObj1, paramObj2 });
81
82 try {
83 TunnelUtil.invoke(httpPrincipal, methodWrapper);
84 }
85 catch (Exception e) {
86 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
87 throw (com.liferay.portal.kernel.exception.PortalException)e;
88 }
89
90 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
91 throw (com.liferay.portal.kernel.exception.SystemException)e;
92 }
93
94 throw new com.liferay.portal.kernel.exception.SystemException(e);
95 }
96 }
97 catch (com.liferay.portal.kernel.exception.SystemException se) {
98 _log.error(se, se);
99
100 throw se;
101 }
102 }
103
104 public static void addUserGroupGroupRoles(HttpPrincipal httpPrincipal,
105 long[] userGroupIds, long groupId, long roleId)
106 throws com.liferay.portal.kernel.exception.PortalException,
107 com.liferay.portal.kernel.exception.SystemException {
108 try {
109 Object paramObj0 = userGroupIds;
110
111 if (userGroupIds == null) {
112 paramObj0 = new NullWrapper("[J");
113 }
114
115 Object paramObj1 = new LongWrapper(groupId);
116
117 Object paramObj2 = new LongWrapper(roleId);
118
119 MethodWrapper methodWrapper = new MethodWrapper(UserGroupGroupRoleServiceUtil.class.getName(),
120 "addUserGroupGroupRoles",
121 new Object[] { paramObj0, paramObj1, paramObj2 });
122
123 try {
124 TunnelUtil.invoke(httpPrincipal, methodWrapper);
125 }
126 catch (Exception e) {
127 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
128 throw (com.liferay.portal.kernel.exception.PortalException)e;
129 }
130
131 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
132 throw (com.liferay.portal.kernel.exception.SystemException)e;
133 }
134
135 throw new com.liferay.portal.kernel.exception.SystemException(e);
136 }
137 }
138 catch (com.liferay.portal.kernel.exception.SystemException se) {
139 _log.error(se, se);
140
141 throw se;
142 }
143 }
144
145 public static void deleteUserGroupGroupRoles(HttpPrincipal httpPrincipal,
146 long userGroupId, long groupId, long[] roleIds)
147 throws com.liferay.portal.kernel.exception.PortalException,
148 com.liferay.portal.kernel.exception.SystemException {
149 try {
150 Object paramObj0 = new LongWrapper(userGroupId);
151
152 Object paramObj1 = new LongWrapper(groupId);
153
154 Object paramObj2 = roleIds;
155
156 if (roleIds == null) {
157 paramObj2 = new NullWrapper("[J");
158 }
159
160 MethodWrapper methodWrapper = new MethodWrapper(UserGroupGroupRoleServiceUtil.class.getName(),
161 "deleteUserGroupGroupRoles",
162 new Object[] { paramObj0, paramObj1, paramObj2 });
163
164 try {
165 TunnelUtil.invoke(httpPrincipal, methodWrapper);
166 }
167 catch (Exception e) {
168 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
169 throw (com.liferay.portal.kernel.exception.PortalException)e;
170 }
171
172 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
173 throw (com.liferay.portal.kernel.exception.SystemException)e;
174 }
175
176 throw new com.liferay.portal.kernel.exception.SystemException(e);
177 }
178 }
179 catch (com.liferay.portal.kernel.exception.SystemException se) {
180 _log.error(se, se);
181
182 throw se;
183 }
184 }
185
186 public static void deleteUserGroupGroupRoles(HttpPrincipal httpPrincipal,
187 long[] userGroupIds, long groupId, long roleId)
188 throws com.liferay.portal.kernel.exception.PortalException,
189 com.liferay.portal.kernel.exception.SystemException {
190 try {
191 Object paramObj0 = userGroupIds;
192
193 if (userGroupIds == null) {
194 paramObj0 = new NullWrapper("[J");
195 }
196
197 Object paramObj1 = new LongWrapper(groupId);
198
199 Object paramObj2 = new LongWrapper(roleId);
200
201 MethodWrapper methodWrapper = new MethodWrapper(UserGroupGroupRoleServiceUtil.class.getName(),
202 "deleteUserGroupGroupRoles",
203 new Object[] { paramObj0, paramObj1, paramObj2 });
204
205 try {
206 TunnelUtil.invoke(httpPrincipal, methodWrapper);
207 }
208 catch (Exception e) {
209 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
210 throw (com.liferay.portal.kernel.exception.PortalException)e;
211 }
212
213 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
214 throw (com.liferay.portal.kernel.exception.SystemException)e;
215 }
216
217 throw new com.liferay.portal.kernel.exception.SystemException(e);
218 }
219 }
220 catch (com.liferay.portal.kernel.exception.SystemException se) {
221 _log.error(se, se);
222
223 throw se;
224 }
225 }
226
227 private static Log _log = LogFactoryUtil.getLog(UserGroupGroupRoleServiceHttp.class);
228 }