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.OrganizationServiceUtil;
026:
027: import java.rmi.RemoteException;
028:
029: /**
030: * <a href="OrganizationServiceSoap.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.OrganizationServiceUtil</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.OrganizationSoap</code>. If the method in the
050: * service utility returns a <code>com.liferay.portal.model.Organization</code>,
051: * that is translated to a <code>com.liferay.portal.model.OrganizationSoap</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.OrganizationServiceUtil
076: * @see com.liferay.portal.service.http.OrganizationServiceHttp
077: * @see com.liferay.portal.service.model.OrganizationSoap
078: *
079: */
080: public class OrganizationServiceSoap {
081: public static void addGroupOrganizations(long groupId,
082: long[] organizationIds) throws RemoteException {
083: try {
084: OrganizationServiceUtil.addGroupOrganizations(groupId,
085: organizationIds);
086: } catch (Exception e) {
087: _log.error(e, e);
088:
089: throw new RemoteException(e.getMessage());
090: }
091: }
092:
093: public static void addPasswordPolicyOrganizations(
094: long passwordPolicyId, long[] organizationIds)
095: throws RemoteException {
096: try {
097: OrganizationServiceUtil.addPasswordPolicyOrganizations(
098: passwordPolicyId, organizationIds);
099: } catch (Exception e) {
100: _log.error(e, e);
101:
102: throw new RemoteException(e.getMessage());
103: }
104: }
105:
106: public static com.liferay.portal.model.OrganizationSoap addOrganization(
107: long parentOrganizationId, java.lang.String name, int type,
108: boolean recursable, long regionId, long countryId,
109: int statusId, java.lang.String comments)
110: throws RemoteException {
111: try {
112: com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil
113: .addOrganization(parentOrganizationId, name, type,
114: recursable, regionId, countryId, statusId,
115: comments);
116:
117: return com.liferay.portal.model.OrganizationSoap
118: .toSoapModel(returnValue);
119: } catch (Exception e) {
120: _log.error(e, e);
121:
122: throw new RemoteException(e.getMessage());
123: }
124: }
125:
126: public static void deleteOrganization(long organizationId)
127: throws RemoteException {
128: try {
129: OrganizationServiceUtil.deleteOrganization(organizationId);
130: } catch (Exception e) {
131: _log.error(e, e);
132:
133: throw new RemoteException(e.getMessage());
134: }
135: }
136:
137: public static com.liferay.portal.model.OrganizationSoap getOrganization(
138: long organizationId) throws RemoteException {
139: try {
140: com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil
141: .getOrganization(organizationId);
142:
143: return com.liferay.portal.model.OrganizationSoap
144: .toSoapModel(returnValue);
145: } catch (Exception e) {
146: _log.error(e, e);
147:
148: throw new RemoteException(e.getMessage());
149: }
150: }
151:
152: public static long getOrganizationId(long companyId,
153: java.lang.String name) throws RemoteException {
154: try {
155: long returnValue = OrganizationServiceUtil
156: .getOrganizationId(companyId, name);
157:
158: return returnValue;
159: } catch (Exception e) {
160: _log.error(e, e);
161:
162: throw new RemoteException(e.getMessage());
163: }
164: }
165:
166: public static com.liferay.portal.model.OrganizationSoap[] getUserOrganizations(
167: long userId) throws RemoteException {
168: try {
169: java.util.List returnValue = OrganizationServiceUtil
170: .getUserOrganizations(userId);
171:
172: return com.liferay.portal.model.OrganizationSoap
173: .toSoapModels(returnValue);
174: } catch (Exception e) {
175: _log.error(e, e);
176:
177: throw new RemoteException(e.getMessage());
178: }
179: }
180:
181: public static void setGroupOrganizations(long groupId,
182: long[] organizationIds) throws RemoteException {
183: try {
184: OrganizationServiceUtil.setGroupOrganizations(groupId,
185: organizationIds);
186: } catch (Exception e) {
187: _log.error(e, e);
188:
189: throw new RemoteException(e.getMessage());
190: }
191: }
192:
193: public static void unsetGroupOrganizations(long groupId,
194: long[] organizationIds) throws RemoteException {
195: try {
196: OrganizationServiceUtil.unsetGroupOrganizations(groupId,
197: organizationIds);
198: } catch (Exception e) {
199: _log.error(e, e);
200:
201: throw new RemoteException(e.getMessage());
202: }
203: }
204:
205: public static void unsetPasswordPolicyOrganizations(
206: long passwordPolicyId, long[] organizationIds)
207: throws RemoteException {
208: try {
209: OrganizationServiceUtil.unsetPasswordPolicyOrganizations(
210: passwordPolicyId, organizationIds);
211: } catch (Exception e) {
212: _log.error(e, e);
213:
214: throw new RemoteException(e.getMessage());
215: }
216: }
217:
218: public static com.liferay.portal.model.OrganizationSoap updateOrganization(
219: long organizationId, long parentOrganizationId,
220: java.lang.String name, int type, boolean recursable,
221: long regionId, long countryId, int statusId,
222: java.lang.String comments) throws RemoteException {
223: try {
224: com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil
225: .updateOrganization(organizationId,
226: parentOrganizationId, name, type,
227: recursable, regionId, countryId, statusId,
228: comments);
229:
230: return com.liferay.portal.model.OrganizationSoap
231: .toSoapModel(returnValue);
232: } catch (Exception e) {
233: _log.error(e, e);
234:
235: throw new RemoteException(e.getMessage());
236: }
237: }
238:
239: private static Log _log = LogFactoryUtil
240: .getLog(OrganizationServiceSoap.class);
241: }
|