001    /**
002     * Copyright (c) 2000-2012 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 http://localhost:8080/api/axis. Set the
051     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
052     * security.
053     * </p>
054     *
055     * <p>
056     * The SOAP utility is only generated for remote services.
057     * </p>
058     *
059     * @author    Brian Wing Shun Chan
060     * @see       OrganizationServiceHttp
061     * @see       com.liferay.portal.model.OrganizationSoap
062     * @see       com.liferay.portal.service.OrganizationServiceUtil
063     * @generated
064     */
065    public class OrganizationServiceSoap {
066            /**
067            * Adds the organizations to the group.
068            *
069            * @param groupId the primary key of the group
070            * @param organizationIds the primary keys of the organizations
071            * @throws PortalException if a group or organization with the primary key
072            could not be found or if the user did not have permission to
073            assign group members
074            * @throws SystemException if a system exception occurred
075            */
076            public static void addGroupOrganizations(long groupId,
077                    long[] organizationIds) throws RemoteException {
078                    try {
079                            OrganizationServiceUtil.addGroupOrganizations(groupId,
080                                    organizationIds);
081                    }
082                    catch (Exception e) {
083                            _log.error(e, e);
084    
085                            throw new RemoteException(e.getMessage());
086                    }
087            }
088    
089            /**
090            * Adds an organization with additional parameters.
091            *
092            * <p>
093            * This method handles the creation and bookkeeping of the organization
094            * including its resources, metadata, and internal data structures.
095            * </p>
096            *
097            * @param parentOrganizationId the primary key of the organization's parent
098            organization
099            * @param name the organization's name
100            * @param type the organization's type
101            * @param recursable whether the permissions of the organization are to be
102            inherited by its suborganizations
103            * @param regionId the primary key of the organization's region
104            * @param countryId the primary key of the organization's country
105            * @param statusId the organization's workflow status
106            * @param comments the comments about the organization
107            * @param site whether the organization is to be associated with a main
108            site
109            * @param addresses the organization's addresses
110            * @param emailAddresses the organization's email addresses
111            * @param orgLabors the organization's hours of operation
112            * @param phones the organization's phone numbers
113            * @param websites the organization's websites
114            * @param serviceContext the organization's service context (optionally
115            <code>null</code>). Can set asset category IDs, asset tag names,
116            and expando bridge attributes for the organization.
117            * @return the organization
118            * @throws PortalException if a parent organization with the primary key
119            could not be found, if the organization's information was
120            invalid, or if the user did not have permission to add the
121            organization
122            * @throws SystemException if a system exception occurred
123            */
124            public static com.liferay.portal.model.OrganizationSoap addOrganization(
125                    long parentOrganizationId, java.lang.String name,
126                    java.lang.String type, boolean recursable, long regionId,
127                    long countryId, int statusId, java.lang.String comments, boolean site,
128                    com.liferay.portal.model.AddressSoap[] addresses,
129                    com.liferay.portal.model.EmailAddressSoap[] emailAddresses,
130                    com.liferay.portal.model.OrgLaborSoap[] orgLabors,
131                    com.liferay.portal.model.PhoneSoap[] phones,
132                    com.liferay.portal.model.WebsiteSoap[] websites,
133                    com.liferay.portal.service.ServiceContext serviceContext)
134                    throws RemoteException {
135                    try {
136                            com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.addOrganization(parentOrganizationId,
137                                            name, type, recursable, regionId, countryId, statusId,
138                                            comments, site,
139                                            com.liferay.portal.model.impl.AddressModelImpl.toModels(
140                                                    addresses),
141                                            com.liferay.portal.model.impl.EmailAddressModelImpl.toModels(
142                                                    emailAddresses),
143                                            com.liferay.portal.model.impl.OrgLaborModelImpl.toModels(
144                                                    orgLabors),
145                                            com.liferay.portal.model.impl.PhoneModelImpl.toModels(
146                                                    phones),
147                                            com.liferay.portal.model.impl.WebsiteModelImpl.toModels(
148                                                    websites), serviceContext);
149    
150                            return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            /**
160            * Adds an organization.
161            *
162            * <p>
163            * This method handles the creation and bookkeeping of the organization
164            * including its resources, metadata, and internal data structures.
165            * </p>
166            *
167            * @param parentOrganizationId the primary key of the organization's parent
168            organization
169            * @param name the organization's name
170            * @param type the organization's type
171            * @param recursable whether the permissions of the organization are to be
172            inherited by its suborganizations
173            * @param regionId the primary key of the organization's region
174            * @param countryId the primary key of the organization's country
175            * @param statusId the organization's workflow status
176            * @param comments the comments about the organization
177            * @param site whether the organization is to be associated with a main
178            site
179            * @param serviceContext the organization's service context (optionally
180            <code>null</code>). Can set asset category IDs, asset tag names,
181            and expando bridge attributes for the organization.
182            * @return the organization
183            * @throws PortalException if the parent organization with the primary key
184            could not be found, if the organization information was invalid,
185            or if the user did not have permission to add the organization
186            * @throws SystemException if a system exception occurred
187            */
188            public static com.liferay.portal.model.OrganizationSoap addOrganization(
189                    long parentOrganizationId, java.lang.String name,
190                    java.lang.String type, boolean recursable, long regionId,
191                    long countryId, int statusId, java.lang.String comments, boolean site,
192                    com.liferay.portal.service.ServiceContext serviceContext)
193                    throws RemoteException {
194                    try {
195                            com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.addOrganization(parentOrganizationId,
196                                            name, type, recursable, regionId, countryId, statusId,
197                                            comments, site, serviceContext);
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            /**
209            * Assigns the password policy to the organizations, removing any other
210            * currently assigned password policies.
211            *
212            * @param passwordPolicyId the primary key of the password policy
213            * @param organizationIds the primary keys of the organizations
214            * @throws PortalException if the user did not have permission to update the
215            password policy
216            * @throws SystemException if a system exception occurred
217            */
218            public static void addPasswordPolicyOrganizations(long passwordPolicyId,
219                    long[] organizationIds) throws RemoteException {
220                    try {
221                            OrganizationServiceUtil.addPasswordPolicyOrganizations(passwordPolicyId,
222                                    organizationIds);
223                    }
224                    catch (Exception e) {
225                            _log.error(e, e);
226    
227                            throw new RemoteException(e.getMessage());
228                    }
229            }
230    
231            /**
232            * Deletes the logo of the organization.
233            *
234            * @param organizationId the primary key of the organization
235            * @throws PortalException if an organization with the primary key could not
236            be found, if the organization's logo could not be found, or if
237            the user did not have permission to update the organization
238            * @throws SystemException if a system exception occurred
239            */
240            public static void deleteLogo(long organizationId)
241                    throws RemoteException {
242                    try {
243                            OrganizationServiceUtil.deleteLogo(organizationId);
244                    }
245                    catch (Exception e) {
246                            _log.error(e, e);
247    
248                            throw new RemoteException(e.getMessage());
249                    }
250            }
251    
252            /**
253            * Deletes the organization. The organization's associated resources and
254            * assets are also deleted.
255            *
256            * @param organizationId the primary key of the organization
257            * @throws PortalException if an organization with the primary key could not
258            be found, if the user did not have permission to delete the
259            organization, if the organization had a workflow in approved
260            status, or if the organization was a parent organization
261            * @throws SystemException if a system exception occurred
262            */
263            public static void deleteOrganization(long organizationId)
264                    throws RemoteException {
265                    try {
266                            OrganizationServiceUtil.deleteOrganization(organizationId);
267                    }
268                    catch (Exception e) {
269                            _log.error(e, e);
270    
271                            throw new RemoteException(e.getMessage());
272                    }
273            }
274    
275            /**
276            * Returns all the organizations which the user has permission to manage.
277            *
278            * @param actionId the permitted action
279            * @param max the maximum number of the organizations to be considered
280            * @return the organizations which the user has permission to manage
281            * @throws PortalException if a portal exception occurred
282            * @throws SystemException if a system exception occurred
283            * @deprecated Replaced by {@link #getOrganizations(long, long, int, int)}
284            */
285            public static com.liferay.portal.model.OrganizationSoap[] getManageableOrganizations(
286                    java.lang.String actionId, int max) throws RemoteException {
287                    try {
288                            java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getManageableOrganizations(actionId,
289                                            max);
290    
291                            return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
292                    }
293                    catch (Exception e) {
294                            _log.error(e, e);
295    
296                            throw new RemoteException(e.getMessage());
297                    }
298            }
299    
300            /**
301            * Returns the organization with the primary key.
302            *
303            * @param organizationId the primary key of the organization
304            * @return the organization with the primary key
305            * @throws PortalException if an organization with the primary key could not
306            be found or if the user did not have permission to view the
307            organization
308            * @throws SystemException if a system exception occurred
309            */
310            public static com.liferay.portal.model.OrganizationSoap getOrganization(
311                    long organizationId) throws RemoteException {
312                    try {
313                            com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.getOrganization(organizationId);
314    
315                            return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
316                    }
317                    catch (Exception e) {
318                            _log.error(e, e);
319    
320                            throw new RemoteException(e.getMessage());
321                    }
322            }
323    
324            /**
325            * Returns the primary key of the organization with the name.
326            *
327            * @param companyId the primary key of the organization's company
328            * @param name the organization's name
329            * @return the primary key of the organization with the name, or
330            <code>0</code> if the organization could not be found
331            * @throws PortalException if the user did not have permission to view the
332            organization
333            * @throws SystemException if a system exception occurred
334            */
335            public static long getOrganizationId(long companyId, java.lang.String name)
336                    throws RemoteException {
337                    try {
338                            long returnValue = OrganizationServiceUtil.getOrganizationId(companyId,
339                                            name);
340    
341                            return returnValue;
342                    }
343                    catch (Exception e) {
344                            _log.error(e, e);
345    
346                            throw new RemoteException(e.getMessage());
347                    }
348            }
349    
350            /**
351            * Returns all the organizations belonging to the parent organization.
352            *
353            * @param companyId the primary key of the organizations' company
354            * @param parentOrganizationId the primary key of the organizations' parent
355            organization
356            * @return the organizations belonging to the parent organization
357            * @throws SystemException if a system exception occurred
358            */
359            public static com.liferay.portal.model.OrganizationSoap[] getOrganizations(
360                    long companyId, long parentOrganizationId) throws RemoteException {
361                    try {
362                            java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getOrganizations(companyId,
363                                            parentOrganizationId);
364    
365                            return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
366                    }
367                    catch (Exception e) {
368                            _log.error(e, e);
369    
370                            throw new RemoteException(e.getMessage());
371                    }
372            }
373    
374            /**
375            * Returns a range of all the organizations belonging to the parent
376            * organization.
377            *
378            * <p>
379            * Useful when paginating results. Returns a maximum of <code>end -
380            * start</code> instances. <code>start</code> and <code>end</code> are not
381            * primary keys, they are indexes in the result set. Thus, <code>0</code>
382            * refers to the first result in the set. Setting both <code>start</code>
383            * and <code>end</code> to {@link
384            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
385            * result set.
386            * </p>
387            *
388            * @param companyId the primary key of the organizations' company
389            * @param parentOrganizationId the primary key of the organizations' parent
390            organization
391            * @param start the lower bound of the range of organizations to return
392            * @param end the upper bound of the range of organizations to return (not
393            inclusive)
394            * @return the range of organizations belonging to the parent organization
395            * @throws SystemException if a system exception occurred
396            */
397            public static com.liferay.portal.model.OrganizationSoap[] getOrganizations(
398                    long companyId, long parentOrganizationId, int start, int end)
399                    throws RemoteException {
400                    try {
401                            java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getOrganizations(companyId,
402                                            parentOrganizationId, start, end);
403    
404                            return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
405                    }
406                    catch (Exception e) {
407                            _log.error(e, e);
408    
409                            throw new RemoteException(e.getMessage());
410                    }
411            }
412    
413            /**
414            * Returns the number of organizations belonging to the parent organization.
415            *
416            * @param companyId the primary key of the organizations' company
417            * @param parentOrganizationId the primary key of the organizations' parent
418            organization
419            * @return the number of organizations belonging to the parent organization
420            * @throws SystemException if a system exception occurred
421            */
422            public static int getOrganizationsCount(long companyId,
423                    long parentOrganizationId) throws RemoteException {
424                    try {
425                            int returnValue = OrganizationServiceUtil.getOrganizationsCount(companyId,
426                                            parentOrganizationId);
427    
428                            return returnValue;
429                    }
430                    catch (Exception e) {
431                            _log.error(e, e);
432    
433                            throw new RemoteException(e.getMessage());
434                    }
435            }
436    
437            /**
438            * Returns all the organizations associated with the user.
439            *
440            * @param userId the primary key of the user
441            * @return the organizations associated with the user
442            * @throws PortalException if a user with the primary key could not be found
443            * @throws SystemException if a system exception occurred
444            */
445            public static com.liferay.portal.model.OrganizationSoap[] getUserOrganizations(
446                    long userId) throws RemoteException {
447                    try {
448                            java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getUserOrganizations(userId);
449    
450                            return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
451                    }
452                    catch (Exception e) {
453                            _log.error(e, e);
454    
455                            throw new RemoteException(e.getMessage());
456                    }
457            }
458    
459            /**
460            * Sets the organizations in the group, removing and adding organizations to
461            * the group as necessary.
462            *
463            * @param groupId the primary key of the group
464            * @param organizationIds the primary keys of the organizations
465            * @throws PortalException if a group or organization with the primary key
466            could not be found or if the user did not have permission to
467            assign group members
468            * @throws SystemException if a system exception occurred
469            */
470            public static void setGroupOrganizations(long groupId,
471                    long[] organizationIds) throws RemoteException {
472                    try {
473                            OrganizationServiceUtil.setGroupOrganizations(groupId,
474                                    organizationIds);
475                    }
476                    catch (Exception e) {
477                            _log.error(e, e);
478    
479                            throw new RemoteException(e.getMessage());
480                    }
481            }
482    
483            /**
484            * Removes the organizations from the group.
485            *
486            * @param groupId the primary key of the group
487            * @param organizationIds the primary keys of the organizations
488            * @throws PortalException if a group or organization with the primary key
489            could not be found or if the user did not have permission to
490            assign group members
491            * @throws SystemException if a system exception occurred
492            */
493            public static void unsetGroupOrganizations(long groupId,
494                    long[] organizationIds) throws RemoteException {
495                    try {
496                            OrganizationServiceUtil.unsetGroupOrganizations(groupId,
497                                    organizationIds);
498                    }
499                    catch (Exception e) {
500                            _log.error(e, e);
501    
502                            throw new RemoteException(e.getMessage());
503                    }
504            }
505    
506            /**
507            * Removes the organizations from the password policy.
508            *
509            * @param passwordPolicyId the primary key of the password policy
510            * @param organizationIds the primary keys of the organizations
511            * @throws PortalException if a password policy or organization with the
512            primary key could not be found, or if the user did not have
513            permission to update the password policy
514            * @throws SystemException if a system exception occurred
515            */
516            public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
517                    long[] organizationIds) throws RemoteException {
518                    try {
519                            OrganizationServiceUtil.unsetPasswordPolicyOrganizations(passwordPolicyId,
520                                    organizationIds);
521                    }
522                    catch (Exception e) {
523                            _log.error(e, e);
524    
525                            throw new RemoteException(e.getMessage());
526                    }
527            }
528    
529            /**
530            * Updates the organization with additional parameters.
531            *
532            * @param organizationId the primary key of the organization
533            * @param parentOrganizationId the primary key of the organization's parent
534            organization
535            * @param name the organization's name
536            * @param type the organization's type
537            * @param recursable whether the permissions of the organization are to be
538            inherited by its suborganizations
539            * @param regionId the primary key of the organization's region
540            * @param countryId the primary key of the organization's country
541            * @param statusId the organization's workflow status
542            * @param comments the comments about the organization
543            * @param site whether the organization is to be associated with a main
544            site
545            * @param addresses the organization's addresses
546            * @param emailAddresses the organization's email addresses
547            * @param orgLabors the organization's hours of operation
548            * @param phones the organization's phone numbers
549            * @param websites the organization's websites
550            * @param serviceContext the organization's service context (optionally
551            <code>null</code>). Can set asset category IDs and asset tag
552            names for the organization, and merge expando bridge attributes
553            for the organization.
554            * @return the organization
555            * @throws PortalException if an organization or parent organization with
556            the primary key could not be found, if the user did not have
557            permission to update the organization information, or if the new
558            information was invalid
559            * @throws SystemException if a system exception occurred
560            */
561            public static com.liferay.portal.model.OrganizationSoap updateOrganization(
562                    long organizationId, long parentOrganizationId, java.lang.String name,
563                    java.lang.String type, boolean recursable, long regionId,
564                    long countryId, int statusId, java.lang.String comments, boolean site,
565                    com.liferay.portal.model.AddressSoap[] addresses,
566                    com.liferay.portal.model.EmailAddressSoap[] emailAddresses,
567                    com.liferay.portal.model.OrgLaborSoap[] orgLabors,
568                    com.liferay.portal.model.PhoneSoap[] phones,
569                    com.liferay.portal.model.WebsiteSoap[] websites,
570                    com.liferay.portal.service.ServiceContext serviceContext)
571                    throws RemoteException {
572                    try {
573                            com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId,
574                                            parentOrganizationId, name, type, recursable, regionId,
575                                            countryId, statusId, comments, site,
576                                            com.liferay.portal.model.impl.AddressModelImpl.toModels(
577                                                    addresses),
578                                            com.liferay.portal.model.impl.EmailAddressModelImpl.toModels(
579                                                    emailAddresses),
580                                            com.liferay.portal.model.impl.OrgLaborModelImpl.toModels(
581                                                    orgLabors),
582                                            com.liferay.portal.model.impl.PhoneModelImpl.toModels(
583                                                    phones),
584                                            com.liferay.portal.model.impl.WebsiteModelImpl.toModels(
585                                                    websites), serviceContext);
586    
587                            return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
588                    }
589                    catch (Exception e) {
590                            _log.error(e, e);
591    
592                            throw new RemoteException(e.getMessage());
593                    }
594            }
595    
596            /**
597            * Updates the organization.
598            *
599            * @param organizationId the primary key of the organization
600            * @param parentOrganizationId the primary key of the organization's parent
601            organization
602            * @param name the organization's name
603            * @param type the organization's type
604            * @param recursable whether permissions of the organization are to be
605            inherited by its suborganizations
606            * @param regionId the primary key of the organization's region
607            * @param countryId the primary key of the organization's country
608            * @param statusId the organization's workflow status
609            * @param comments the comments about the organization
610            * @param site whether the organization is to be associated with a main
611            site
612            * @param serviceContext the organization's service context (optionally
613            <code>null</code>). Can set asset category IDs and asset tag
614            names for the organization, and merge expando bridge attributes
615            for the organization.
616            * @return the organization
617            * @throws PortalException if an organization or parent organization with
618            the primary key could not be found, if the user did not have
619            permission to update the organization, or if the new information
620            was invalid
621            * @throws SystemException if a system exception occurred
622            */
623            public static com.liferay.portal.model.OrganizationSoap updateOrganization(
624                    long organizationId, long parentOrganizationId, java.lang.String name,
625                    java.lang.String type, boolean recursable, long regionId,
626                    long countryId, int statusId, java.lang.String comments, boolean site,
627                    com.liferay.portal.service.ServiceContext serviceContext)
628                    throws RemoteException {
629                    try {
630                            com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId,
631                                            parentOrganizationId, name, type, recursable, regionId,
632                                            countryId, statusId, comments, site, serviceContext);
633    
634                            return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
635                    }
636                    catch (Exception e) {
637                            _log.error(e, e);
638    
639                            throw new RemoteException(e.getMessage());
640                    }
641            }
642    
643            private static Log _log = LogFactoryUtil.getLog(OrganizationServiceSoap.class);
644    }