1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.service.OrganizationServiceUtil;
20  
21  import java.rmi.RemoteException;
22  
23  /**
24   * <a href="OrganizationServiceSoap.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides a SOAP utility for the
33   * {@link com.liferay.portal.service.OrganizationServiceUtil} service utility. The
34   * static methods of this class calls the same methods of the service utility.
35   * However, the signatures are different because it is difficult for SOAP to
36   * support certain types.
37   * </p>
38   *
39   * <p>
40   * ServiceBuilder follows certain rules in translating the methods. For example,
41   * if the method in the service utility returns a {@link java.util.List}, that
42   * is translated to an array of {@link com.liferay.portal.model.OrganizationSoap}.
43   * If the method in the service utility returns a
44   * {@link com.liferay.portal.model.Organization}, that is translated to a
45   * {@link com.liferay.portal.model.OrganizationSoap}. Methods that SOAP cannot
46   * safely wire are skipped.
47   * </p>
48   *
49   * <p>
50   * The benefits of using the SOAP utility is that it is cross platform
51   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
52   * even Perl, to call the generated services. One drawback of SOAP is that it is
53   * slow because it needs to serialize all calls into a text format (XML).
54   * </p>
55   *
56   * <p>
57   * You can see a list of services at
58   * http://localhost:8080/tunnel-web/secure/axis. Set the property
59   * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
60   * security.
61   * </p>
62   *
63   * <p>
64   * The SOAP utility is only generated for remote services.
65   * </p>
66   *
67   * @author    Brian Wing Shun Chan
68   * @see       OrganizationServiceHttp
69   * @see       com.liferay.portal.model.OrganizationSoap
70   * @see       com.liferay.portal.service.OrganizationServiceUtil
71   * @generated
72   */
73  public class OrganizationServiceSoap {
74      public static void addGroupOrganizations(long groupId,
75          long[] organizationIds) throws RemoteException {
76          try {
77              OrganizationServiceUtil.addGroupOrganizations(groupId,
78                  organizationIds);
79          }
80          catch (Exception e) {
81              _log.error(e, e);
82  
83              throw new RemoteException(e.getMessage());
84          }
85      }
86  
87      public static void addPasswordPolicyOrganizations(long passwordPolicyId,
88          long[] organizationIds) throws RemoteException {
89          try {
90              OrganizationServiceUtil.addPasswordPolicyOrganizations(passwordPolicyId,
91                  organizationIds);
92          }
93          catch (Exception e) {
94              _log.error(e, e);
95  
96              throw new RemoteException(e.getMessage());
97          }
98      }
99  
100     public static com.liferay.portal.model.OrganizationSoap addOrganization(
101         long parentOrganizationId, java.lang.String name,
102         java.lang.String type, boolean recursable, long regionId,
103         long countryId, int statusId, java.lang.String comments,
104         com.liferay.portal.service.ServiceContext serviceContext)
105         throws RemoteException {
106         try {
107             com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.addOrganization(parentOrganizationId,
108                     name, type, recursable, regionId, countryId, statusId,
109                     comments, serviceContext);
110 
111             return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
112         }
113         catch (Exception e) {
114             _log.error(e, e);
115 
116             throw new RemoteException(e.getMessage());
117         }
118     }
119 
120     public static com.liferay.portal.model.OrganizationSoap addOrganization(
121         long parentOrganizationId, java.lang.String name,
122         java.lang.String type, boolean recursable, long regionId,
123         long countryId, int statusId, java.lang.String comments,
124         com.liferay.portal.model.AddressSoap[] addresses,
125         com.liferay.portal.model.EmailAddressSoap[] emailAddresses,
126         com.liferay.portal.model.OrgLaborSoap[] orgLabors,
127         com.liferay.portal.model.PhoneSoap[] phones,
128         com.liferay.portal.model.WebsiteSoap[] websites,
129         com.liferay.portal.service.ServiceContext serviceContext)
130         throws RemoteException {
131         try {
132             com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.addOrganization(parentOrganizationId,
133                     name, type, recursable, regionId, countryId, statusId,
134                     comments,
135                     com.liferay.portal.model.impl.AddressModelImpl.toModels(
136                         addresses),
137                     com.liferay.portal.model.impl.EmailAddressModelImpl.toModels(
138                         emailAddresses),
139                     com.liferay.portal.model.impl.OrgLaborModelImpl.toModels(
140                         orgLabors),
141                     com.liferay.portal.model.impl.PhoneModelImpl.toModels(
142                         phones),
143                     com.liferay.portal.model.impl.WebsiteModelImpl.toModels(
144                         websites), serviceContext);
145 
146             return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
147         }
148         catch (Exception e) {
149             _log.error(e, e);
150 
151             throw new RemoteException(e.getMessage());
152         }
153     }
154 
155     public static void deleteLogo(long organizationId)
156         throws RemoteException {
157         try {
158             OrganizationServiceUtil.deleteLogo(organizationId);
159         }
160         catch (Exception e) {
161             _log.error(e, e);
162 
163             throw new RemoteException(e.getMessage());
164         }
165     }
166 
167     public static void deleteOrganization(long organizationId)
168         throws RemoteException {
169         try {
170             OrganizationServiceUtil.deleteOrganization(organizationId);
171         }
172         catch (Exception e) {
173             _log.error(e, e);
174 
175             throw new RemoteException(e.getMessage());
176         }
177     }
178 
179     public static com.liferay.portal.model.OrganizationSoap[] getManageableOrganizations(
180         java.lang.String actionId, int max) throws RemoteException {
181         try {
182             java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getManageableOrganizations(actionId,
183                     max);
184 
185             return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
186         }
187         catch (Exception e) {
188             _log.error(e, e);
189 
190             throw new RemoteException(e.getMessage());
191         }
192     }
193 
194     public static com.liferay.portal.model.OrganizationSoap getOrganization(
195         long organizationId) throws RemoteException {
196         try {
197             com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.getOrganization(organizationId);
198 
199             return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
200         }
201         catch (Exception e) {
202             _log.error(e, e);
203 
204             throw new RemoteException(e.getMessage());
205         }
206     }
207 
208     public static long getOrganizationId(long companyId, java.lang.String name)
209         throws RemoteException {
210         try {
211             long returnValue = OrganizationServiceUtil.getOrganizationId(companyId,
212                     name);
213 
214             return returnValue;
215         }
216         catch (Exception e) {
217             _log.error(e, e);
218 
219             throw new RemoteException(e.getMessage());
220         }
221     }
222 
223     public static com.liferay.portal.model.OrganizationSoap[] getUserOrganizations(
224         long userId) throws RemoteException {
225         try {
226             java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getUserOrganizations(userId);
227 
228             return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
229         }
230         catch (Exception e) {
231             _log.error(e, e);
232 
233             throw new RemoteException(e.getMessage());
234         }
235     }
236 
237     public static com.liferay.portal.model.OrganizationSoap[] getUserOrganizations(
238         long userId, boolean inheritUserGroups) throws RemoteException {
239         try {
240             java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getUserOrganizations(userId,
241                     inheritUserGroups);
242 
243             return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
244         }
245         catch (Exception e) {
246             _log.error(e, e);
247 
248             throw new RemoteException(e.getMessage());
249         }
250     }
251 
252     public static void setGroupOrganizations(long groupId,
253         long[] organizationIds) throws RemoteException {
254         try {
255             OrganizationServiceUtil.setGroupOrganizations(groupId,
256                 organizationIds);
257         }
258         catch (Exception e) {
259             _log.error(e, e);
260 
261             throw new RemoteException(e.getMessage());
262         }
263     }
264 
265     public static void unsetGroupOrganizations(long groupId,
266         long[] organizationIds) throws RemoteException {
267         try {
268             OrganizationServiceUtil.unsetGroupOrganizations(groupId,
269                 organizationIds);
270         }
271         catch (Exception e) {
272             _log.error(e, e);
273 
274             throw new RemoteException(e.getMessage());
275         }
276     }
277 
278     public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
279         long[] organizationIds) throws RemoteException {
280         try {
281             OrganizationServiceUtil.unsetPasswordPolicyOrganizations(passwordPolicyId,
282                 organizationIds);
283         }
284         catch (Exception e) {
285             _log.error(e, e);
286 
287             throw new RemoteException(e.getMessage());
288         }
289     }
290 
291     public static com.liferay.portal.model.OrganizationSoap updateOrganization(
292         long organizationId, long parentOrganizationId, java.lang.String name,
293         java.lang.String type, boolean recursable, long regionId,
294         long countryId, int statusId, java.lang.String comments,
295         com.liferay.portal.service.ServiceContext serviceContext)
296         throws RemoteException {
297         try {
298             com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId,
299                     parentOrganizationId, name, type, recursable, regionId,
300                     countryId, statusId, comments, serviceContext);
301 
302             return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
303         }
304         catch (Exception e) {
305             _log.error(e, e);
306 
307             throw new RemoteException(e.getMessage());
308         }
309     }
310 
311     public static com.liferay.portal.model.OrganizationSoap updateOrganization(
312         long organizationId, long parentOrganizationId, java.lang.String name,
313         java.lang.String type, boolean recursable, long regionId,
314         long countryId, int statusId, java.lang.String comments,
315         com.liferay.portal.model.AddressSoap[] addresses,
316         com.liferay.portal.model.EmailAddressSoap[] emailAddresses,
317         com.liferay.portal.model.OrgLaborSoap[] orgLabors,
318         com.liferay.portal.model.PhoneSoap[] phones,
319         com.liferay.portal.model.WebsiteSoap[] websites,
320         com.liferay.portal.service.ServiceContext serviceContext)
321         throws RemoteException {
322         try {
323             com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId,
324                     parentOrganizationId, name, type, recursable, regionId,
325                     countryId, statusId, comments,
326                     com.liferay.portal.model.impl.AddressModelImpl.toModels(
327                         addresses),
328                     com.liferay.portal.model.impl.EmailAddressModelImpl.toModels(
329                         emailAddresses),
330                     com.liferay.portal.model.impl.OrgLaborModelImpl.toModels(
331                         orgLabors),
332                     com.liferay.portal.model.impl.PhoneModelImpl.toModels(
333                         phones),
334                     com.liferay.portal.model.impl.WebsiteModelImpl.toModels(
335                         websites), serviceContext);
336 
337             return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
338         }
339         catch (Exception e) {
340             _log.error(e, e);
341 
342             throw new RemoteException(e.getMessage());
343         }
344     }
345 
346     private static Log _log = LogFactoryUtil.getLog(OrganizationServiceSoap.class);
347 }