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