001    /**
002     * Copyright (c) 2000-2013 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;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * The utility for the organization remote service. This utility wraps {@link com.liferay.portal.service.impl.OrganizationServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
022     *
023     * <p>
024     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see OrganizationService
029     * @see com.liferay.portal.service.base.OrganizationServiceBaseImpl
030     * @see com.liferay.portal.service.impl.OrganizationServiceImpl
031     * @generated
032     */
033    public class OrganizationServiceUtil {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.OrganizationServiceImpl} and rerun ServiceBuilder to regenerate this class.
038             */
039    
040            /**
041            * Returns the Spring bean ID for this bean.
042            *
043            * @return the Spring bean ID for this bean
044            */
045            public static java.lang.String getBeanIdentifier() {
046                    return getService().getBeanIdentifier();
047            }
048    
049            /**
050            * Sets the Spring bean ID for this bean.
051            *
052            * @param beanIdentifier the Spring bean ID for this bean
053            */
054            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
055                    getService().setBeanIdentifier(beanIdentifier);
056            }
057    
058            /**
059            * Adds the organizations to the group.
060            *
061            * @param groupId the primary key of the group
062            * @param organizationIds the primary keys of the organizations
063            * @throws PortalException if a group or organization with the primary key
064            could not be found or if the user did not have permission to
065            assign group members
066            * @throws SystemException if a system exception occurred
067            */
068            public static void addGroupOrganizations(long groupId,
069                    long[] organizationIds)
070                    throws com.liferay.portal.kernel.exception.PortalException,
071                            com.liferay.portal.kernel.exception.SystemException {
072                    getService().addGroupOrganizations(groupId, organizationIds);
073            }
074    
075            /**
076            * Adds an organization with additional parameters.
077            *
078            * <p>
079            * This method handles the creation and bookkeeping of the organization
080            * including its resources, metadata, and internal data structures.
081            * </p>
082            *
083            * @param parentOrganizationId the primary key of the organization's parent
084            organization
085            * @param name the organization's name
086            * @param type the organization's type
087            * @param recursable whether the permissions of the organization are to be
088            inherited by its suborganizations
089            * @param regionId the primary key of the organization's region
090            * @param countryId the primary key of the organization's country
091            * @param statusId the organization's workflow status
092            * @param comments the comments about the organization
093            * @param site whether the organization is to be associated with a main
094            site
095            * @param addresses the organization's addresses
096            * @param emailAddresses the organization's email addresses
097            * @param orgLabors the organization's hours of operation
098            * @param phones the organization's phone numbers
099            * @param websites the organization's websites
100            * @param serviceContext the organization's service context (optionally
101            <code>null</code>). Can set asset category IDs, asset tag names,
102            and expando bridge attributes for the organization.
103            * @return the organization
104            * @throws PortalException if a parent organization with the primary key
105            could not be found, if the organization's information was
106            invalid, or if the user did not have permission to add the
107            organization
108            * @throws SystemException if a system exception occurred
109            */
110            public static com.liferay.portal.model.Organization addOrganization(
111                    long parentOrganizationId, java.lang.String name,
112                    java.lang.String type, boolean recursable, long regionId,
113                    long countryId, int statusId, java.lang.String comments, boolean site,
114                    java.util.List<com.liferay.portal.model.Address> addresses,
115                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
116                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
117                    java.util.List<com.liferay.portal.model.Phone> phones,
118                    java.util.List<com.liferay.portal.model.Website> websites,
119                    com.liferay.portal.service.ServiceContext serviceContext)
120                    throws com.liferay.portal.kernel.exception.PortalException,
121                            com.liferay.portal.kernel.exception.SystemException {
122                    return getService()
123                                       .addOrganization(parentOrganizationId, name, type,
124                            recursable, regionId, countryId, statusId, comments, site,
125                            addresses, emailAddresses, orgLabors, phones, websites,
126                            serviceContext);
127            }
128    
129            /**
130            * Adds an organization.
131            *
132            * <p>
133            * This method handles the creation and bookkeeping of the organization
134            * including its resources, metadata, and internal data structures.
135            * </p>
136            *
137            * @param parentOrganizationId the primary key of the organization's parent
138            organization
139            * @param name the organization's name
140            * @param type the organization's type
141            * @param recursable whether the permissions of the organization are to be
142            inherited by its suborganizations
143            * @param regionId the primary key of the organization's region
144            * @param countryId the primary key of the organization's country
145            * @param statusId the organization's workflow status
146            * @param comments the comments about the organization
147            * @param site whether the organization is to be associated with a main
148            site
149            * @param serviceContext the organization's service context (optionally
150            <code>null</code>). Can set asset category IDs, asset tag names,
151            and expando bridge attributes for the organization.
152            * @return the organization
153            * @throws PortalException if the parent organization with the primary key
154            could not be found, if the organization information was invalid,
155            or if the user did not have permission to add the organization
156            * @throws SystemException if a system exception occurred
157            */
158            public static com.liferay.portal.model.Organization addOrganization(
159                    long parentOrganizationId, java.lang.String name,
160                    java.lang.String type, boolean recursable, long regionId,
161                    long countryId, int statusId, java.lang.String comments, boolean site,
162                    com.liferay.portal.service.ServiceContext serviceContext)
163                    throws com.liferay.portal.kernel.exception.PortalException,
164                            com.liferay.portal.kernel.exception.SystemException {
165                    return getService()
166                                       .addOrganization(parentOrganizationId, name, type,
167                            recursable, regionId, countryId, statusId, comments, site,
168                            serviceContext);
169            }
170    
171            /**
172            * Assigns the password policy to the organizations, removing any other
173            * currently assigned password policies.
174            *
175            * @param passwordPolicyId the primary key of the password policy
176            * @param organizationIds the primary keys of the organizations
177            * @throws PortalException if the user did not have permission to update the
178            password policy
179            * @throws SystemException if a system exception occurred
180            */
181            public static void addPasswordPolicyOrganizations(long passwordPolicyId,
182                    long[] organizationIds)
183                    throws com.liferay.portal.kernel.exception.PortalException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    getService()
186                            .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
187            }
188    
189            /**
190            * Deletes the logo of the organization.
191            *
192            * @param organizationId the primary key of the organization
193            * @throws PortalException if an organization with the primary key could not
194            be found, if the organization's logo could not be found, or if
195            the user did not have permission to update the organization
196            * @throws SystemException if a system exception occurred
197            */
198            public static void deleteLogo(long organizationId)
199                    throws com.liferay.portal.kernel.exception.PortalException,
200                            com.liferay.portal.kernel.exception.SystemException {
201                    getService().deleteLogo(organizationId);
202            }
203    
204            /**
205            * Deletes the organization. The organization's associated resources and
206            * assets are also deleted.
207            *
208            * @param organizationId the primary key of the organization
209            * @throws PortalException if an organization with the primary key could not
210            be found, if the user did not have permission to delete the
211            organization, if the organization had a workflow in approved
212            status, or if the organization was a parent organization
213            * @throws SystemException if a system exception occurred
214            */
215            public static void deleteOrganization(long organizationId)
216                    throws com.liferay.portal.kernel.exception.PortalException,
217                            com.liferay.portal.kernel.exception.SystemException {
218                    getService().deleteOrganization(organizationId);
219            }
220    
221            /**
222            * Returns all the organizations which the user has permission to manage.
223            *
224            * @param actionId the permitted action
225            * @param max the maximum number of the organizations to be considered
226            * @return the organizations which the user has permission to manage
227            * @throws PortalException if a portal exception occurred
228            * @throws SystemException if a system exception occurred
229            * @deprecated Replaced by {@link #getOrganizations(long, long, int, int)}
230            */
231            public static java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
232                    java.lang.String actionId, int max)
233                    throws com.liferay.portal.kernel.exception.PortalException,
234                            com.liferay.portal.kernel.exception.SystemException {
235                    return getService().getManageableOrganizations(actionId, max);
236            }
237    
238            /**
239            * Returns the organization with the primary key.
240            *
241            * @param organizationId the primary key of the organization
242            * @return the organization with the primary key
243            * @throws PortalException if an organization with the primary key could not
244            be found or if the user did not have permission to view the
245            organization
246            * @throws SystemException if a system exception occurred
247            */
248            public static com.liferay.portal.model.Organization getOrganization(
249                    long organizationId)
250                    throws com.liferay.portal.kernel.exception.PortalException,
251                            com.liferay.portal.kernel.exception.SystemException {
252                    return getService().getOrganization(organizationId);
253            }
254    
255            /**
256            * Returns the primary key of the organization with the name.
257            *
258            * @param companyId the primary key of the organization's company
259            * @param name the organization's name
260            * @return the primary key of the organization with the name, or
261            <code>0</code> if the organization could not be found
262            * @throws PortalException if the user did not have permission to view the
263            organization
264            * @throws SystemException if a system exception occurred
265            */
266            public static long getOrganizationId(long companyId, java.lang.String name)
267                    throws com.liferay.portal.kernel.exception.PortalException,
268                            com.liferay.portal.kernel.exception.SystemException {
269                    return getService().getOrganizationId(companyId, name);
270            }
271    
272            /**
273            * Returns all the organizations belonging to the parent organization.
274            *
275            * @param companyId the primary key of the organizations' company
276            * @param parentOrganizationId the primary key of the organizations' parent
277            organization
278            * @return the organizations belonging to the parent organization
279            * @throws SystemException if a system exception occurred
280            */
281            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
282                    long companyId, long parentOrganizationId)
283                    throws com.liferay.portal.kernel.exception.SystemException {
284                    return getService().getOrganizations(companyId, parentOrganizationId);
285            }
286    
287            /**
288            * Returns a range of all the organizations belonging to the parent
289            * organization.
290            *
291            * <p>
292            * Useful when paginating results. Returns a maximum of <code>end -
293            * start</code> instances. <code>start</code> and <code>end</code> are not
294            * primary keys, they are indexes in the result set. Thus, <code>0</code>
295            * refers to the first result in the set. Setting both <code>start</code>
296            * and <code>end</code> to {@link
297            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
298            * result set.
299            * </p>
300            *
301            * @param companyId the primary key of the organizations' company
302            * @param parentOrganizationId the primary key of the organizations' parent
303            organization
304            * @param start the lower bound of the range of organizations to return
305            * @param end the upper bound of the range of organizations to return (not
306            inclusive)
307            * @return the range of organizations belonging to the parent organization
308            * @throws SystemException if a system exception occurred
309            */
310            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
311                    long companyId, long parentOrganizationId, int start, int end)
312                    throws com.liferay.portal.kernel.exception.SystemException {
313                    return getService()
314                                       .getOrganizations(companyId, parentOrganizationId, start, end);
315            }
316    
317            /**
318            * Returns the number of organizations belonging to the parent organization.
319            *
320            * @param companyId the primary key of the organizations' company
321            * @param parentOrganizationId the primary key of the organizations' parent
322            organization
323            * @return the number of organizations belonging to the parent organization
324            * @throws SystemException if a system exception occurred
325            */
326            public static int getOrganizationsCount(long companyId,
327                    long parentOrganizationId)
328                    throws com.liferay.portal.kernel.exception.SystemException {
329                    return getService()
330                                       .getOrganizationsCount(companyId, parentOrganizationId);
331            }
332    
333            /**
334            * Returns all the organizations associated with the user.
335            *
336            * @param userId the primary key of the user
337            * @return the organizations associated with the user
338            * @throws PortalException if a user with the primary key could not be found
339            * @throws SystemException if a system exception occurred
340            */
341            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
342                    long userId)
343                    throws com.liferay.portal.kernel.exception.PortalException,
344                            com.liferay.portal.kernel.exception.SystemException {
345                    return getService().getUserOrganizations(userId);
346            }
347    
348            /**
349            * Sets the organizations in the group, removing and adding organizations to
350            * the group as necessary.
351            *
352            * @param groupId the primary key of the group
353            * @param organizationIds the primary keys of the organizations
354            * @throws PortalException if a group or organization with the primary key
355            could not be found or if the user did not have permission to
356            assign group members
357            * @throws SystemException if a system exception occurred
358            */
359            public static void setGroupOrganizations(long groupId,
360                    long[] organizationIds)
361                    throws com.liferay.portal.kernel.exception.PortalException,
362                            com.liferay.portal.kernel.exception.SystemException {
363                    getService().setGroupOrganizations(groupId, organizationIds);
364            }
365    
366            /**
367            * Removes the organizations from the group.
368            *
369            * @param groupId the primary key of the group
370            * @param organizationIds the primary keys of the organizations
371            * @throws PortalException if a group or organization with the primary key
372            could not be found or if the user did not have permission to
373            assign group members
374            * @throws SystemException if a system exception occurred
375            */
376            public static void unsetGroupOrganizations(long groupId,
377                    long[] organizationIds)
378                    throws com.liferay.portal.kernel.exception.PortalException,
379                            com.liferay.portal.kernel.exception.SystemException {
380                    getService().unsetGroupOrganizations(groupId, organizationIds);
381            }
382    
383            /**
384            * Removes the organizations from the password policy.
385            *
386            * @param passwordPolicyId the primary key of the password policy
387            * @param organizationIds the primary keys of the organizations
388            * @throws PortalException if a password policy or organization with the
389            primary key could not be found, or if the user did not have
390            permission to update the password policy
391            * @throws SystemException if a system exception occurred
392            */
393            public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
394                    long[] organizationIds)
395                    throws com.liferay.portal.kernel.exception.PortalException,
396                            com.liferay.portal.kernel.exception.SystemException {
397                    getService()
398                            .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
399            }
400    
401            /**
402            * Updates the organization with additional parameters.
403            *
404            * @param organizationId the primary key of the organization
405            * @param parentOrganizationId the primary key of the organization's parent
406            organization
407            * @param name the organization's name
408            * @param type the organization's type
409            * @param recursable whether the permissions of the organization are to be
410            inherited by its suborganizations
411            * @param regionId the primary key of the organization's region
412            * @param countryId the primary key of the organization's country
413            * @param statusId the organization's workflow status
414            * @param comments the comments about the organization
415            * @param site whether the organization is to be associated with a main
416            site
417            * @param addresses the organization's addresses
418            * @param emailAddresses the organization's email addresses
419            * @param orgLabors the organization's hours of operation
420            * @param phones the organization's phone numbers
421            * @param websites the organization's websites
422            * @param serviceContext the organization's service context (optionally
423            <code>null</code>). Can set asset category IDs and asset tag
424            names for the organization, and merge expando bridge attributes
425            for the organization.
426            * @return the organization
427            * @throws PortalException if an organization or parent organization with
428            the primary key could not be found, if the user did not have
429            permission to update the organization information, or if the new
430            information was invalid
431            * @throws SystemException if a system exception occurred
432            */
433            public static com.liferay.portal.model.Organization updateOrganization(
434                    long organizationId, long parentOrganizationId, java.lang.String name,
435                    java.lang.String type, boolean recursable, long regionId,
436                    long countryId, int statusId, java.lang.String comments, boolean site,
437                    java.util.List<com.liferay.portal.model.Address> addresses,
438                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
439                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
440                    java.util.List<com.liferay.portal.model.Phone> phones,
441                    java.util.List<com.liferay.portal.model.Website> websites,
442                    com.liferay.portal.service.ServiceContext serviceContext)
443                    throws com.liferay.portal.kernel.exception.PortalException,
444                            com.liferay.portal.kernel.exception.SystemException {
445                    return getService()
446                                       .updateOrganization(organizationId, parentOrganizationId,
447                            name, type, recursable, regionId, countryId, statusId, comments,
448                            site, addresses, emailAddresses, orgLabors, phones, websites,
449                            serviceContext);
450            }
451    
452            /**
453            * Updates the organization.
454            *
455            * @param organizationId the primary key of the organization
456            * @param parentOrganizationId the primary key of the organization's parent
457            organization
458            * @param name the organization's name
459            * @param type the organization's type
460            * @param recursable whether permissions of the organization are to be
461            inherited by its suborganizations
462            * @param regionId the primary key of the organization's region
463            * @param countryId the primary key of the organization's country
464            * @param statusId the organization's workflow status
465            * @param comments the comments about the organization
466            * @param site whether the organization is to be associated with a main
467            site
468            * @param serviceContext the organization's service context (optionally
469            <code>null</code>). Can set asset category IDs and asset tag
470            names for the organization, and merge expando bridge attributes
471            for the organization.
472            * @return the organization
473            * @throws PortalException if an organization or parent organization with
474            the primary key could not be found, if the user did not have
475            permission to update the organization, or if the new information
476            was invalid
477            * @throws SystemException if a system exception occurred
478            */
479            public static com.liferay.portal.model.Organization updateOrganization(
480                    long organizationId, long parentOrganizationId, java.lang.String name,
481                    java.lang.String type, boolean recursable, long regionId,
482                    long countryId, int statusId, java.lang.String comments, boolean site,
483                    com.liferay.portal.service.ServiceContext serviceContext)
484                    throws com.liferay.portal.kernel.exception.PortalException,
485                            com.liferay.portal.kernel.exception.SystemException {
486                    return getService()
487                                       .updateOrganization(organizationId, parentOrganizationId,
488                            name, type, recursable, regionId, countryId, statusId, comments,
489                            site, serviceContext);
490            }
491    
492            public static OrganizationService getService() {
493                    if (_service == null) {
494                            _service = (OrganizationService)PortalBeanLocatorUtil.locate(OrganizationService.class.getName());
495    
496                            ReferenceRegistry.registerReference(OrganizationServiceUtil.class,
497                                    "_service");
498                    }
499    
500                    return _service;
501            }
502    
503            /**
504             * @deprecated
505             */
506            public void setService(OrganizationService service) {
507            }
508    
509            private static OrganizationService _service;
510    }