001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
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.service.PermissionServiceUtil;
020    
021    import java.rmi.RemoteException;
022    
023    /**
024     * <p>
025     * This class provides a SOAP utility for the
026     * {@link com.liferay.portal.service.PermissionServiceUtil} service utility. The
027     * static methods of this class calls the same methods of the service utility.
028     * However, the signatures are different because it is difficult for SOAP to
029     * support certain types.
030     * </p>
031     *
032     * <p>
033     * ServiceBuilder follows certain rules in translating the methods. For example,
034     * if the method in the service utility returns a {@link java.util.List}, that
035     * is translated to an array of {@link com.liferay.portal.model.PermissionSoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portal.model.Permission}, that is translated to a
038     * {@link com.liferay.portal.model.PermissionSoap}. Methods that SOAP cannot
039     * safely wire are skipped.
040     * </p>
041     *
042     * <p>
043     * The benefits of using the SOAP utility is that it is cross platform
044     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
045     * even Perl, to call the generated services. One drawback of SOAP is that it is
046     * slow because it needs to serialize all calls into a text format (XML).
047     * </p>
048     *
049     * <p>
050     * You can see a list of services at
051     * http://localhost:8080/tunnel-web/secure/axis. Set the property
052     * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
053     * security.
054     * </p>
055     *
056     * <p>
057     * The SOAP utility is only generated for remote services.
058     * </p>
059     *
060     * @author    Brian Wing Shun Chan
061     * @see       PermissionServiceHttp
062     * @see       com.liferay.portal.model.PermissionSoap
063     * @see       com.liferay.portal.service.PermissionServiceUtil
064     * @generated
065     */
066    public class PermissionServiceSoap {
067            public static void checkPermission(long groupId, long resourceId)
068                    throws RemoteException {
069                    try {
070                            PermissionServiceUtil.checkPermission(groupId, resourceId);
071                    }
072                    catch (Exception e) {
073                            _log.error(e, e);
074    
075                            throw new RemoteException(e.getMessage());
076                    }
077            }
078    
079            public static void checkPermission(long groupId, java.lang.String name,
080                    long primKey) throws RemoteException {
081                    try {
082                            PermissionServiceUtil.checkPermission(groupId, name, primKey);
083                    }
084                    catch (Exception e) {
085                            _log.error(e, e);
086    
087                            throw new RemoteException(e.getMessage());
088                    }
089            }
090    
091            public static void checkPermission(long groupId, java.lang.String name,
092                    java.lang.String primKey) throws RemoteException {
093                    try {
094                            PermissionServiceUtil.checkPermission(groupId, name, primKey);
095                    }
096                    catch (Exception e) {
097                            _log.error(e, e);
098    
099                            throw new RemoteException(e.getMessage());
100                    }
101            }
102    
103            public static boolean hasGroupPermission(long groupId,
104                    java.lang.String actionId, long resourceId) throws RemoteException {
105                    try {
106                            boolean returnValue = PermissionServiceUtil.hasGroupPermission(groupId,
107                                            actionId, resourceId);
108    
109                            return returnValue;
110                    }
111                    catch (Exception e) {
112                            _log.error(e, e);
113    
114                            throw new RemoteException(e.getMessage());
115                    }
116            }
117    
118            public static boolean hasUserPermission(long userId,
119                    java.lang.String actionId, long resourceId) throws RemoteException {
120                    try {
121                            boolean returnValue = PermissionServiceUtil.hasUserPermission(userId,
122                                            actionId, resourceId);
123    
124                            return returnValue;
125                    }
126                    catch (Exception e) {
127                            _log.error(e, e);
128    
129                            throw new RemoteException(e.getMessage());
130                    }
131            }
132    
133            public static boolean hasUserPermissions(long userId, long groupId,
134                    com.liferay.portal.model.ResourceSoap[] resources,
135                    java.lang.String actionId,
136                    com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
137                    throws RemoteException {
138                    try {
139                            boolean returnValue = PermissionServiceUtil.hasUserPermissions(userId,
140                                            groupId,
141                                            com.liferay.portal.model.impl.ResourceModelImpl.toModels(
142                                                    resources), actionId, permissionCheckerBag);
143    
144                            return returnValue;
145                    }
146                    catch (Exception e) {
147                            _log.error(e, e);
148    
149                            throw new RemoteException(e.getMessage());
150                    }
151            }
152    
153            public static void setGroupPermissions(long groupId,
154                    java.lang.String[] actionIds, long resourceId)
155                    throws RemoteException {
156                    try {
157                            PermissionServiceUtil.setGroupPermissions(groupId, actionIds,
158                                    resourceId);
159                    }
160                    catch (Exception e) {
161                            _log.error(e, e);
162    
163                            throw new RemoteException(e.getMessage());
164                    }
165            }
166    
167            public static void setGroupPermissions(java.lang.String className,
168                    java.lang.String classPK, long groupId, java.lang.String[] actionIds,
169                    long resourceId) throws RemoteException {
170                    try {
171                            PermissionServiceUtil.setGroupPermissions(className, classPK,
172                                    groupId, actionIds, resourceId);
173                    }
174                    catch (Exception e) {
175                            _log.error(e, e);
176    
177                            throw new RemoteException(e.getMessage());
178                    }
179            }
180    
181            public static void setOrgGroupPermissions(long organizationId,
182                    long groupId, java.lang.String[] actionIds, long resourceId)
183                    throws RemoteException {
184                    try {
185                            PermissionServiceUtil.setOrgGroupPermissions(organizationId,
186                                    groupId, actionIds, resourceId);
187                    }
188                    catch (Exception e) {
189                            _log.error(e, e);
190    
191                            throw new RemoteException(e.getMessage());
192                    }
193            }
194    
195            public static void setRolePermission(long roleId, long groupId,
196                    java.lang.String name, int scope, java.lang.String primKey,
197                    java.lang.String actionId) throws RemoteException {
198                    try {
199                            PermissionServiceUtil.setRolePermission(roleId, groupId, name,
200                                    scope, primKey, actionId);
201                    }
202                    catch (Exception e) {
203                            _log.error(e, e);
204    
205                            throw new RemoteException(e.getMessage());
206                    }
207            }
208    
209            public static void setRolePermissions(long roleId, long groupId,
210                    java.lang.String[] actionIds, long resourceId)
211                    throws RemoteException {
212                    try {
213                            PermissionServiceUtil.setRolePermissions(roleId, groupId,
214                                    actionIds, resourceId);
215                    }
216                    catch (Exception e) {
217                            _log.error(e, e);
218    
219                            throw new RemoteException(e.getMessage());
220                    }
221            }
222    
223            public static void setUserPermissions(long userId, long groupId,
224                    java.lang.String[] actionIds, long resourceId)
225                    throws RemoteException {
226                    try {
227                            PermissionServiceUtil.setUserPermissions(userId, groupId,
228                                    actionIds, resourceId);
229                    }
230                    catch (Exception e) {
231                            _log.error(e, e);
232    
233                            throw new RemoteException(e.getMessage());
234                    }
235            }
236    
237            public static void unsetRolePermission(long roleId, long groupId,
238                    long permissionId) throws RemoteException {
239                    try {
240                            PermissionServiceUtil.unsetRolePermission(roleId, groupId,
241                                    permissionId);
242                    }
243                    catch (Exception e) {
244                            _log.error(e, e);
245    
246                            throw new RemoteException(e.getMessage());
247                    }
248            }
249    
250            public static void unsetRolePermission(long roleId, long groupId,
251                    java.lang.String name, int scope, java.lang.String primKey,
252                    java.lang.String actionId) throws RemoteException {
253                    try {
254                            PermissionServiceUtil.unsetRolePermission(roleId, groupId, name,
255                                    scope, primKey, actionId);
256                    }
257                    catch (Exception e) {
258                            _log.error(e, e);
259    
260                            throw new RemoteException(e.getMessage());
261                    }
262            }
263    
264            public static void unsetRolePermissions(long roleId, long groupId,
265                    java.lang.String name, int scope, java.lang.String actionId)
266                    throws RemoteException {
267                    try {
268                            PermissionServiceUtil.unsetRolePermissions(roleId, groupId, name,
269                                    scope, actionId);
270                    }
271                    catch (Exception e) {
272                            _log.error(e, e);
273    
274                            throw new RemoteException(e.getMessage());
275                    }
276            }
277    
278            public static void unsetUserPermissions(long userId, long groupId,
279                    java.lang.String[] actionIds, long resourceId)
280                    throws RemoteException {
281                    try {
282                            PermissionServiceUtil.unsetUserPermissions(userId, groupId,
283                                    actionIds, resourceId);
284                    }
285                    catch (Exception e) {
286                            _log.error(e, e);
287    
288                            throw new RemoteException(e.getMessage());
289                    }
290            }
291    
292            private static Log _log = LogFactoryUtil.getLog(PermissionServiceSoap.class);
293    }