001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.LongWrapper;
020 import com.liferay.portal.kernel.util.MethodWrapper;
021 import com.liferay.portal.kernel.util.NullWrapper;
022 import com.liferay.portal.security.auth.HttpPrincipal;
023 import com.liferay.portal.service.UserGroupGroupRoleServiceUtil;
024
025
055 public class UserGroupGroupRoleServiceHttp {
056 public static void addUserGroupGroupRoles(HttpPrincipal httpPrincipal,
057 long userGroupId, long groupId, long[] roleIds)
058 throws com.liferay.portal.kernel.exception.PortalException,
059 com.liferay.portal.kernel.exception.SystemException {
060 try {
061 Object paramObj0 = new LongWrapper(userGroupId);
062
063 Object paramObj1 = new LongWrapper(groupId);
064
065 Object paramObj2 = roleIds;
066
067 if (roleIds == null) {
068 paramObj2 = new NullWrapper("[J");
069 }
070
071 MethodWrapper methodWrapper = new MethodWrapper(UserGroupGroupRoleServiceUtil.class.getName(),
072 "addUserGroupGroupRoles",
073 new Object[] { paramObj0, paramObj1, paramObj2 });
074
075 try {
076 TunnelUtil.invoke(httpPrincipal, methodWrapper);
077 }
078 catch (Exception e) {
079 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
080 throw (com.liferay.portal.kernel.exception.PortalException)e;
081 }
082
083 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
084 throw (com.liferay.portal.kernel.exception.SystemException)e;
085 }
086
087 throw new com.liferay.portal.kernel.exception.SystemException(e);
088 }
089 }
090 catch (com.liferay.portal.kernel.exception.SystemException se) {
091 _log.error(se, se);
092
093 throw se;
094 }
095 }
096
097 public static void addUserGroupGroupRoles(HttpPrincipal httpPrincipal,
098 long[] userGroupIds, long groupId, long roleId)
099 throws com.liferay.portal.kernel.exception.PortalException,
100 com.liferay.portal.kernel.exception.SystemException {
101 try {
102 Object paramObj0 = userGroupIds;
103
104 if (userGroupIds == null) {
105 paramObj0 = new NullWrapper("[J");
106 }
107
108 Object paramObj1 = new LongWrapper(groupId);
109
110 Object paramObj2 = new LongWrapper(roleId);
111
112 MethodWrapper methodWrapper = new MethodWrapper(UserGroupGroupRoleServiceUtil.class.getName(),
113 "addUserGroupGroupRoles",
114 new Object[] { paramObj0, paramObj1, paramObj2 });
115
116 try {
117 TunnelUtil.invoke(httpPrincipal, methodWrapper);
118 }
119 catch (Exception e) {
120 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
121 throw (com.liferay.portal.kernel.exception.PortalException)e;
122 }
123
124 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
125 throw (com.liferay.portal.kernel.exception.SystemException)e;
126 }
127
128 throw new com.liferay.portal.kernel.exception.SystemException(e);
129 }
130 }
131 catch (com.liferay.portal.kernel.exception.SystemException se) {
132 _log.error(se, se);
133
134 throw se;
135 }
136 }
137
138 public static void deleteUserGroupGroupRoles(HttpPrincipal httpPrincipal,
139 long userGroupId, long groupId, long[] roleIds)
140 throws com.liferay.portal.kernel.exception.PortalException,
141 com.liferay.portal.kernel.exception.SystemException {
142 try {
143 Object paramObj0 = new LongWrapper(userGroupId);
144
145 Object paramObj1 = new LongWrapper(groupId);
146
147 Object paramObj2 = roleIds;
148
149 if (roleIds == null) {
150 paramObj2 = new NullWrapper("[J");
151 }
152
153 MethodWrapper methodWrapper = new MethodWrapper(UserGroupGroupRoleServiceUtil.class.getName(),
154 "deleteUserGroupGroupRoles",
155 new Object[] { paramObj0, paramObj1, paramObj2 });
156
157 try {
158 TunnelUtil.invoke(httpPrincipal, methodWrapper);
159 }
160 catch (Exception e) {
161 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
162 throw (com.liferay.portal.kernel.exception.PortalException)e;
163 }
164
165 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
166 throw (com.liferay.portal.kernel.exception.SystemException)e;
167 }
168
169 throw new com.liferay.portal.kernel.exception.SystemException(e);
170 }
171 }
172 catch (com.liferay.portal.kernel.exception.SystemException se) {
173 _log.error(se, se);
174
175 throw se;
176 }
177 }
178
179 public static void deleteUserGroupGroupRoles(HttpPrincipal httpPrincipal,
180 long[] userGroupIds, long groupId, long roleId)
181 throws com.liferay.portal.kernel.exception.PortalException,
182 com.liferay.portal.kernel.exception.SystemException {
183 try {
184 Object paramObj0 = userGroupIds;
185
186 if (userGroupIds == null) {
187 paramObj0 = new NullWrapper("[J");
188 }
189
190 Object paramObj1 = new LongWrapper(groupId);
191
192 Object paramObj2 = new LongWrapper(roleId);
193
194 MethodWrapper methodWrapper = new MethodWrapper(UserGroupGroupRoleServiceUtil.class.getName(),
195 "deleteUserGroupGroupRoles",
196 new Object[] { paramObj0, paramObj1, paramObj2 });
197
198 try {
199 TunnelUtil.invoke(httpPrincipal, methodWrapper);
200 }
201 catch (Exception e) {
202 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
203 throw (com.liferay.portal.kernel.exception.PortalException)e;
204 }
205
206 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
207 throw (com.liferay.portal.kernel.exception.SystemException)e;
208 }
209
210 throw new com.liferay.portal.kernel.exception.SystemException(e);
211 }
212 }
213 catch (com.liferay.portal.kernel.exception.SystemException se) {
214 _log.error(se, se);
215
216 throw se;
217 }
218 }
219
220 private static Log _log = LogFactoryUtil.getLog(UserGroupGroupRoleServiceHttp.class);
221 }