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