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.GroupServiceUtil;
026:
027: import java.rmi.RemoteException;
028:
029: /**
030: * <a href="GroupServiceSoap.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.GroupServiceUtil</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.GroupSoap</code>. If the method in the
050: * service utility returns a <code>com.liferay.portal.model.Group</code>,
051: * that is translated to a <code>com.liferay.portal.model.GroupSoap</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.GroupServiceUtil
076: * @see com.liferay.portal.service.http.GroupServiceHttp
077: * @see com.liferay.portal.service.model.GroupSoap
078: *
079: */
080: public class GroupServiceSoap {
081: public static com.liferay.portal.model.GroupSoap addGroup(
082: java.lang.String name, java.lang.String description,
083: int type, java.lang.String friendlyURL, boolean active)
084: throws RemoteException {
085: try {
086: com.liferay.portal.model.Group returnValue = GroupServiceUtil
087: .addGroup(name, description, type, friendlyURL,
088: active);
089:
090: return com.liferay.portal.model.GroupSoap
091: .toSoapModel(returnValue);
092: } catch (Exception e) {
093: _log.error(e, e);
094:
095: throw new RemoteException(e.getMessage());
096: }
097: }
098:
099: public static com.liferay.portal.model.GroupSoap addGroup(
100: long liveGroupId, java.lang.String name,
101: java.lang.String description, int type,
102: java.lang.String friendlyURL, boolean active)
103: throws RemoteException {
104: try {
105: com.liferay.portal.model.Group returnValue = GroupServiceUtil
106: .addGroup(liveGroupId, name, description, type,
107: friendlyURL, active);
108:
109: return com.liferay.portal.model.GroupSoap
110: .toSoapModel(returnValue);
111: } catch (Exception e) {
112: _log.error(e, e);
113:
114: throw new RemoteException(e.getMessage());
115: }
116: }
117:
118: public static void addRoleGroups(long roleId, long[] groupIds)
119: throws RemoteException {
120: try {
121: GroupServiceUtil.addRoleGroups(roleId, groupIds);
122: } catch (Exception e) {
123: _log.error(e, e);
124:
125: throw new RemoteException(e.getMessage());
126: }
127: }
128:
129: public static void deleteGroup(long groupId) throws RemoteException {
130: try {
131: GroupServiceUtil.deleteGroup(groupId);
132: } catch (Exception e) {
133: _log.error(e, e);
134:
135: throw new RemoteException(e.getMessage());
136: }
137: }
138:
139: public static com.liferay.portal.model.GroupSoap getGroup(
140: long groupId) throws RemoteException {
141: try {
142: com.liferay.portal.model.Group returnValue = GroupServiceUtil
143: .getGroup(groupId);
144:
145: return com.liferay.portal.model.GroupSoap
146: .toSoapModel(returnValue);
147: } catch (Exception e) {
148: _log.error(e, e);
149:
150: throw new RemoteException(e.getMessage());
151: }
152: }
153:
154: public static com.liferay.portal.model.GroupSoap getGroup(
155: long companyId, java.lang.String name)
156: throws RemoteException {
157: try {
158: com.liferay.portal.model.Group returnValue = GroupServiceUtil
159: .getGroup(companyId, name);
160:
161: return com.liferay.portal.model.GroupSoap
162: .toSoapModel(returnValue);
163: } catch (Exception e) {
164: _log.error(e, e);
165:
166: throw new RemoteException(e.getMessage());
167: }
168: }
169:
170: public static com.liferay.portal.model.GroupSoap[] getOrganizationsGroups(
171: java.util.List organizations) throws RemoteException {
172: try {
173: java.util.List returnValue = GroupServiceUtil
174: .getOrganizationsGroups(organizations);
175:
176: return com.liferay.portal.model.GroupSoap
177: .toSoapModels(returnValue);
178: } catch (Exception e) {
179: _log.error(e, e);
180:
181: throw new RemoteException(e.getMessage());
182: }
183: }
184:
185: public static com.liferay.portal.model.GroupSoap[] getUserGroupsGroups(
186: java.util.List userGroups) throws RemoteException {
187: try {
188: java.util.List returnValue = GroupServiceUtil
189: .getUserGroupsGroups(userGroups);
190:
191: return com.liferay.portal.model.GroupSoap
192: .toSoapModels(returnValue);
193: } catch (Exception e) {
194: _log.error(e, e);
195:
196: throw new RemoteException(e.getMessage());
197: }
198: }
199:
200: public static boolean hasUserGroup(long userId, long groupId)
201: throws RemoteException {
202: try {
203: boolean returnValue = GroupServiceUtil.hasUserGroup(userId,
204: groupId);
205:
206: return returnValue;
207: } catch (Exception e) {
208: _log.error(e, e);
209:
210: throw new RemoteException(e.getMessage());
211: }
212: }
213:
214: public static com.liferay.portal.model.GroupSoap[] search(
215: long companyId, java.lang.String name,
216: java.lang.String description, java.lang.String[] params,
217: int begin, int end) throws RemoteException {
218: try {
219: java.util.List returnValue = GroupServiceUtil.search(
220: companyId, name, description, params, begin, end);
221:
222: return com.liferay.portal.model.GroupSoap
223: .toSoapModels(returnValue);
224: } catch (Exception e) {
225: _log.error(e, e);
226:
227: throw new RemoteException(e.getMessage());
228: }
229: }
230:
231: public static int searchCount(long companyId,
232: java.lang.String name, java.lang.String description,
233: java.lang.String[] params) throws RemoteException {
234: try {
235: int returnValue = GroupServiceUtil.searchCount(companyId,
236: name, description, params);
237:
238: return returnValue;
239: } catch (Exception e) {
240: _log.error(e, e);
241:
242: throw new RemoteException(e.getMessage());
243: }
244: }
245:
246: public static void setRoleGroups(long roleId, long[] groupIds)
247: throws RemoteException {
248: try {
249: GroupServiceUtil.setRoleGroups(roleId, groupIds);
250: } catch (Exception e) {
251: _log.error(e, e);
252:
253: throw new RemoteException(e.getMessage());
254: }
255: }
256:
257: public static void unsetRoleGroups(long roleId, long[] groupIds)
258: throws RemoteException {
259: try {
260: GroupServiceUtil.unsetRoleGroups(roleId, groupIds);
261: } catch (Exception e) {
262: _log.error(e, e);
263:
264: throw new RemoteException(e.getMessage());
265: }
266: }
267:
268: public static com.liferay.portal.model.GroupSoap updateGroup(
269: long groupId, java.lang.String name,
270: java.lang.String description, int type,
271: java.lang.String friendlyURL, boolean active)
272: throws RemoteException {
273: try {
274: com.liferay.portal.model.Group returnValue = GroupServiceUtil
275: .updateGroup(groupId, name, description, type,
276: friendlyURL, active);
277:
278: return com.liferay.portal.model.GroupSoap
279: .toSoapModel(returnValue);
280: } catch (Exception e) {
281: _log.error(e, e);
282:
283: throw new RemoteException(e.getMessage());
284: }
285: }
286:
287: public static com.liferay.portal.model.GroupSoap updateGroup(
288: long groupId, java.lang.String typeSettings)
289: throws RemoteException {
290: try {
291: com.liferay.portal.model.Group returnValue = GroupServiceUtil
292: .updateGroup(groupId, typeSettings);
293:
294: return com.liferay.portal.model.GroupSoap
295: .toSoapModel(returnValue);
296: } catch (Exception e) {
297: _log.error(e, e);
298:
299: throw new RemoteException(e.getMessage());
300: }
301: }
302:
303: private static Log _log = LogFactoryUtil
304: .getLog(GroupServiceSoap.class);
305: }
|