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