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;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the organization local service. This utility wraps {@link com.liferay.portal.service.impl.OrganizationLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see OrganizationLocalService
030     * @see com.liferay.portal.service.base.OrganizationLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.OrganizationLocalServiceImpl
032     * @generated
033     */
034    public class OrganizationLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.OrganizationLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the organization to the database. Also notifies the appropriate model listeners.
043            *
044            * @param organization the organization
045            * @return the organization that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.Organization addOrganization(
049                    com.liferay.portal.model.Organization organization)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addOrganization(organization);
052            }
053    
054            /**
055            * Creates a new organization with the primary key. Does not add the organization to the database.
056            *
057            * @param organizationId the primary key for the new organization
058            * @return the new organization
059            */
060            public static com.liferay.portal.model.Organization createOrganization(
061                    long organizationId) {
062                    return getService().createOrganization(organizationId);
063            }
064    
065            /**
066            * Deletes the organization with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param organizationId the primary key of the organization
069            * @throws PortalException if a organization with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteOrganization(long organizationId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteOrganization(organizationId);
076            }
077    
078            /**
079            * Deletes the organization from the database. Also notifies the appropriate model listeners.
080            *
081            * @param organization the organization
082            * @throws PortalException
083            * @throws SystemException if a system exception occurred
084            */
085            public static void deleteOrganization(
086                    com.liferay.portal.model.Organization organization)
087                    throws com.liferay.portal.kernel.exception.PortalException,
088                            com.liferay.portal.kernel.exception.SystemException {
089                    getService().deleteOrganization(organization);
090            }
091    
092            /**
093            * Performs a dynamic query on the database and returns the matching rows.
094            *
095            * @param dynamicQuery the dynamic query
096            * @return the matching rows
097            * @throws SystemException if a system exception occurred
098            */
099            @SuppressWarnings("rawtypes")
100            public static java.util.List dynamicQuery(
101                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102                    throws com.liferay.portal.kernel.exception.SystemException {
103                    return getService().dynamicQuery(dynamicQuery);
104            }
105    
106            /**
107            * Performs a dynamic query on the database and returns a range of the matching rows.
108            *
109            * <p>
110            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
111            * </p>
112            *
113            * @param dynamicQuery the dynamic query
114            * @param start the lower bound of the range of model instances
115            * @param end the upper bound of the range of model instances (not inclusive)
116            * @return the range of matching rows
117            * @throws SystemException if a system exception occurred
118            */
119            @SuppressWarnings("rawtypes")
120            public static java.util.List dynamicQuery(
121                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
122                    int end) throws com.liferay.portal.kernel.exception.SystemException {
123                    return getService().dynamicQuery(dynamicQuery, start, end);
124            }
125    
126            /**
127            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
128            *
129            * <p>
130            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
131            * </p>
132            *
133            * @param dynamicQuery the dynamic query
134            * @param start the lower bound of the range of model instances
135            * @param end the upper bound of the range of model instances (not inclusive)
136            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
137            * @return the ordered range of matching rows
138            * @throws SystemException if a system exception occurred
139            */
140            @SuppressWarnings("rawtypes")
141            public static java.util.List dynamicQuery(
142                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
143                    int end,
144                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
145                    throws com.liferay.portal.kernel.exception.SystemException {
146                    return getService()
147                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
148            }
149    
150            /**
151            * Returns the number of rows that match the dynamic query.
152            *
153            * @param dynamicQuery the dynamic query
154            * @return the number of rows that match the dynamic query
155            * @throws SystemException if a system exception occurred
156            */
157            public static long dynamicQueryCount(
158                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
159                    throws com.liferay.portal.kernel.exception.SystemException {
160                    return getService().dynamicQueryCount(dynamicQuery);
161            }
162    
163            public static com.liferay.portal.model.Organization fetchOrganization(
164                    long organizationId)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getService().fetchOrganization(organizationId);
167            }
168    
169            /**
170            * Returns the organization with the primary key.
171            *
172            * @param organizationId the primary key of the organization
173            * @return the organization
174            * @throws PortalException if a organization with the primary key could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public static com.liferay.portal.model.Organization getOrganization(
178                    long organizationId)
179                    throws com.liferay.portal.kernel.exception.PortalException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    return getService().getOrganization(organizationId);
182            }
183    
184            public static com.liferay.portal.model.PersistedModel getPersistedModel(
185                    java.io.Serializable primaryKeyObj)
186                    throws com.liferay.portal.kernel.exception.PortalException,
187                            com.liferay.portal.kernel.exception.SystemException {
188                    return getService().getPersistedModel(primaryKeyObj);
189            }
190    
191            /**
192            * Returns a range of all the organizations.
193            *
194            * <p>
195            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
196            * </p>
197            *
198            * @param start the lower bound of the range of organizations
199            * @param end the upper bound of the range of organizations (not inclusive)
200            * @return the range of organizations
201            * @throws SystemException if a system exception occurred
202            */
203            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
204                    int start, int end)
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getService().getOrganizations(start, end);
207            }
208    
209            /**
210            * Returns the number of organizations.
211            *
212            * @return the number of organizations
213            * @throws SystemException if a system exception occurred
214            */
215            public static int getOrganizationsCount()
216                    throws com.liferay.portal.kernel.exception.SystemException {
217                    return getService().getOrganizationsCount();
218            }
219    
220            /**
221            * Updates the organization in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
222            *
223            * @param organization the organization
224            * @return the organization that was updated
225            * @throws SystemException if a system exception occurred
226            */
227            public static com.liferay.portal.model.Organization updateOrganization(
228                    com.liferay.portal.model.Organization organization)
229                    throws com.liferay.portal.kernel.exception.SystemException {
230                    return getService().updateOrganization(organization);
231            }
232    
233            /**
234            * Updates the organization in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
235            *
236            * @param organization the organization
237            * @param merge whether to merge the organization with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
238            * @return the organization that was updated
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portal.model.Organization updateOrganization(
242                    com.liferay.portal.model.Organization organization, boolean merge)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getService().updateOrganization(organization, merge);
245            }
246    
247            /**
248            * Returns the Spring bean ID for this bean.
249            *
250            * @return the Spring bean ID for this bean
251            */
252            public static java.lang.String getBeanIdentifier() {
253                    return getService().getBeanIdentifier();
254            }
255    
256            /**
257            * Sets the Spring bean ID for this bean.
258            *
259            * @param beanIdentifier the Spring bean ID for this bean
260            */
261            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
262                    getService().setBeanIdentifier(beanIdentifier);
263            }
264    
265            /**
266            * Adds the organizations to the group.
267            *
268            * @param groupId the primary key of the group
269            * @param organizationIds the primary keys of the organizations
270            * @throws PortalException if a group or organization with the primary key
271            could not be found
272            * @throws SystemException if a system exception occurred
273            */
274            public static void addGroupOrganizations(long groupId,
275                    long[] organizationIds)
276                    throws com.liferay.portal.kernel.exception.PortalException,
277                            com.liferay.portal.kernel.exception.SystemException {
278                    getService().addGroupOrganizations(groupId, organizationIds);
279            }
280    
281            /**
282            * Adds an organization.
283            *
284            * <p>
285            * This method handles the creation and bookkeeping of the organization
286            * including its resources, metadata, and internal data structures. It is
287            * not necessary to make a subsequent call to {@link
288            * #addOrganizationResources(long, Organization)}.
289            * </p>
290            *
291            * @param userId the primary key of the creator/owner of the organization
292            * @param parentOrganizationId the primary key of the organization's parent
293            organization
294            * @param name the organization's name
295            * @param type the organization's type
296            * @param recursable whether the permissions of the organization are to be
297            inherited by its sub-organizations
298            * @param regionId the primary key of the organization's region
299            * @param countryId the primary key of the organization's country
300            * @param statusId the organization's workflow status
301            * @param comments the comments about the organization
302            * @param site whether the organization is to be associated with a main
303            site
304            * @param serviceContext the organization's service context (optionally
305            <code>null</code>). Can set asset category IDs, asset tag names,
306            and expando bridge attributes for the organization.
307            * @return the organization
308            * @throws PortalException if a creator or parent organization with the
309            primary key could not be found or if the organization's
310            information was invalid
311            * @throws SystemException if a system exception occurred
312            */
313            public static com.liferay.portal.model.Organization addOrganization(
314                    long userId, long parentOrganizationId, java.lang.String name,
315                    java.lang.String type, boolean recursable, long regionId,
316                    long countryId, int statusId, java.lang.String comments, boolean site,
317                    com.liferay.portal.service.ServiceContext serviceContext)
318                    throws com.liferay.portal.kernel.exception.PortalException,
319                            com.liferay.portal.kernel.exception.SystemException {
320                    return getService()
321                                       .addOrganization(userId, parentOrganizationId, name, type,
322                            recursable, regionId, countryId, statusId, comments, site,
323                            serviceContext);
324            }
325    
326            /**
327            * Adds a resource for each type of permission available on the
328            * organization.
329            *
330            * @param userId the primary key of the creator/owner of the organization
331            * @param organization the organization
332            * @throws PortalException if a portal exception occurred
333            * @throws SystemException if a system exception occurred
334            */
335            public static void addOrganizationResources(long userId,
336                    com.liferay.portal.model.Organization organization)
337                    throws com.liferay.portal.kernel.exception.PortalException,
338                            com.liferay.portal.kernel.exception.SystemException {
339                    getService().addOrganizationResources(userId, organization);
340            }
341    
342            /**
343            * Assigns the password policy to the organizations, removing any other
344            * currently assigned password policies.
345            *
346            * @param passwordPolicyId the primary key of the password policy
347            * @param organizationIds the primary keys of the organizations
348            * @throws SystemException if a system exception occurred
349            */
350            public static void addPasswordPolicyOrganizations(long passwordPolicyId,
351                    long[] organizationIds)
352                    throws com.liferay.portal.kernel.exception.SystemException {
353                    getService()
354                            .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
355            }
356    
357            /**
358            * Deletes the logo of the organization.
359            *
360            * @param organizationId the primary key of the organization
361            * @throws PortalException if an organization or parent organization with
362            the primary key could not be found or if the organization's logo
363            could not be found
364            * @throws SystemException if a system exception occurred
365            */
366            public static void deleteLogo(long organizationId)
367                    throws com.liferay.portal.kernel.exception.PortalException,
368                            com.liferay.portal.kernel.exception.SystemException {
369                    getService().deleteLogo(organizationId);
370            }
371    
372            /**
373            * Returns all the organizations belonging to the group.
374            *
375            * @param groupId the primary key of the group
376            * @return the organizations belonging to the group
377            * @throws SystemException if a system exception occurred
378            */
379            public static java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations(
380                    long groupId)
381                    throws com.liferay.portal.kernel.exception.SystemException {
382                    return getService().getGroupOrganizations(groupId);
383            }
384    
385            /**
386            * Returns the organization with the name.
387            *
388            * @param companyId the primary key of the organization's company
389            * @param name the organization's name
390            * @return the organization with the name
391            * @throws PortalException if the organization with the name could not be
392            found
393            * @throws SystemException if a system exception occurred
394            */
395            public static com.liferay.portal.model.Organization getOrganization(
396                    long companyId, java.lang.String name)
397                    throws com.liferay.portal.kernel.exception.PortalException,
398                            com.liferay.portal.kernel.exception.SystemException {
399                    return getService().getOrganization(companyId, name);
400            }
401    
402            /**
403            * Returns the primary key of the organization with the name.
404            *
405            * @param companyId the primary key of the organization's company
406            * @param name the organization's name
407            * @return the primary key of the organization with the name, or
408            <code>0</code> if the organization could not be found
409            * @throws SystemException if a system exception occurred
410            */
411            public static long getOrganizationId(long companyId, java.lang.String name)
412                    throws com.liferay.portal.kernel.exception.SystemException {
413                    return getService().getOrganizationId(companyId, name);
414            }
415    
416            /**
417            * Returns all the organizations belonging to the parent organization.
418            *
419            * @param companyId the primary key of the organization's company
420            * @param parentOrganizationId the primary key of the organization's parent
421            organization
422            * @return the organizations belonging to the parent organization
423            * @throws SystemException if a system exception occurred
424            */
425            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
426                    long companyId, long parentOrganizationId)
427                    throws com.liferay.portal.kernel.exception.SystemException {
428                    return getService().getOrganizations(companyId, parentOrganizationId);
429            }
430    
431            /**
432            * Returns a range of all the organizations belonging to the parent
433            * organization.
434            *
435            * <p>
436            * Useful when paginating results. Returns a maximum of <code>end -
437            * start</code> instances. <code>start</code> and <code>end</code> are not
438            * primary keys, they are indexes in the result set. Thus, <code>0</code>
439            * refers to the first result in the set. Setting both <code>start</code>
440            * and <code>end</code> to {@link
441            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
442            * result set.
443            * </p>
444            *
445            * @param companyId the primary key of the organization's company
446            * @param parentOrganizationId the primary key of the organization's parent
447            organization
448            * @param start the lower bound of the range of organizations to return
449            * @param end the upper bound of the range of organizations to return (not
450            inclusive)
451            * @return the range of organizations belonging to the parent organization
452            * @throws SystemException if a system exception occurred
453            * @see com.liferay.portal.service.persistence.OrganizationPersistence#findByC_P(
454            long, long, int, int)
455            */
456            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
457                    long companyId, long parentOrganizationId, int start, int end)
458                    throws com.liferay.portal.kernel.exception.SystemException {
459                    return getService()
460                                       .getOrganizations(companyId, parentOrganizationId, start, end);
461            }
462    
463            /**
464            * Returns the organizations with the primary keys.
465            *
466            * @param organizationIds the primary keys of the organizations
467            * @return the organizations with the primary keys
468            * @throws PortalException if any one of the organizations could not be
469            found
470            * @throws SystemException if a system exception occurred
471            */
472            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
473                    long[] organizationIds)
474                    throws com.liferay.portal.kernel.exception.PortalException,
475                            com.liferay.portal.kernel.exception.SystemException {
476                    return getService().getOrganizations(organizationIds);
477            }
478    
479            /**
480            * Returns the number of organizations belonging to the parent organization.
481            *
482            * @param companyId the primary key of the organization's company
483            * @param parentOrganizationId the primary key of the organization's parent
484            organization
485            * @return the number of organizations belonging to the parent organization
486            * @throws SystemException if a system exception occurred
487            */
488            public static int getOrganizationsCount(long companyId,
489                    long parentOrganizationId)
490                    throws com.liferay.portal.kernel.exception.SystemException {
491                    return getService()
492                                       .getOrganizationsCount(companyId, parentOrganizationId);
493            }
494    
495            /**
496            * Returns the parent organizations in order by closest ancestor. The list
497            * starts with the organization itself.
498            *
499            * @param organizationId the primary key of the organization
500            * @return the parent organizations in order by closest ancestor
501            * @throws PortalException if an organization with the primary key could not
502            be found
503            * @throws SystemException if a system exception occurred
504            */
505            public static java.util.List<com.liferay.portal.model.Organization> getParentOrganizations(
506                    long organizationId)
507                    throws com.liferay.portal.kernel.exception.PortalException,
508                            com.liferay.portal.kernel.exception.SystemException {
509                    return getService().getParentOrganizations(organizationId);
510            }
511    
512            /**
513            * Returns the sub-organizations of the organizations.
514            *
515            * @param organizations the organizations from which to get
516            sub-organizations
517            * @return the sub-organizations of the organizations
518            * @throws SystemException if a system exception occurred
519            */
520            public static java.util.List<com.liferay.portal.model.Organization> getSuborganizations(
521                    java.util.List<com.liferay.portal.model.Organization> organizations)
522                    throws com.liferay.portal.kernel.exception.SystemException {
523                    return getService().getSuborganizations(organizations);
524            }
525    
526            /**
527            * Returns the intersection of <code>allOrganizations</code> and
528            * <code>availableOrganizations</code>.
529            *
530            * @param allOrganizations the organizations to check for availability
531            * @param availableOrganizations the available organizations
532            * @return the intersection of <code>allOrganizations</code> and
533            <code>availableOrganizations</code>
534            */
535            public static java.util.List<com.liferay.portal.model.Organization> getSubsetOrganizations(
536                    java.util.List<com.liferay.portal.model.Organization> allOrganizations,
537                    java.util.List<com.liferay.portal.model.Organization> availableOrganizations) {
538                    return getService()
539                                       .getSubsetOrganizations(allOrganizations,
540                            availableOrganizations);
541            }
542    
543            /**
544            * Returns all the organizations associated with the user.
545            *
546            * @param userId the primary key of the user
547            * @return the organizations associated with the user
548            * @throws PortalException if a user with the primary key could not be found
549            * @throws SystemException if a system exception occurred
550            */
551            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
552                    long userId)
553                    throws com.liferay.portal.kernel.exception.PortalException,
554                            com.liferay.portal.kernel.exception.SystemException {
555                    return getService().getUserOrganizations(userId);
556            }
557    
558            /**
559            * Returns a range of all the organizations associated with the user.
560            *
561            * <p>
562            * Useful when paginating results. Returns a maximum of <code>end -
563            * start</code> instances. <code>start</code> and <code>end</code> are not
564            * primary keys, they are indexes in the result set. Thus, <code>0</code>
565            * refers to the first result in the set. Setting both <code>start</code>
566            * and <code>end</code> to {@link
567            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
568            * result set.
569            * </p>
570            *
571            * @param userId the primary key of the user
572            * @param start the lower bound of the range of organizations to return
573            * @param end the upper bound of the range of organizations to return (not
574            inclusive)
575            * @return the range organizations associated with the user
576            * @throws PortalException if a user with the primary key could not be found
577            * @throws SystemException if a system exception occurred
578            */
579            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
580                    long userId, int start, int end)
581                    throws com.liferay.portal.kernel.exception.PortalException,
582                            com.liferay.portal.kernel.exception.SystemException {
583                    return getService().getUserOrganizations(userId, start, end);
584            }
585    
586            /**
587            * Returns the number of organizations associated with the user.
588            *
589            * @param userId the primary key of the user
590            * @return the number of organizations associated with the user
591            * @throws SystemException if a system exception occurred
592            */
593            public static int getUserOrganizationsCount(long userId)
594                    throws com.liferay.portal.kernel.exception.SystemException {
595                    return getService().getUserOrganizationsCount(userId);
596            }
597    
598            /**
599            * Returns <code>true</code> if the organization belongs to the group.
600            *
601            * @param groupId the primary key of the group
602            * @param organizationId the primary key of the organization
603            * @return <code>true</code> if the organization belongs to the group;
604            <code>false</code> otherwise
605            * @throws SystemException if a system exception occurred
606            */
607            public static boolean hasGroupOrganization(long groupId, long organizationId)
608                    throws com.liferay.portal.kernel.exception.SystemException {
609                    return getService().hasGroupOrganization(groupId, organizationId);
610            }
611    
612            /**
613            * Returns <code>true</code> if the password policy has been assigned to the
614            * organization.
615            *
616            * @param passwordPolicyId the primary key of the password policy
617            * @param organizationId the primary key of the organization
618            * @return <code>true</code> if the password policy has been assigned to the
619            organization; <code>false</code> otherwise
620            * @throws SystemException if a system exception occurred
621            */
622            public static boolean hasPasswordPolicyOrganization(long passwordPolicyId,
623                    long organizationId)
624                    throws com.liferay.portal.kernel.exception.SystemException {
625                    return getService()
626                                       .hasPasswordPolicyOrganization(passwordPolicyId,
627                            organizationId);
628            }
629    
630            /**
631            * Returns <code>true</code> if the user is a member of the organization.
632            * This method is usually called to determine if the user has view access to
633            * a resource belonging to the organization.
634            *
635            * @param userId the primary key of the user
636            * @param organizationId the primary key of the organization
637            * @return <code>true</code> if the user has access to the organization;
638            <code>false</code> otherwise
639            * @throws SystemException if a system exception occurred
640            */
641            public static boolean hasUserOrganization(long userId, long organizationId)
642                    throws com.liferay.portal.kernel.exception.SystemException {
643                    return getService().hasUserOrganization(userId, organizationId);
644            }
645    
646            /**
647            * Returns <code>true</code> if the user is a member of the organization,
648            * optionally focusing on sub-organizations or the specified organization.
649            * This method is usually called to determine if the user has view access to
650            * a resource belonging to the organization.
651            *
652            * <p>
653            *
654            * <ol>
655            * <li>
656            * If <code>inheritSuborganizations=<code>false</code></code>:
657            * the method checks whether the user belongs to the organization specified
658            * by <code>organizationId</code>. The parameter
659            * <code>includeSpecifiedOrganization</code> is ignored.
660            * </li>
661            * <li>
662            * The parameter <code>includeSpecifiedOrganization</code> is
663            * ignored unless <code>inheritSuborganizations</code> is also
664            * <code>true</code>.
665            * </li>
666            * <li>
667            * If <code>inheritSuborganizations=<code>true</code></code> and
668            * <code>includeSpecifiedOrganization=<code>false</code></code>: the method
669            * checks
670            * whether the user belongs to one of the child organizations of the one
671            * specified by <code>organizationId</code>.
672            * </li>
673            * <li>
674            * If <code>inheritSuborganizations=<code>true</code></code> and
675            * <code>includeSpecifiedOrganization=<code>true</code></code>: the method
676            * checks whether
677            * the user belongs to the organization specified by
678            * <code>organizationId</code> or any of
679            * its child organizations.
680            * </li>
681            * </ol>
682            *
683            * <p>
684            *
685            * @param userId the primary key of the organization's user
686            * @param organizationId the primary key of the organization
687            * @param inheritSuborganizations if <code>true</code> sub-organizations
688            are considered in the determination
689            * @param includeSpecifiedOrganization if <code>true</code> the
690            organization specified by <code>organizationId</code> is
691            considered in the determination
692            * @return <code>true</code> if the user has access to the organization;
693            <code>false</code> otherwise
694            * @throws PortalException if an organization with the primary key could not
695            be found
696            * @throws SystemException if a system exception occurred
697            * @see com.liferay.portal.service.persistence.OrganizationFinder
698            */
699            public static boolean hasUserOrganization(long userId, long organizationId,
700                    boolean inheritSuborganizations, boolean includeSpecifiedOrganization)
701                    throws com.liferay.portal.kernel.exception.PortalException,
702                            com.liferay.portal.kernel.exception.SystemException {
703                    return getService()
704                                       .hasUserOrganization(userId, organizationId,
705                            inheritSuborganizations, includeSpecifiedOrganization);
706            }
707    
708            /**
709            * Rebuilds the organizations tree.
710            *
711            * <p>
712            * Only call this method if the tree has become stale through operations
713            * other than normal CRUD. Under normal circumstances the tree is
714            * automatically rebuilt whenever necessary.
715            * </p>
716            *
717            * @param companyId the primary key of the organization's company
718            * @throws PortalException if an organization with the primary key could not
719            be found
720            * @throws SystemException if a system exception occurred
721            * @see com.liferay.portal.service.persistence.OrganizationPersistence#rebuildTree(
722            long, boolean)
723            */
724            public static void rebuildTree(long companyId)
725                    throws com.liferay.portal.kernel.exception.PortalException,
726                            com.liferay.portal.kernel.exception.SystemException {
727                    getService().rebuildTree(companyId);
728            }
729    
730            /**
731            * Returns a range of all the organizations of the company.
732            *
733            * <p>
734            * Useful when paginating results. Returns a maximum of <code>end -
735            * start</code> instances. <code>start</code> and <code>end</code> are not
736            * primary keys, they are indexes in the result set. Thus, <code>0</code>
737            * refers to the first result in the set. Setting both <code>start</code>
738            * and <code>end</code> to {@link
739            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
740            * result set.
741            * </p>
742            *
743            * @param companyId the primary key of the company
744            * @param params the finder parameters (optionally <code>null</code>). For
745            more information see {@link
746            com.liferay.portlet.enterpriseadmin.util.OrganizationIndexer}
747            * @param start the lower bound of the range of organizations to return
748            * @param end the upper bound of the range of organizations to return (not
749            inclusive)
750            * @return the range of all the organizations of the company
751            * @throws SystemException if a system exception occurred
752            */
753            public static java.util.List<com.liferay.portal.model.Organization> search(
754                    long companyId,
755                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
756                    int start, int end)
757                    throws com.liferay.portal.kernel.exception.SystemException {
758                    return getService().search(companyId, params, start, end);
759            }
760    
761            /**
762            * Returns an ordered range of all the organizations that match the
763            * keywords, using the indexer. It is preferable to use this method instead
764            * of the non-indexed version whenever possible for performance reasons.
765            *
766            * <p>
767            * Useful when paginating results. Returns a maximum of <code>end -
768            * start</code> instances. <code>start</code> and <code>end</code> are not
769            * primary keys, they are indexes in the result set. Thus, <code>0</code>
770            * refers to the first result in the set. Setting both <code>start</code>
771            * and <code>end</code> to {@link
772            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
773            * result set.
774            * </p>
775            *
776            * @param companyId the primary key of the organization's company
777            * @param parentOrganizationId the primary key of the organization's parent
778            organization
779            * @param keywords the keywords (space separated), which may occur in the
780            organization's name, street, city, zipcode, type, region or
781            country (optionally <code>null</code>)
782            * @param params the finder parameters (optionally <code>null</code>). For
783            more information see {@link
784            com.liferay.portlet.enterpriseadmin.util.OrganizationIndexer}
785            * @param start the lower bound of the range of organizations to return
786            * @param end the upper bound of the range of organizations to return (not
787            inclusive)
788            * @param sort the field and direction by which to sort (optionally
789            <code>null</code>)
790            * @return the matching organizations ordered by name
791            * @throws SystemException if a system exception occurred
792            * @see com.liferay.portlet.enterpriseadmin.util.OrganizationIndexer
793            */
794            public static com.liferay.portal.kernel.search.Hits search(long companyId,
795                    long parentOrganizationId, java.lang.String keywords,
796                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
797                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
798                    throws com.liferay.portal.kernel.exception.SystemException {
799                    return getService()
800                                       .search(companyId, parentOrganizationId, keywords, params,
801                            start, end, sort);
802            }
803    
804            /**
805            * Returns a name ordered range of all the organizations that match the
806            * keywords, type, region, and country, without using the indexer. It is
807            * preferable to use the indexed version {@link #search(long, long, String,
808            * LinkedHashMap, int, int, Sort)} instead of this method wherever possible
809            * for performance reasons.
810            *
811            * <p>
812            * Useful when paginating results. Returns a maximum of <code>end -
813            * start</code> instances. <code>start</code> and <code>end</code> are not
814            * primary keys, they are indexes in the result set. Thus, <code>0</code>
815            * refers to the first result in the set. Setting both <code>start</code>
816            * and <code>end</code> to {@link
817            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
818            * result set.
819            * </p>
820            *
821            * @param companyId the primary key of the organization's company
822            * @param parentOrganizationId the primary key of the organization's parent
823            organization
824            * @param keywords the keywords (space separated), which may occur in the
825            organization's name, street, city, or zipcode (optionally
826            <code>null</code>)
827            * @param type the organization's type (optionally <code>null</code>)
828            * @param regionId the primary key of the organization's region (optionally
829            <code>null</code>)
830            * @param countryId the primary key of the organization's country
831            (optionally <code>null</code>)
832            * @param params the finder params. For more information see {@link
833            com.liferay.portal.service.persistence.OrganizationFinder}
834            * @param start the lower bound of the range of organizations to return
835            * @param end the upper bound of the range of organizations to return (not
836            inclusive)
837            * @return the matching organizations ordered by name
838            * @throws SystemException if a system exception occurred
839            * @see com.liferay.portal.service.persistence.OrganizationFinder
840            */
841            public static java.util.List<com.liferay.portal.model.Organization> search(
842                    long companyId, long parentOrganizationId, java.lang.String keywords,
843                    java.lang.String type, java.lang.Long regionId,
844                    java.lang.Long countryId,
845                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
846                    int start, int end)
847                    throws com.liferay.portal.kernel.exception.SystemException {
848                    return getService()
849                                       .search(companyId, parentOrganizationId, keywords, type,
850                            regionId, countryId, params, start, end);
851            }
852    
853            /**
854            * Returns an ordered range of all the organizations that match the
855            * keywords, type, region, and country, without using the indexer. It is
856            * preferable to use the indexed version {@link #search(long, long, String,
857            * String, String, String, String, String, String, LinkedHashMap, boolean,
858            * int, int, Sort)} instead of this method wherever possible for performance
859            * reasons.
860            *
861            * <p>
862            * Useful when paginating results. Returns a maximum of <code>end -
863            * start</code> instances. <code>start</code> and <code>end</code> are not
864            * primary keys, they are indexes in the result set. Thus, <code>0</code>
865            * refers to the first result in the set. Setting both <code>start</code>
866            * and <code>end</code> to {@link
867            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
868            * result set.
869            * </p>
870            *
871            * @param companyId the primary key of the organization's company
872            * @param parentOrganizationId the primary key of the organization's parent
873            organization
874            * @param keywords the keywords (space separated), which may occur in the
875            organization's name, street, city, or zipcode (optionally
876            <code>null</code>)
877            * @param type the organization's type (optionally <code>null</code>)
878            * @param regionId the primary key of the organization's region (optionally
879            <code>null</code>)
880            * @param countryId the primary key of the organization's country
881            (optionally <code>null</code>)
882            * @param params the finder params. For more information see {@link
883            com.liferay.portal.service.persistence.OrganizationFinder}
884            * @param start the lower bound of the range of organizations to return
885            * @param end the upper bound of the range of organizations to return (not
886            inclusive)
887            * @param obc the comparator to order the organizations (optionally
888            <code>null</code>)
889            * @return the matching organizations ordered by comparator <code>obc</code>
890            * @throws SystemException if a system exception occurred
891            * @see com.liferay.portal.service.persistence.OrganizationFinder
892            */
893            public static java.util.List<com.liferay.portal.model.Organization> search(
894                    long companyId, long parentOrganizationId, java.lang.String keywords,
895                    java.lang.String type, java.lang.Long regionId,
896                    java.lang.Long countryId,
897                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
898                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
899                    throws com.liferay.portal.kernel.exception.SystemException {
900                    return getService()
901                                       .search(companyId, parentOrganizationId, keywords, type,
902                            regionId, countryId, params, start, end, obc);
903            }
904    
905            /**
906            * Returns a name ordered range of all the organizations with the type,
907            * region, and country, and whose name, street, city, and zipcode match the
908            * keywords specified for them, without using the indexer. It is preferable
909            * to use the indexed version {@link #search(long, long, String, String,
910            * String, String, String, String, String, LinkedHashMap, boolean, int, int,
911            * Sort)} instead of this method wherever possible for performance reasons.
912            *
913            * <p>
914            * Useful when paginating results. Returns a maximum of <code>end -
915            * start</code> instances. <code>start</code> and <code>end</code> are not
916            * primary keys, they are indexes in the result set. Thus, <code>0</code>
917            * refers to the first result in the set. Setting both <code>start</code>
918            * and <code>end</code> to {@link
919            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
920            * result set.
921            * </p>
922            *
923            * @param companyId the primary key of the organization's company
924            * @param parentOrganizationId the primary key of the organization's parent
925            * @param name the name keywords (space separated, optionally
926            <code>null</code>)
927            * @param type the organization's type (optionally <code>null</code>)
928            * @param street the street keywords (optionally <code>null</code>)
929            * @param city the city keywords (optionally <code>null</code>)
930            * @param zip the zipcode keywords (optionally <code>null</code>)
931            * @param regionId the primary key of the organization's region (optionally
932            <code>null</code>)
933            * @param countryId the primary key of the organization's country
934            (optionally <code>null</code>)
935            * @param params the finder parameters (optionally <code>null</code>). For
936            more information see {@link
937            com.liferay.portal.service.persistence.OrganizationFinder}
938            * @param andOperator whether every field must match its keywords, or just
939            one field. For example, &quot;organizations with the name
940            'Employees' and city 'Chicago'&quot; vs &quot;organizations with
941            the name 'Employees' or the city 'Chicago'&quot;.
942            * @param start the lower bound of the range of organizations to return
943            * @param end the upper bound of the range of organizations to return (not
944            inclusive)
945            * @return the matching organizations ordered by name
946            * @throws SystemException if a system exception occurred
947            * @see com.liferay.portal.service.persistence.OrganizationFinder
948            */
949            public static java.util.List<com.liferay.portal.model.Organization> search(
950                    long companyId, long parentOrganizationId, java.lang.String name,
951                    java.lang.String type, java.lang.String street, java.lang.String city,
952                    java.lang.String zip, java.lang.Long regionId,
953                    java.lang.Long countryId,
954                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
955                    boolean andOperator, int start, int end)
956                    throws com.liferay.portal.kernel.exception.SystemException {
957                    return getService()
958                                       .search(companyId, parentOrganizationId, name, type, street,
959                            city, zip, regionId, countryId, params, andOperator, start, end);
960            }
961    
962            /**
963            * Returns an ordered range of all the organizations with the type, region,
964            * and country, and whose name, street, city, and zipcode match the keywords
965            * specified for them, without using the indexer. It is preferable to use
966            * the indexed version {@link #search(long, long, String, String, String,
967            * String, String, String, String, LinkedHashMap, boolean, int, int, Sort)}
968            * instead of this method wherever possible for performance reasons.
969            *
970            * <p>
971            * Useful when paginating results. Returns a maximum of <code>end -
972            * start</code> instances. <code>start</code> and <code>end</code> are not
973            * primary keys, they are indexes in the result set. Thus, <code>0</code>
974            * refers to the first result in the set. Setting both <code>start</code>
975            * and <code>end</code> to {@link
976            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
977            * result set.
978            * </p>
979            *
980            * @param companyId the primary key of the organization's company
981            * @param parentOrganizationId the primary key of the organization's parent
982            organization
983            * @param name the name keywords (space separated, optionally
984            <code>null</code>)
985            * @param type the organization's type (optionally <code>null</code>)
986            * @param street the street keywords (optionally <code>null</code>)
987            * @param city the city keywords (optionally <code>null</code>)
988            * @param zip the zipcode keywords (optionally <code>null</code>)
989            * @param regionId the primary key of the organization's region (optionally
990            <code>null</code>)
991            * @param countryId the primary key of the organization's country
992            (optionally <code>null</code>)
993            * @param params the finder parameters (optionally <code>null</code>). For
994            more information see {@link
995            com.liferay.portal.service.persistence.OrganizationFinder}
996            * @param andOperator whether every field must match its keywords, or just
997            one field. For example, &quot;organizations with the name
998            'Employees' and city 'Chicago'&quot; vs &quot;organizations with
999            the name 'Employees' or the city 'Chicago'&quot;.
1000            * @param start the lower bound of the range of organizations to return
1001            * @param end the upper bound of the range of organizations to return (not
1002            inclusive)
1003            * @param obc the comparator to order the organizations (optionally
1004            <code>null</code>)
1005            * @return the matching organizations ordered by comparator <code>obc</code>
1006            * @throws SystemException if a system exception occurred
1007            * @see com.liferay.portal.service.persistence.OrganizationFinder
1008            */
1009            public static java.util.List<com.liferay.portal.model.Organization> search(
1010                    long companyId, long parentOrganizationId, java.lang.String name,
1011                    java.lang.String type, java.lang.String street, java.lang.String city,
1012                    java.lang.String zip, java.lang.Long regionId,
1013                    java.lang.Long countryId,
1014                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1015                    boolean andOperator, int start, int end,
1016                    com.liferay.portal.kernel.util.OrderByComparator obc)
1017                    throws com.liferay.portal.kernel.exception.SystemException {
1018                    return getService()
1019                                       .search(companyId, parentOrganizationId, name, type, street,
1020                            city, zip, regionId, countryId, params, andOperator, start, end, obc);
1021            }
1022    
1023            /**
1024            * Returns an ordered range of all the organizations whose name, type, or
1025            * location fields match the keywords specified for them, using the indexer.
1026            * It is preferable to use this method instead of the non-indexed version
1027            * whenever possible for performance reasons.
1028            *
1029            * <p>
1030            * Useful when paginating results. Returns a maximum of <code>end -
1031            * start</code> instances. <code>start</code> and <code>end</code> are not
1032            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1033            * refers to the first result in the set. Setting both <code>start</code>
1034            * and <code>end</code> to {@link
1035            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1036            * result set.
1037            * </p>
1038            *
1039            * @param companyId the primary key of the organization's company
1040            * @param parentOrganizationId the primary key of the organization's parent
1041            organization
1042            * @param name the name keywords (space separated, optionally
1043            <code>null</code>)
1044            * @param type the type keywords (optionally <code>null</code>)
1045            * @param street the street keywords (optionally <code>null</code>)
1046            * @param city the city keywords (optionally <code>null</code>)
1047            * @param zip the zipcode keywords (optionally <code>null</code>)
1048            * @param region the region keywords (optionally <code>null</code>)
1049            * @param country the country keywords (optionally <code>null</code>)
1050            * @param params the finder parameters (optionally <code>null</code>). For
1051            more information see {@link
1052            com.liferay.portlet.enterpriseadmin.util.OrganizationIndexer}.
1053            * @param andSearch whether every field must match its keywords or just one
1054            field
1055            * @param start the lower bound of the range of organizations to return
1056            * @param end the upper bound of the range of organizations to return (not
1057            inclusive)
1058            * @param sort the field and direction by which to sort (optionally
1059            <code>null</code>)
1060            * @return the matching organizations ordered by <code>sort</code>
1061            * @throws SystemException if a system exception occurred
1062            * @see com.liferay.portlet.enterpriseadmin.util.OrganizationIndexer
1063            */
1064            public static com.liferay.portal.kernel.search.Hits search(long companyId,
1065                    long parentOrganizationId, java.lang.String name,
1066                    java.lang.String type, java.lang.String street, java.lang.String city,
1067                    java.lang.String zip, java.lang.String region,
1068                    java.lang.String country,
1069                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1070                    boolean andSearch, int start, int end,
1071                    com.liferay.portal.kernel.search.Sort sort)
1072                    throws com.liferay.portal.kernel.exception.SystemException {
1073                    return getService()
1074                                       .search(companyId, parentOrganizationId, name, type, street,
1075                            city, zip, region, country, params, andSearch, start, end, sort);
1076            }
1077    
1078            /**
1079            * Returns the number of organizations that match the keywords, type,
1080            * region, and country.
1081            *
1082            * @param companyId the primary key of the organization's company
1083            * @param parentOrganizationId the primary key of the organization's parent
1084            organization
1085            * @param keywords the keywords (space separated), which may occur in the
1086            organization's name, street, city, or zipcode (optionally
1087            <code>null</code>)
1088            * @param type the organization's type (optionally <code>null</code>)
1089            * @param regionId the primary key of the organization's region (optionally
1090            <code>null</code>)
1091            * @param countryId the primary key of the organization's country
1092            (optionally <code>null</code>)
1093            * @param params the finder parameters (optionally <code>null</code>). For
1094            more information see {@link
1095            com.liferay.portal.service.persistence.OrganizationFinder}
1096            * @return the number of matching organizations
1097            * @throws SystemException if a system exception occurred
1098            * @see com.liferay.portal.service.persistence.OrganizationFinder
1099            */
1100            public static int searchCount(long companyId, long parentOrganizationId,
1101                    java.lang.String keywords, java.lang.String type,
1102                    java.lang.Long regionId, java.lang.Long countryId,
1103                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1104                    throws com.liferay.portal.kernel.exception.SystemException {
1105                    return getService()
1106                                       .searchCount(companyId, parentOrganizationId, keywords,
1107                            type, regionId, countryId, params);
1108            }
1109    
1110            /**
1111            * Returns the number of organizations with the type, region, and country,
1112            * and whose name, street, city, and zipcode match the keywords specified
1113            * for them.
1114            *
1115            * @param companyId the primary key of the organization's company
1116            * @param parentOrganizationId the primary key of the organization's parent
1117            organization
1118            * @param name the name keywords (space separated, optionally
1119            <code>null</code>)
1120            * @param type the organization's type (optionally <code>null</code>)
1121            * @param street the street keywords (optionally <code>null</code>)
1122            * @param city the city keywords (optionally <code>null</code>)
1123            * @param zip the zipcode keywords (optionally <code>null</code>)
1124            * @param regionId the primary key of the organization's region (optionally
1125            <code>null</code>)
1126            * @param countryId the primary key of the organization's country
1127            (optionally <code>null</code>)
1128            * @param params the finder parameters (optionally <code>null</code>). For
1129            more information see {@link
1130            com.liferay.portal.service.persistence.OrganizationFinder}
1131            * @param andOperator whether every field must match its keywords, or just
1132            one field. For example, &quot;organizations with the name
1133            'Employees' and city 'Chicago'&quot; vs &quot;organizations with
1134            the name 'Employees' or the city 'Chicago'&quot;.
1135            * @return the number of matching organizations
1136            * @throws SystemException if a system exception occurred
1137            * @see com.liferay.portal.service.persistence.OrganizationFinder
1138            */
1139            public static int searchCount(long companyId, long parentOrganizationId,
1140                    java.lang.String name, java.lang.String type, java.lang.String street,
1141                    java.lang.String city, java.lang.String zip, java.lang.Long regionId,
1142                    java.lang.Long countryId,
1143                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1144                    boolean andOperator)
1145                    throws com.liferay.portal.kernel.exception.SystemException {
1146                    return getService()
1147                                       .searchCount(companyId, parentOrganizationId, name, type,
1148                            street, city, zip, regionId, countryId, params, andOperator);
1149            }
1150    
1151            /**
1152            * Sets the organizations in the group, removing and adding organizations to
1153            * the group as necessary.
1154            *
1155            * @param groupId the primary key of the group
1156            * @param organizationIds the primary keys of the organizations
1157            * @throws PortalException if a portal exception occurred
1158            * @throws SystemException if a system exception occurred
1159            */
1160            public static void setGroupOrganizations(long groupId,
1161                    long[] organizationIds)
1162                    throws com.liferay.portal.kernel.exception.PortalException,
1163                            com.liferay.portal.kernel.exception.SystemException {
1164                    getService().setGroupOrganizations(groupId, organizationIds);
1165            }
1166    
1167            /**
1168            * Removes the organizations from the group.
1169            *
1170            * @param groupId the primary key of the group
1171            * @param organizationIds the primary keys of the organizations
1172            * @throws PortalException if a portal exception occurred
1173            * @throws SystemException if a system exception occurred
1174            */
1175            public static void unsetGroupOrganizations(long groupId,
1176                    long[] organizationIds)
1177                    throws com.liferay.portal.kernel.exception.PortalException,
1178                            com.liferay.portal.kernel.exception.SystemException {
1179                    getService().unsetGroupOrganizations(groupId, organizationIds);
1180            }
1181    
1182            /**
1183            * Removes the organizations from the password policy.
1184            *
1185            * @param passwordPolicyId the primary key of the password policy
1186            * @param organizationIds the primary keys of the organizations
1187            * @throws SystemException if a system exception occurred
1188            */
1189            public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
1190                    long[] organizationIds)
1191                    throws com.liferay.portal.kernel.exception.SystemException {
1192                    getService()
1193                            .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
1194            }
1195    
1196            /**
1197            * Updates the organization's asset with the new asset categories and tag
1198            * names, removing and adding asset categories and tag names as necessary.
1199            *
1200            * @param userId the primary key of the user
1201            * @param organization the organization
1202            * @param assetCategoryIds the primary keys of the asset categories
1203            * @param assetTagNames the asset tag names
1204            * @throws PortalException if a user with the primary key could not be found
1205            * @throws SystemException if a system exception occurred
1206            */
1207            public static void updateAsset(long userId,
1208                    com.liferay.portal.model.Organization organization,
1209                    long[] assetCategoryIds, java.lang.String[] assetTagNames)
1210                    throws com.liferay.portal.kernel.exception.PortalException,
1211                            com.liferay.portal.kernel.exception.SystemException {
1212                    getService()
1213                            .updateAsset(userId, organization, assetCategoryIds, assetTagNames);
1214            }
1215    
1216            /**
1217            * Updates the organization.
1218            *
1219            * @param companyId the primary key of the organization's company
1220            * @param organizationId the primary key of the organization
1221            * @param parentOrganizationId the primary key of organization's parent
1222            organization
1223            * @param name the organization's name
1224            * @param type the organization's type
1225            * @param recursable whether permissions of the organization are to be
1226            inherited by its sub-organizations
1227            * @param regionId the primary key of the organization's region
1228            * @param countryId the primary key of the organization's country
1229            * @param statusId the organization's workflow status
1230            * @param comments the comments about the organization
1231            * @param site whether the organization is to be associated with a main
1232            site
1233            * @param serviceContext the organization's service context (optionally
1234            <code>null</code>). Can set asset category IDs and asset tag
1235            names for the organization, and merge expando bridge attributes
1236            for the organization.
1237            * @return the organization
1238            * @throws PortalException if an organization or parent organization with
1239            the primary key could not be found or if the new information was
1240            invalid
1241            * @throws SystemException if a system exception occurred
1242            */
1243            public static com.liferay.portal.model.Organization updateOrganization(
1244                    long companyId, long organizationId, long parentOrganizationId,
1245                    java.lang.String name, java.lang.String type, boolean recursable,
1246                    long regionId, long countryId, int statusId, java.lang.String comments,
1247                    boolean site, com.liferay.portal.service.ServiceContext serviceContext)
1248                    throws com.liferay.portal.kernel.exception.PortalException,
1249                            com.liferay.portal.kernel.exception.SystemException {
1250                    return getService()
1251                                       .updateOrganization(companyId, organizationId,
1252                            parentOrganizationId, name, type, recursable, regionId, countryId,
1253                            statusId, comments, site, serviceContext);
1254            }
1255    
1256            public static OrganizationLocalService getService() {
1257                    if (_service == null) {
1258                            _service = (OrganizationLocalService)PortalBeanLocatorUtil.locate(OrganizationLocalService.class.getName());
1259    
1260                            ReferenceRegistry.registerReference(OrganizationLocalServiceUtil.class,
1261                                    "_service");
1262                            MethodCache.remove(OrganizationLocalService.class);
1263                    }
1264    
1265                    return _service;
1266            }
1267    
1268            public void setService(OrganizationLocalService service) {
1269                    MethodCache.remove(OrganizationLocalService.class);
1270    
1271                    _service = service;
1272    
1273                    ReferenceRegistry.registerReference(OrganizationLocalServiceUtil.class,
1274                            "_service");
1275                    MethodCache.remove(OrganizationLocalService.class);
1276            }
1277    
1278            private static OrganizationLocalService _service;
1279    }