001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
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 specify the organization's asset category
306            IDs, asset tag names, and expando bridge attributes.
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 all the organizations associated with the user, optionally
560            * including the organizations associated with the user groups to which the
561            * user belongs.
562            *
563            * @param userId the primary key of the user
564            * @param inheritUserGroups whether to include organizations associated
565            with the user groups to which the user belongs
566            * @return the organizations associated with the user
567            * @throws PortalException if a user with the primary key could not be found
568            * @throws SystemException if a system exception occurred
569            */
570            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
571                    long userId, boolean inheritUserGroups)
572                    throws com.liferay.portal.kernel.exception.PortalException,
573                            com.liferay.portal.kernel.exception.SystemException {
574                    return getService().getUserOrganizations(userId, inheritUserGroups);
575            }
576    
577            /**
578            * Returns a range of all the organizations associated with the user,
579            * optionally including the organizations associated with the user groups to
580            * which the user belongs.
581            *
582            * <p>
583            * Useful when paginating results. Returns a maximum of <code>end -
584            * start</code> instances. <code>start</code> and <code>end</code> are not
585            * primary keys, they are indexes in the result set. Thus, <code>0</code>
586            * refers to the first result in the set. Setting both <code>start</code>
587            * and <code>end</code> to {@link
588            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
589            * result set.
590            * </p>
591            *
592            * @param userId the primary key of the user
593            * @param inheritUserGroups whether to include organizations associated
594            with the user groups to which the user belongs
595            * @param start the lower bound of the range of organizations to return
596            * @param end the upper bound of the range of organizations to return (not
597            inclusive)
598            * @return the range organizations associated with the user
599            * @throws PortalException if a user with the primary key could not be found
600            * @throws SystemException if a system exception occurred
601            */
602            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
603                    long userId, boolean inheritUserGroups, int start, int end)
604                    throws com.liferay.portal.kernel.exception.PortalException,
605                            com.liferay.portal.kernel.exception.SystemException {
606                    return getService()
607                                       .getUserOrganizations(userId, inheritUserGroups, start, end);
608            }
609    
610            /**
611            * Returns a range of all the organizations associated with the user.
612            *
613            * <p>
614            * Useful when paginating results. Returns a maximum of <code>end -
615            * start</code> instances. <code>start</code> and <code>end</code> are not
616            * primary keys, they are indexes in the result set. Thus, <code>0</code>
617            * refers to the first result in the set. Setting both <code>start</code>
618            * and <code>end</code> to {@link
619            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
620            * result set.
621            * </p>
622            *
623            * @param userId the primary key of the user
624            * @param start the lower bound of the range of organizations to return
625            * @param end the upper bound of the range of organizations to return (not
626            inclusive)
627            * @return the range organizations associated with the user
628            * @throws PortalException if a user with the primary key could not be found
629            * @throws SystemException if a system exception occurred
630            */
631            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
632                    long userId, int start, int end)
633                    throws com.liferay.portal.kernel.exception.PortalException,
634                            com.liferay.portal.kernel.exception.SystemException {
635                    return getService().getUserOrganizations(userId, start, end);
636            }
637    
638            /**
639            * Returns the number of organizations associated with the user.
640            *
641            * @param userId the primary key of the user
642            * @return the number of organizations associated with the user
643            * @throws SystemException if a system exception occurred
644            */
645            public static int getUserOrganizationsCount(long userId)
646                    throws com.liferay.portal.kernel.exception.SystemException {
647                    return getService().getUserOrganizationsCount(userId);
648            }
649    
650            /**
651            * Returns <code>true</code> if the organization belongs to the group.
652            *
653            * @param groupId the primary key of the group
654            * @param organizationId the primary key of the organization
655            * @return <code>true</code> if the organization belongs to the group;
656            <code>false</code> otherwise
657            * @throws SystemException if a system exception occurred
658            */
659            public static boolean hasGroupOrganization(long groupId, long organizationId)
660                    throws com.liferay.portal.kernel.exception.SystemException {
661                    return getService().hasGroupOrganization(groupId, organizationId);
662            }
663    
664            /**
665            * Returns <code>true</code> if the password policy has been assigned to
666            * the organization.
667            *
668            * @param passwordPolicyId the primary key of the password policy
669            * @param organizationId the primary key of the organization
670            * @return <code>true</code> if the password policy has been assigned to
671            the organization; <code>false</code> otherwise
672            * @throws SystemException if a system exception occurred
673            */
674            public static boolean hasPasswordPolicyOrganization(long passwordPolicyId,
675                    long organizationId)
676                    throws com.liferay.portal.kernel.exception.SystemException {
677                    return getService()
678                                       .hasPasswordPolicyOrganization(passwordPolicyId,
679                            organizationId);
680            }
681    
682            /**
683            * Returns <code>true</code> if the user is a member of the organization.
684            * This method is usually called to determine if the user has view access
685            * to a resource belonging to the organization.
686            *
687            * @param userId the primary key of the user
688            * @param organizationId the primary key of the organization
689            * @return <code>true</code> if the user has access to the organization;
690            <code>false</code> otherwise
691            * @throws SystemException if a system exception occurred
692            */
693            public static boolean hasUserOrganization(long userId, long organizationId)
694                    throws com.liferay.portal.kernel.exception.SystemException {
695                    return getService().hasUserOrganization(userId, organizationId);
696            }
697    
698            /**
699            * Returns <code>true</code> if the user is a member of the organization,
700            * optionally focusing on sub-organizations, user groups, or the specified
701            * organization. This method is usually called to determine if the user has
702            * view access to a resource belonging to the organization.
703            *
704            * <p>
705            *
706            * <ol>
707            * <li>
708            * If <code>inheritSuborganizations=<code>false</code></code> and
709            * <code>inheritUserGroups=<code>false</code></code>: the method checks
710            * whether the user
711            * belongs to the organization specified by <code>organizationId</code>. The
712            * parameter
713            * <code>includeSpecifiedOrganization</code> is ignored.
714            * </li>
715            * <li>
716            * If <code>inheritUserGroups=<code>true</code></code>: the method checks
717            * whether the
718            * user belongs to a user group which has been made as a whole member of the
719            * the organization specified by <code>organizationId</code>. The parameter
720            * <code>includeSpecifiedOrganization</code> is
721            * ignored unless <code>inheritSuborganizations</code> is also
722            * <code>true</code>.
723            * </li>
724            * <li>
725            * If <code>inheritSuborganizations=<code>true</code></code> and
726            * <code>includeSpecifiedOrganization=<code>false</code></code>: the method
727            * checks
728            * whether the user belongs to one of the child organizations of the one
729            * specified by <code>organizationId</code>.
730            * </li>
731            * <li>
732            * If <code>inheritSuborganizations=<code>true</code></code> and
733            * <code>includeSpecifiedOrganization=<code>true</code></code>: the method
734            * checks whether
735            * the user belongs to the organization specified by
736            * <code>organizationId</code> or any of
737            * its child organizations.
738            * </li>
739            * </ol>
740            *
741            * <p>
742            *
743            * @param userId the primary key of the organization's user
744            * @param organizationId the primary key of the organization
745            * @param inheritSuborganizations if <code>true</code> sub-organizations
746            are considered in the determination
747            * @param inheritUserGroups if <code>true</code> organizations inherited
748            from the user groups to which the user belongs are considered in
749            the determination
750            * @param includeSpecifiedOrganization if <code>true</code> the
751            organization specified by <code>organizationId</code> is
752            considered in the determination.
753            * @return <code>true</code> if the user has access to the organization;
754            <code>false</code> otherwise
755            * @throws PortalException if an organization with the primary key could not
756            be found
757            * @throws SystemException if a system exception occurred
758            * @see com.liferay.portal.service.persistence.OrganizationFinder
759            */
760            public static boolean hasUserOrganization(long userId, long organizationId,
761                    boolean inheritSuborganizations, boolean inheritUserGroups,
762                    boolean includeSpecifiedOrganization)
763                    throws com.liferay.portal.kernel.exception.PortalException,
764                            com.liferay.portal.kernel.exception.SystemException {
765                    return getService()
766                                       .hasUserOrganization(userId, organizationId,
767                            inheritSuborganizations, inheritUserGroups,
768                            includeSpecifiedOrganization);
769            }
770    
771            /**
772            * Rebuilds the organizations tree.
773            *
774            * <p>
775            * Only call this method if the tree has become stale through operations
776            * other than normal CRUD. Under normal circumstances the tree is
777            * automatically rebuilt whenever necessary.
778            * </p>
779            *
780            * @param companyId the primary key of the organization's company
781            * @throws SystemException if a system exception occurred
782            * @see com.liferay.portal.service.persistence.OrganizationPersistence#rebuildTree(
783            long, boolean)
784            */
785            public static void rebuildTree(long companyId)
786                    throws com.liferay.portal.kernel.exception.PortalException,
787                            com.liferay.portal.kernel.exception.SystemException {
788                    getService().rebuildTree(companyId);
789            }
790    
791            public static java.util.List<com.liferay.portal.model.Organization> search(
792                    long companyId,
793                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
794                    int start, int end)
795                    throws com.liferay.portal.kernel.exception.SystemException {
796                    return getService().search(companyId, params, start, end);
797            }
798    
799            /**
800            * Returns an ordered range of all the organizations that match the
801            * keywords, using the indexer. It is preferable to use this method instead
802            * of the non-indexed version whenever possible for performance reasons.
803            *
804            * <p>
805            * Useful when paginating results. Returns a maximum of <code>end -
806            * start</code> instances. <code>start</code> and <code>end</code> are not
807            * primary keys, they are indexes in the result set. Thus, <code>0</code>
808            * refers to the first result in the set. Setting both <code>start</code>
809            * and <code>end</code> to {@link
810            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
811            * result set.
812            * </p>
813            *
814            * @param companyId the primary key of the organization's company
815            * @param parentOrganizationId the primary key of the organization's parent
816            organization
817            * @param keywords the keywords (space separated), which may occur in the
818            organization's name, street, city, zipcode, type, region or
819            country (optionally <code>null</code>)
820            * @param params the finder parameters (optionally <code>null</code>). For
821            more information see {@link
822            com.liferay.portlet.enterpriseadmin.util.OrganizationIndexer}
823            * @param start the lower bound of the range of organizations to return
824            * @param end the upper bound of the range of organizations to return (not
825            inclusive)
826            * @param sort the field and direction by which to sort (optionally
827            <code>null</code>)
828            * @return the matching organizations ordered by name
829            * @throws SystemException if a system exception occurred
830            * @see com.liferay.portlet.enterpriseadmin.util.OrganizationIndexer
831            */
832            public static com.liferay.portal.kernel.search.Hits search(long companyId,
833                    long parentOrganizationId, java.lang.String keywords,
834                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
835                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
836                    throws com.liferay.portal.kernel.exception.SystemException {
837                    return getService()
838                                       .search(companyId, parentOrganizationId, keywords, params,
839                            start, end, sort);
840            }
841    
842            /**
843            * Returns a name ordered range of all the organizations that match the
844            * keywords, type, region, and country, without using the indexer. It is
845            * preferable to use the indexed version {@link #search(long, long, String,
846            * LinkedHashMap, int, int, Sort)} instead of this method wherever possible
847            * for performance reasons.
848            *
849            * <p>
850            * Useful when paginating results. Returns a maximum of <code>end -
851            * start</code> instances. <code>start</code> and <code>end</code> are not
852            * primary keys, they are indexes in the result set. Thus, <code>0</code>
853            * refers to the first result in the set. Setting both <code>start</code>
854            * and <code>end</code> to {@link
855            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
856            * result set.
857            * </p>
858            *
859            * @param companyId the primary key of the organization's company
860            * @param parentOrganizationId the primary key of the organization's parent
861            organization
862            * @param keywords the keywords (space separated), which may occur in the
863            organization's name, street, city, or zipcode (optionally
864            <code>null</code>)
865            * @param type the organization's type (optionally <code>null</code>)
866            * @param regionId the primary key of the organization's region (optionally
867            <code>null</code>)
868            * @param countryId the primary key of the organization's country
869            (optionally <code>null</code>)
870            * @param params the finder params. For more information see {@link
871            com.liferay.portal.service.persistence.OrganizationFinder}
872            * @param start the lower bound of the range of organizations to return
873            * @param end the upper bound of the range of organizations to return (not
874            inclusive)
875            * @return the matching organizations ordered by name
876            * @throws SystemException if a system exception occurred
877            * @see com.liferay.portal.service.persistence.OrganizationFinder
878            */
879            public static java.util.List<com.liferay.portal.model.Organization> search(
880                    long companyId, long parentOrganizationId, java.lang.String keywords,
881                    java.lang.String type, java.lang.Long regionId,
882                    java.lang.Long countryId,
883                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
884                    int start, int end)
885                    throws com.liferay.portal.kernel.exception.SystemException {
886                    return getService()
887                                       .search(companyId, parentOrganizationId, keywords, type,
888                            regionId, countryId, params, start, end);
889            }
890    
891            /**
892            * Returns an ordered range of all the organizations that match the
893            * keywords, type, region, and country, without using the indexer. It is
894            * preferable to use the indexed version {@link #search(long, long, String,
895            * String, String, String, String, String, String, LinkedHashMap, boolean,
896            * int, int, Sort)} instead of this method wherever possible for performance
897            * reasons.
898            *
899            * <p>
900            * Useful when paginating results. Returns a maximum of <code>end -
901            * start</code> instances. <code>start</code> and <code>end</code> are not
902            * primary keys, they are indexes in the result set. Thus, <code>0</code>
903            * refers to the first result in the set. Setting both <code>start</code>
904            * and <code>end</code> to {@link
905            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
906            * result set.
907            * </p>
908            *
909            * @param companyId the primary key of the organization's company
910            * @param parentOrganizationId the primary key of the organization's parent
911            organization
912            * @param keywords the keywords (space separated), which may occur in the
913            organization's name, street, city, or zipcode (optionally
914            <code>null</code>)
915            * @param type the organization's type (optionally <code>null</code>)
916            * @param regionId the primary key of the organization's region (optionally
917            <code>null</code>)
918            * @param countryId the primary key of the organization's country
919            (optionally <code>null</code>)
920            * @param params the finder params. For more information see {@link
921            com.liferay.portal.service.persistence.OrganizationFinder}
922            * @param start the lower bound of the range of organizations to return
923            * @param end the upper bound of the range of organizations to return (not
924            inclusive)
925            * @param obc the comparator to order the organizations (optionally
926            <code>null</code>)
927            * @return the matching organizations ordered by comparator <code>obc</code>
928            * @throws SystemException if a system exception occurred
929            * @see com.liferay.portal.service.persistence.OrganizationFinder
930            */
931            public static java.util.List<com.liferay.portal.model.Organization> search(
932                    long companyId, long parentOrganizationId, java.lang.String keywords,
933                    java.lang.String type, java.lang.Long regionId,
934                    java.lang.Long countryId,
935                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
936                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
937                    throws com.liferay.portal.kernel.exception.SystemException {
938                    return getService()
939                                       .search(companyId, parentOrganizationId, keywords, type,
940                            regionId, countryId, params, start, end, obc);
941            }
942    
943            /**
944            * Returns a name ordered range of all the organizations with the type,
945            * region, and country, and whose name, street, city, and zipcode match the
946            * keywords specified for them, without using the indexer. It is preferable
947            * to use the indexed version {@link #search(long, long, String, String,
948            * String, String, String, String, String, LinkedHashMap, boolean, int, int,
949            * Sort)} instead of this method wherever possible for performance reasons.
950            *
951            * <p>
952            * Useful when paginating results. Returns a maximum of <code>end -
953            * start</code> instances. <code>start</code> and <code>end</code> are not
954            * primary keys, they are indexes in the result set. Thus, <code>0</code>
955            * refers to the first result in the set. Setting both <code>start</code>
956            * and <code>end</code> to {@link
957            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
958            * result set.
959            * </p>
960            *
961            * @param companyId the primary key of the organization's company
962            * @param parentOrganizationId the primary key of the organization's parent
963            * @param name the name keywords (space separated, optionally
964            <code>null</code>)
965            * @param type the organization's type (optionally <code>null</code>)
966            * @param street the street keywords (optionally <code>null</code>)
967            * @param city the city keywords (optionally <code>null</code>)
968            * @param zip the zipcode keywords (optionally <code>null</code>)
969            * @param regionId the primary key of the organization's region (optionally
970            <code>null</code>)
971            * @param countryId the primary key of the organization's country
972            (optionally <code>null</code>)
973            * @param params the finder parameters (optionally <code>null</code>). For
974            more information see {@link
975            com.liferay.portal.service.persistence.OrganizationFinder}
976            * @param andOperator whether every field must match its keywords, or just
977            one field. For example, &quot;organizations with the name
978            'Employees' and city 'Chicago'&quot; vs &quot;organizations with
979            the name 'Employees' or the city 'Chicago'&quot;.
980            * @param start the lower bound of the range of organizations to return
981            * @param end the upper bound of the range of organizations to return (not
982            inclusive)
983            * @return the matching organizations ordered by name
984            * @throws SystemException if a system exception occurred
985            * @see com.liferay.portal.service.persistence.OrganizationFinder
986            */
987            public static java.util.List<com.liferay.portal.model.Organization> search(
988                    long companyId, long parentOrganizationId, java.lang.String name,
989                    java.lang.String type, java.lang.String street, java.lang.String city,
990                    java.lang.String zip, java.lang.Long regionId,
991                    java.lang.Long countryId,
992                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
993                    boolean andOperator, int start, int end)
994                    throws com.liferay.portal.kernel.exception.SystemException {
995                    return getService()
996                                       .search(companyId, parentOrganizationId, name, type, street,
997                            city, zip, regionId, countryId, params, andOperator, start, end);
998            }
999    
1000            /**
1001            * Returns an ordered range of all the organizations with the type, region,
1002            * and country, and whose name, street, city, and zipcode match the keywords
1003            * specified for them, without using the indexer. It is preferable to use
1004            * the indexed version {@link #search(long, long, String, String, String,
1005            * String, String, String, String, LinkedHashMap, boolean, int, int, Sort)}
1006            * instead of this method wherever possible for performance reasons.
1007            *
1008            * <p>
1009            * Useful when paginating results. Returns a maximum of <code>end -
1010            * start</code> instances. <code>start</code> and <code>end</code> are not
1011            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1012            * refers to the first result in the set. Setting both <code>start</code>
1013            * and <code>end</code> to {@link
1014            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1015            * result set.
1016            * </p>
1017            *
1018            * @param companyId the primary key of the organization's company
1019            * @param parentOrganizationId the primary key of the organization's parent
1020            organization
1021            * @param name the name keywords (space separated, optionally
1022            <code>null</code>)
1023            * @param type the organization's type (optionally <code>null</code>)
1024            * @param street the street keywords (optionally <code>null</code>)
1025            * @param city the city keywords (optionally <code>null</code>)
1026            * @param zip the zipcode keywords (optionally <code>null</code>)
1027            * @param regionId the primary key of the organization's region (optionally
1028            <code>null</code>)
1029            * @param countryId the primary key of the organization's country
1030            (optionally <code>null</code>)
1031            * @param params the finder parameters (optionally <code>null</code>). For
1032            more information see {@link
1033            com.liferay.portal.service.persistence.OrganizationFinder}
1034            * @param andOperator whether every field must match its keywords, or just
1035            one field. For example, &quot;organizations with the name
1036            'Employees' and city 'Chicago'&quot; vs &quot;organizations with
1037            the name 'Employees' or the city 'Chicago'&quot;.
1038            * @param start the lower bound of the range of organizations to return
1039            * @param end the upper bound of the range of organizations to return (not
1040            inclusive)
1041            * @param obc the comparator to order the organizations (optionally
1042            <code>null</code>)
1043            * @return the matching organizations ordered by comparator <code>obc</code>
1044            * @throws SystemException if a system exception occurred
1045            * @see com.liferay.portal.service.persistence.OrganizationFinder
1046            */
1047            public static java.util.List<com.liferay.portal.model.Organization> search(
1048                    long companyId, long parentOrganizationId, java.lang.String name,
1049                    java.lang.String type, java.lang.String street, java.lang.String city,
1050                    java.lang.String zip, java.lang.Long regionId,
1051                    java.lang.Long countryId,
1052                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1053                    boolean andOperator, int start, int end,
1054                    com.liferay.portal.kernel.util.OrderByComparator obc)
1055                    throws com.liferay.portal.kernel.exception.SystemException {
1056                    return getService()
1057                                       .search(companyId, parentOrganizationId, name, type, street,
1058                            city, zip, regionId, countryId, params, andOperator, start, end, obc);
1059            }
1060    
1061            /**
1062            * Returns an ordered range of all the organizations whose name, type, or
1063            * location fields match the keywords specified for them, using the indexer.
1064            * It is preferable to use this method instead of the non-indexed version
1065            * whenever possible for performance reasons.
1066            *
1067            * <p>
1068            * Useful when paginating results. Returns a maximum of <code>end -
1069            * start</code> instances. <code>start</code> and <code>end</code> are not
1070            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1071            * refers to the first result in the set. Setting both <code>start</code>
1072            * and <code>end</code> to {@link
1073            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1074            * result set.
1075            * </p>
1076            *
1077            * @param companyId the primary key of the organization's company
1078            * @param parentOrganizationId the primary key of the organization's parent
1079            organization
1080            * @param name the name keywords (space separated, optionally
1081            <code>null</code>)
1082            * @param type the type keywords (optionally <code>null</code>)
1083            * @param street the street keywords (optionally <code>null</code>)
1084            * @param city the city keywords (optionally <code>null</code>)
1085            * @param zip the zipcode keywords (optionally <code>null</code>)
1086            * @param region the region keywords (optionally <code>null</code>)
1087            * @param country the country keywords (optionally <code>null</code>)
1088            * @param params the finder parameters (optionally <code>null</code>). For
1089            more information see {@link
1090            com.liferay.portlet.enterpriseadmin.util.OrganizationIndexer}.
1091            * @param andSearch whether every field must match its keywords or just one
1092            field.
1093            * @param start the lower bound of the range of organizations to return
1094            * @param end the upper bound of the range of organizations to return (not
1095            inclusive)
1096            * @param sort the field and direction by which to sort (optionally
1097            <code>null</code>)
1098            * @return the matching organizations ordered by <code>sort</code>
1099            * @throws SystemException if a system exception occurred
1100            * @see com.liferay.portlet.enterpriseadmin.util.OrganizationIndexer
1101            */
1102            public static com.liferay.portal.kernel.search.Hits search(long companyId,
1103                    long parentOrganizationId, java.lang.String name,
1104                    java.lang.String type, java.lang.String street, java.lang.String city,
1105                    java.lang.String zip, java.lang.String region,
1106                    java.lang.String country,
1107                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1108                    boolean andSearch, int start, int end,
1109                    com.liferay.portal.kernel.search.Sort sort)
1110                    throws com.liferay.portal.kernel.exception.SystemException {
1111                    return getService()
1112                                       .search(companyId, parentOrganizationId, name, type, street,
1113                            city, zip, region, country, params, andSearch, start, end, sort);
1114            }
1115    
1116            /**
1117            * Returns the number of organizations that match the keywords, type,
1118            * region, and country.
1119            *
1120            * @param companyId the primary key of the organization's company
1121            * @param parentOrganizationId the primary key of the organization's parent
1122            organization
1123            * @param keywords the keywords (space separated), which may occur in the
1124            organization's name, street, city, or zipcode (optionally
1125            <code>null</code>)
1126            * @param type the organization's type (optionally <code>null</code>)
1127            * @param regionId the primary key of the organization's region (optionally
1128            <code>null</code>)
1129            * @param countryId the primary key of the organization's country
1130            (optionally <code>null</code>)
1131            * @param params the finder parameters (optionally <code>null</code>). For
1132            more information see {@link
1133            com.liferay.portal.service.persistence.OrganizationFinder}
1134            * @return the number of matching organizations
1135            * @throws SystemException if a system exception occurred
1136            * @see com.liferay.portal.service.persistence.OrganizationFinder
1137            */
1138            public static int searchCount(long companyId, long parentOrganizationId,
1139                    java.lang.String keywords, java.lang.String type,
1140                    java.lang.Long regionId, java.lang.Long countryId,
1141                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1142                    throws com.liferay.portal.kernel.exception.SystemException {
1143                    return getService()
1144                                       .searchCount(companyId, parentOrganizationId, keywords,
1145                            type, regionId, countryId, params);
1146            }
1147    
1148            /**
1149            * Returns the number of organizations with the type, region, and country,
1150            * and whose name, street, city, and zipcode match the keywords specified
1151            * for them.
1152            *
1153            * @param companyId the primary key of the organization's company
1154            * @param parentOrganizationId the primary key of the organization's parent
1155            organization
1156            * @param name the name keywords (space separated, optionally
1157            <code>null</code>)
1158            * @param type the organization's type (optionally <code>null</code>)
1159            * @param street the street keywords (optionally <code>null</code>)
1160            * @param city the city keywords (optionally <code>null</code>)
1161            * @param zip the zipcode keywords (optionally <code>null</code>)
1162            * @param regionId the primary key of the organization's region (optionally
1163            <code>null</code>)
1164            * @param countryId the primary key of the organization's country
1165            (optionally <code>null</code>)
1166            * @param params the finder parameters (optionally <code>null</code>). For
1167            more information see {@link
1168            com.liferay.portal.service.persistence.OrganizationFinder}
1169            * @param andOperator whether every field must match its keywords, or just
1170            one field. For example, &quot;organizations with the name
1171            'Employees' and city 'Chicago'&quot; vs &quot;organizations with
1172            the name 'Employees' or the city 'Chicago'&quot;.
1173            * @return the number of matching organizations
1174            * @throws SystemException if a system exception occurred
1175            * @see com.liferay.portal.service.persistence.OrganizationFinder
1176            */
1177            public static int searchCount(long companyId, long parentOrganizationId,
1178                    java.lang.String name, java.lang.String type, java.lang.String street,
1179                    java.lang.String city, java.lang.String zip, java.lang.Long regionId,
1180                    java.lang.Long countryId,
1181                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1182                    boolean andOperator)
1183                    throws com.liferay.portal.kernel.exception.SystemException {
1184                    return getService()
1185                                       .searchCount(companyId, parentOrganizationId, name, type,
1186                            street, city, zip, regionId, countryId, params, andOperator);
1187            }
1188    
1189            /**
1190            * Sets the organizations in the group, removing and adding organizations to
1191            * the group as necessary.
1192            *
1193            * @param groupId the primary key of the group
1194            * @param organizationIds the primary keys of the organizations
1195            * @throws PortalException if a portal exception occurred
1196            * @throws SystemException if a system exception occurred
1197            */
1198            public static void setGroupOrganizations(long groupId,
1199                    long[] organizationIds)
1200                    throws com.liferay.portal.kernel.exception.PortalException,
1201                            com.liferay.portal.kernel.exception.SystemException {
1202                    getService().setGroupOrganizations(groupId, organizationIds);
1203            }
1204    
1205            /**
1206            * Removes the organizations from the group.
1207            *
1208            * @param groupId the primary key of the group
1209            * @param organizationIds the primary keys of the organizations
1210            * @throws PortalException if a portal exception occurred
1211            * @throws SystemException if a system exception occurred
1212            */
1213            public static void unsetGroupOrganizations(long groupId,
1214                    long[] organizationIds)
1215                    throws com.liferay.portal.kernel.exception.PortalException,
1216                            com.liferay.portal.kernel.exception.SystemException {
1217                    getService().unsetGroupOrganizations(groupId, organizationIds);
1218            }
1219    
1220            /**
1221            * Removes the organizations from the password policy.
1222            *
1223            * @param passwordPolicyId the primary key of the password policy
1224            * @param organizationIds the primary keys of the organizations
1225            * @throws SystemException if a system exception occurred
1226            */
1227            public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
1228                    long[] organizationIds)
1229                    throws com.liferay.portal.kernel.exception.SystemException {
1230                    getService()
1231                            .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
1232            }
1233    
1234            /**
1235            * Updates the organization's asset with the new asset categories and tag
1236            * names, removing and adding asset categories and tag names as necessary.
1237            *
1238            * @param userId the primary key of the user
1239            * @param organization the organization
1240            * @param assetCategoryIds the primary keys of the asset categories
1241            * @param assetTagNames the asset tag names
1242            * @throws PortalException if a user with the primary key could not be found
1243            * @throws SystemException if a system exception occurred
1244            */
1245            public static void updateAsset(long userId,
1246                    com.liferay.portal.model.Organization organization,
1247                    long[] assetCategoryIds, java.lang.String[] assetTagNames)
1248                    throws com.liferay.portal.kernel.exception.PortalException,
1249                            com.liferay.portal.kernel.exception.SystemException {
1250                    getService()
1251                            .updateAsset(userId, organization, assetCategoryIds, assetTagNames);
1252            }
1253    
1254            /**
1255            * Updates the organization.
1256            *
1257            * @param companyId the primary key of the organization's company
1258            * @param organizationId the primary key of the organization
1259            * @param parentOrganizationId the primary key of organization's parent
1260            organization
1261            * @param name the organization's name
1262            * @param type the organization's type
1263            * @param recursable whether permissions of the organization are to be
1264            inherited by its sub-organizations
1265            * @param regionId the primary key of the organization's region
1266            * @param countryId the primary key of the organization's country
1267            * @param statusId the organization's workflow status
1268            * @param comments the comments about the organization
1269            * @param site whether the organization is to be associated with a main
1270            site
1271            * @param serviceContext the organization's service context (optionally
1272            <code>null</code>). Can specify the organization's replacement
1273            asset category IDs, replacement asset tag names, and new expando
1274            bridge attributes.
1275            * @return the organization
1276            * @throws PortalException if an organization or parent organization with
1277            the primary key could not be found or if the new information was
1278            invalid
1279            * @throws SystemException if a system exception occurred
1280            */
1281            public static com.liferay.portal.model.Organization updateOrganization(
1282                    long companyId, long organizationId, long parentOrganizationId,
1283                    java.lang.String name, java.lang.String type, boolean recursable,
1284                    long regionId, long countryId, int statusId, java.lang.String comments,
1285                    boolean site, com.liferay.portal.service.ServiceContext serviceContext)
1286                    throws com.liferay.portal.kernel.exception.PortalException,
1287                            com.liferay.portal.kernel.exception.SystemException {
1288                    return getService()
1289                                       .updateOrganization(companyId, organizationId,
1290                            parentOrganizationId, name, type, recursable, regionId, countryId,
1291                            statusId, comments, site, serviceContext);
1292            }
1293    
1294            public static OrganizationLocalService getService() {
1295                    if (_service == null) {
1296                            _service = (OrganizationLocalService)PortalBeanLocatorUtil.locate(OrganizationLocalService.class.getName());
1297    
1298                            ReferenceRegistry.registerReference(OrganizationLocalServiceUtil.class,
1299                                    "_service");
1300                            MethodCache.remove(OrganizationLocalService.class);
1301                    }
1302    
1303                    return _service;
1304            }
1305    
1306            public void setService(OrganizationLocalService service) {
1307                    MethodCache.remove(OrganizationLocalService.class);
1308    
1309                    _service = service;
1310    
1311                    ReferenceRegistry.registerReference(OrganizationLocalServiceUtil.class,
1312                            "_service");
1313                    MethodCache.remove(OrganizationLocalService.class);
1314            }
1315    
1316            private static OrganizationLocalService _service;
1317    }