001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.service.http;
022:
023: import com.liferay.portal.kernel.log.Log;
024: import com.liferay.portal.kernel.log.LogFactoryUtil;
025: import com.liferay.portal.service.PermissionServiceUtil;
026:
027: import java.rmi.RemoteException;
028:
029: /**
030: * <a href="PermissionServiceSoap.java.html"><b><i>View Source</i></b></a>
031: *
032: * <p>
033: * ServiceBuilder generated this class. Modifications in this class will be
034: * overwritten the next time is generated.
035: * </p>
036: *
037: * <p>
038: * This class provides a SOAP utility for the
039: * <code>com.liferay.portal.service.PermissionServiceUtil</code> service
040: * utility. The static methods of this class calls the same methods of the
041: * service utility. However, the signatures are different because it is
042: * difficult for SOAP to support certain types.
043: * </p>
044: *
045: * <p>
046: * ServiceBuilder follows certain rules in translating the methods. For example,
047: * if the method in the service utility returns a <code>java.util.List</code>,
048: * that is translated to an array of
049: * <code>com.liferay.portal.model.PermissionSoap</code>. If the method in the
050: * service utility returns a <code>com.liferay.portal.model.Permission</code>,
051: * that is translated to a <code>com.liferay.portal.model.PermissionSoap</code>.
052: * Methods that SOAP cannot safely wire are skipped.
053: * </p>
054: *
055: * <p>
056: * The benefits of using the SOAP utility is that it is cross platform
057: * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
058: * even Perl, to call the generated services. One drawback of SOAP is that it is
059: * slow because it needs to serialize all calls into a text format (XML).
060: * </p>
061: *
062: * <p>
063: * You can see a list of services at
064: * http://localhost:8080/tunnel-web/secure/axis. Set the property
065: * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
066: * security.
067: * </p>
068: *
069: * <p>
070: * The SOAP utility is only generated for remote services.
071: * </p>
072: *
073: * @author Brian Wing Shun Chan
074: *
075: * @see com.liferay.portal.service.PermissionServiceUtil
076: * @see com.liferay.portal.service.http.PermissionServiceHttp
077: * @see com.liferay.portal.service.model.PermissionSoap
078: *
079: */
080: public class PermissionServiceSoap {
081: public static void checkPermission(long groupId,
082: java.lang.String name, java.lang.String primKey)
083: throws RemoteException {
084: try {
085: PermissionServiceUtil.checkPermission(groupId, name,
086: primKey);
087: } catch (Exception e) {
088: _log.error(e, e);
089:
090: throw new RemoteException(e.getMessage());
091: }
092: }
093:
094: public static boolean hasGroupPermission(long groupId,
095: java.lang.String actionId, long resourceId)
096: throws RemoteException {
097: try {
098: boolean returnValue = PermissionServiceUtil
099: .hasGroupPermission(groupId, actionId, resourceId);
100:
101: return returnValue;
102: } catch (Exception e) {
103: _log.error(e, e);
104:
105: throw new RemoteException(e.getMessage());
106: }
107: }
108:
109: public static boolean hasUserPermission(long userId,
110: java.lang.String actionId, long resourceId)
111: throws RemoteException {
112: try {
113: boolean returnValue = PermissionServiceUtil
114: .hasUserPermission(userId, actionId, resourceId);
115:
116: return returnValue;
117: } catch (Exception e) {
118: _log.error(e, e);
119:
120: throw new RemoteException(e.getMessage());
121: }
122: }
123:
124: public static boolean hasUserPermissions(
125: long userId,
126: long groupId,
127: java.lang.String actionId,
128: long[] resourceIds,
129: com.liferay.portal.kernel.security.permission.PermissionCheckerBag permissionCheckerBag)
130: throws RemoteException {
131: try {
132: boolean returnValue = PermissionServiceUtil
133: .hasUserPermissions(userId, groupId, actionId,
134: resourceIds, permissionCheckerBag);
135:
136: return returnValue;
137: } catch (Exception e) {
138: _log.error(e, e);
139:
140: throw new RemoteException(e.getMessage());
141: }
142: }
143:
144: public static void setGroupPermissions(long groupId,
145: java.lang.String[] actionIds, long resourceId)
146: throws RemoteException {
147: try {
148: PermissionServiceUtil.setGroupPermissions(groupId,
149: actionIds, resourceId);
150: } catch (Exception e) {
151: _log.error(e, e);
152:
153: throw new RemoteException(e.getMessage());
154: }
155: }
156:
157: public static void setGroupPermissions(java.lang.String className,
158: java.lang.String classPK, long groupId,
159: java.lang.String[] actionIds, long resourceId)
160: throws RemoteException {
161: try {
162: PermissionServiceUtil.setGroupPermissions(className,
163: classPK, groupId, actionIds, resourceId);
164: } catch (Exception e) {
165: _log.error(e, e);
166:
167: throw new RemoteException(e.getMessage());
168: }
169: }
170:
171: public static void setOrgGroupPermissions(long organizationId,
172: long groupId, java.lang.String[] actionIds, long resourceId)
173: throws RemoteException {
174: try {
175: PermissionServiceUtil.setOrgGroupPermissions(
176: organizationId, groupId, actionIds, resourceId);
177: } catch (Exception e) {
178: _log.error(e, e);
179:
180: throw new RemoteException(e.getMessage());
181: }
182: }
183:
184: public static void setRolePermission(long roleId, long groupId,
185: java.lang.String name, int scope, java.lang.String primKey,
186: java.lang.String actionId) throws RemoteException {
187: try {
188: PermissionServiceUtil.setRolePermission(roleId, groupId,
189: name, scope, primKey, actionId);
190: } catch (Exception e) {
191: _log.error(e, e);
192:
193: throw new RemoteException(e.getMessage());
194: }
195: }
196:
197: public static void setRolePermissions(long roleId, long groupId,
198: java.lang.String[] actionIds, long resourceId)
199: throws RemoteException {
200: try {
201: PermissionServiceUtil.setRolePermissions(roleId, groupId,
202: actionIds, resourceId);
203: } catch (Exception e) {
204: _log.error(e, e);
205:
206: throw new RemoteException(e.getMessage());
207: }
208: }
209:
210: public static void setUserPermissions(long userId, long groupId,
211: java.lang.String[] actionIds, long resourceId)
212: throws RemoteException {
213: try {
214: PermissionServiceUtil.setUserPermissions(userId, groupId,
215: actionIds, resourceId);
216: } catch (Exception e) {
217: _log.error(e, e);
218:
219: throw new RemoteException(e.getMessage());
220: }
221: }
222:
223: public static void unsetRolePermission(long roleId, long groupId,
224: long permissionId) throws RemoteException {
225: try {
226: PermissionServiceUtil.unsetRolePermission(roleId, groupId,
227: permissionId);
228: } catch (Exception e) {
229: _log.error(e, e);
230:
231: throw new RemoteException(e.getMessage());
232: }
233: }
234:
235: public static void unsetRolePermission(long roleId, long groupId,
236: java.lang.String name, int scope, java.lang.String primKey,
237: java.lang.String actionId) throws RemoteException {
238: try {
239: PermissionServiceUtil.unsetRolePermission(roleId, groupId,
240: name, scope, primKey, actionId);
241: } catch (Exception e) {
242: _log.error(e, e);
243:
244: throw new RemoteException(e.getMessage());
245: }
246: }
247:
248: public static void unsetRolePermissions(long roleId, long groupId,
249: java.lang.String name, int scope, java.lang.String actionId)
250: throws RemoteException {
251: try {
252: PermissionServiceUtil.unsetRolePermissions(roleId, groupId,
253: name, scope, actionId);
254: } catch (Exception e) {
255: _log.error(e, e);
256:
257: throw new RemoteException(e.getMessage());
258: }
259: }
260:
261: public static void unsetUserPermissions(long userId, long groupId,
262: java.lang.String[] actionIds, long resourceId)
263: throws RemoteException {
264: try {
265: PermissionServiceUtil.unsetUserPermissions(userId, groupId,
266: actionIds, resourceId);
267: } catch (Exception e) {
268: _log.error(e, e);
269:
270: throw new RemoteException(e.getMessage());
271: }
272: }
273:
274: private static Log _log = LogFactoryUtil
275: .getLog(PermissionServiceSoap.class);
276: }
|