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