001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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.OrganizationServiceUtil;
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.OrganizationServiceUtil} 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.OrganizationSoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portal.model.Organization}, that is translated to a
038     * {@link com.liferay.portal.model.OrganizationSoap}. 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       OrganizationServiceHttp
062     * @see       com.liferay.portal.model.OrganizationSoap
063     * @see       com.liferay.portal.service.OrganizationServiceUtil
064     * @generated
065     */
066    public class OrganizationServiceSoap {
067            public static void addGroupOrganizations(long groupId,
068                    long[] organizationIds) throws RemoteException {
069                    try {
070                            OrganizationServiceUtil.addGroupOrganizations(groupId,
071                                    organizationIds);
072                    }
073                    catch (Exception e) {
074                            _log.error(e, e);
075    
076                            throw new RemoteException(e.getMessage());
077                    }
078            }
079    
080            public static void addPasswordPolicyOrganizations(long passwordPolicyId,
081                    long[] organizationIds) throws RemoteException {
082                    try {
083                            OrganizationServiceUtil.addPasswordPolicyOrganizations(passwordPolicyId,
084                                    organizationIds);
085                    }
086                    catch (Exception e) {
087                            _log.error(e, e);
088    
089                            throw new RemoteException(e.getMessage());
090                    }
091            }
092    
093            public static com.liferay.portal.model.OrganizationSoap addOrganization(
094                    long parentOrganizationId, java.lang.String name,
095                    java.lang.String type, boolean recursable, long regionId,
096                    long countryId, int statusId, java.lang.String comments,
097                    com.liferay.portal.service.ServiceContext serviceContext)
098                    throws RemoteException {
099                    try {
100                            com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.addOrganization(parentOrganizationId,
101                                            name, type, recursable, regionId, countryId, statusId,
102                                            comments, serviceContext);
103    
104                            return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
105                    }
106                    catch (Exception e) {
107                            _log.error(e, e);
108    
109                            throw new RemoteException(e.getMessage());
110                    }
111            }
112    
113            public static com.liferay.portal.model.OrganizationSoap addOrganization(
114                    long parentOrganizationId, java.lang.String name,
115                    java.lang.String type, boolean recursable, long regionId,
116                    long countryId, int statusId, java.lang.String comments,
117                    com.liferay.portal.model.AddressSoap[] addresses,
118                    com.liferay.portal.model.EmailAddressSoap[] emailAddresses,
119                    com.liferay.portal.model.OrgLaborSoap[] orgLabors,
120                    com.liferay.portal.model.PhoneSoap[] phones,
121                    com.liferay.portal.model.WebsiteSoap[] websites,
122                    com.liferay.portal.service.ServiceContext serviceContext)
123                    throws RemoteException {
124                    try {
125                            com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.addOrganization(parentOrganizationId,
126                                            name, type, recursable, regionId, countryId, statusId,
127                                            comments,
128                                            com.liferay.portal.model.impl.AddressModelImpl.toModels(
129                                                    addresses),
130                                            com.liferay.portal.model.impl.EmailAddressModelImpl.toModels(
131                                                    emailAddresses),
132                                            com.liferay.portal.model.impl.OrgLaborModelImpl.toModels(
133                                                    orgLabors),
134                                            com.liferay.portal.model.impl.PhoneModelImpl.toModels(
135                                                    phones),
136                                            com.liferay.portal.model.impl.WebsiteModelImpl.toModels(
137                                                    websites), serviceContext);
138    
139                            return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
140                    }
141                    catch (Exception e) {
142                            _log.error(e, e);
143    
144                            throw new RemoteException(e.getMessage());
145                    }
146            }
147    
148            public static void deleteLogo(long organizationId)
149                    throws RemoteException {
150                    try {
151                            OrganizationServiceUtil.deleteLogo(organizationId);
152                    }
153                    catch (Exception e) {
154                            _log.error(e, e);
155    
156                            throw new RemoteException(e.getMessage());
157                    }
158            }
159    
160            public static void deleteOrganization(long organizationId)
161                    throws RemoteException {
162                    try {
163                            OrganizationServiceUtil.deleteOrganization(organizationId);
164                    }
165                    catch (Exception e) {
166                            _log.error(e, e);
167    
168                            throw new RemoteException(e.getMessage());
169                    }
170            }
171    
172            public static com.liferay.portal.model.OrganizationSoap[] getManageableOrganizations(
173                    java.lang.String actionId, int max) throws RemoteException {
174                    try {
175                            java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getManageableOrganizations(actionId,
176                                            max);
177    
178                            return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
179                    }
180                    catch (Exception e) {
181                            _log.error(e, e);
182    
183                            throw new RemoteException(e.getMessage());
184                    }
185            }
186    
187            public static com.liferay.portal.model.OrganizationSoap getOrganization(
188                    long organizationId) throws RemoteException {
189                    try {
190                            com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.getOrganization(organizationId);
191    
192                            return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
193                    }
194                    catch (Exception e) {
195                            _log.error(e, e);
196    
197                            throw new RemoteException(e.getMessage());
198                    }
199            }
200    
201            public static long getOrganizationId(long companyId, java.lang.String name)
202                    throws RemoteException {
203                    try {
204                            long returnValue = OrganizationServiceUtil.getOrganizationId(companyId,
205                                            name);
206    
207                            return returnValue;
208                    }
209                    catch (Exception e) {
210                            _log.error(e, e);
211    
212                            throw new RemoteException(e.getMessage());
213                    }
214            }
215    
216            public static com.liferay.portal.model.OrganizationSoap[] getUserOrganizations(
217                    long userId) throws RemoteException {
218                    try {
219                            java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getUserOrganizations(userId);
220    
221                            return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
222                    }
223                    catch (Exception e) {
224                            _log.error(e, e);
225    
226                            throw new RemoteException(e.getMessage());
227                    }
228            }
229    
230            public static com.liferay.portal.model.OrganizationSoap[] getUserOrganizations(
231                    long userId, boolean inheritUserGroups) throws RemoteException {
232                    try {
233                            java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getUserOrganizations(userId,
234                                            inheritUserGroups);
235    
236                            return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
237                    }
238                    catch (Exception e) {
239                            _log.error(e, e);
240    
241                            throw new RemoteException(e.getMessage());
242                    }
243            }
244    
245            public static void setGroupOrganizations(long groupId,
246                    long[] organizationIds) throws RemoteException {
247                    try {
248                            OrganizationServiceUtil.setGroupOrganizations(groupId,
249                                    organizationIds);
250                    }
251                    catch (Exception e) {
252                            _log.error(e, e);
253    
254                            throw new RemoteException(e.getMessage());
255                    }
256            }
257    
258            public static void unsetGroupOrganizations(long groupId,
259                    long[] organizationIds) throws RemoteException {
260                    try {
261                            OrganizationServiceUtil.unsetGroupOrganizations(groupId,
262                                    organizationIds);
263                    }
264                    catch (Exception e) {
265                            _log.error(e, e);
266    
267                            throw new RemoteException(e.getMessage());
268                    }
269            }
270    
271            public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
272                    long[] organizationIds) throws RemoteException {
273                    try {
274                            OrganizationServiceUtil.unsetPasswordPolicyOrganizations(passwordPolicyId,
275                                    organizationIds);
276                    }
277                    catch (Exception e) {
278                            _log.error(e, e);
279    
280                            throw new RemoteException(e.getMessage());
281                    }
282            }
283    
284            public static com.liferay.portal.model.OrganizationSoap updateOrganization(
285                    long organizationId, long parentOrganizationId, java.lang.String name,
286                    java.lang.String type, boolean recursable, long regionId,
287                    long countryId, int statusId, java.lang.String comments,
288                    com.liferay.portal.service.ServiceContext serviceContext)
289                    throws RemoteException {
290                    try {
291                            com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId,
292                                            parentOrganizationId, name, type, recursable, regionId,
293                                            countryId, statusId, comments, serviceContext);
294    
295                            return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
296                    }
297                    catch (Exception e) {
298                            _log.error(e, e);
299    
300                            throw new RemoteException(e.getMessage());
301                    }
302            }
303    
304            public static com.liferay.portal.model.OrganizationSoap updateOrganization(
305                    long organizationId, long parentOrganizationId, java.lang.String name,
306                    java.lang.String type, boolean recursable, long regionId,
307                    long countryId, int statusId, java.lang.String comments,
308                    com.liferay.portal.model.AddressSoap[] addresses,
309                    com.liferay.portal.model.EmailAddressSoap[] emailAddresses,
310                    com.liferay.portal.model.OrgLaborSoap[] orgLabors,
311                    com.liferay.portal.model.PhoneSoap[] phones,
312                    com.liferay.portal.model.WebsiteSoap[] websites,
313                    com.liferay.portal.service.ServiceContext serviceContext)
314                    throws RemoteException {
315                    try {
316                            com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId,
317                                            parentOrganizationId, name, type, recursable, regionId,
318                                            countryId, statusId, comments,
319                                            com.liferay.portal.model.impl.AddressModelImpl.toModels(
320                                                    addresses),
321                                            com.liferay.portal.model.impl.EmailAddressModelImpl.toModels(
322                                                    emailAddresses),
323                                            com.liferay.portal.model.impl.OrgLaborModelImpl.toModels(
324                                                    orgLabors),
325                                            com.liferay.portal.model.impl.PhoneModelImpl.toModels(
326                                                    phones),
327                                            com.liferay.portal.model.impl.WebsiteModelImpl.toModels(
328                                                    websites), serviceContext);
329    
330                            return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
331                    }
332                    catch (Exception e) {
333                            _log.error(e, e);
334    
335                            throw new RemoteException(e.getMessage());
336                    }
337            }
338    
339            private static Log _log = LogFactoryUtil.getLog(OrganizationServiceSoap.class);
340    }