001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * The utility for the organization 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            * @throws SystemException if a system exception occurred
241            */
242            public static void addGroupOrganization(long groupId, long organizationId)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    getService().addGroupOrganization(groupId, organizationId);
245            }
246    
247            /**
248            * @throws SystemException if a system exception occurred
249            */
250            public static void addGroupOrganization(long groupId,
251                    com.liferay.portal.model.Organization organization)
252                    throws com.liferay.portal.kernel.exception.SystemException {
253                    getService().addGroupOrganization(groupId, organization);
254            }
255    
256            /**
257            * @throws PortalException
258            * @throws SystemException if a system exception occurred
259            */
260            public static void addGroupOrganizations(long groupId,
261                    long[] organizationIds)
262                    throws com.liferay.portal.kernel.exception.PortalException,
263                            com.liferay.portal.kernel.exception.SystemException {
264                    getService().addGroupOrganizations(groupId, organizationIds);
265            }
266    
267            /**
268            * @throws PortalException
269            * @throws SystemException if a system exception occurred
270            */
271            public static void addGroupOrganizations(long groupId,
272                    java.util.List<com.liferay.portal.model.Organization> Organizations)
273                    throws com.liferay.portal.kernel.exception.PortalException,
274                            com.liferay.portal.kernel.exception.SystemException {
275                    getService().addGroupOrganizations(groupId, Organizations);
276            }
277    
278            /**
279            * @throws SystemException if a system exception occurred
280            */
281            public static void clearGroupOrganizations(long groupId)
282                    throws com.liferay.portal.kernel.exception.SystemException {
283                    getService().clearGroupOrganizations(groupId);
284            }
285    
286            /**
287            * @throws SystemException if a system exception occurred
288            */
289            public static void deleteGroupOrganization(long groupId, long organizationId)
290                    throws com.liferay.portal.kernel.exception.SystemException {
291                    getService().deleteGroupOrganization(groupId, organizationId);
292            }
293    
294            /**
295            * @throws SystemException if a system exception occurred
296            */
297            public static void deleteGroupOrganization(long groupId,
298                    com.liferay.portal.model.Organization organization)
299                    throws com.liferay.portal.kernel.exception.SystemException {
300                    getService().deleteGroupOrganization(groupId, organization);
301            }
302    
303            /**
304            * @throws SystemException if a system exception occurred
305            */
306            public static void deleteGroupOrganizations(long groupId,
307                    long[] organizationIds)
308                    throws com.liferay.portal.kernel.exception.SystemException {
309                    getService().deleteGroupOrganizations(groupId, organizationIds);
310            }
311    
312            /**
313            * @throws SystemException if a system exception occurred
314            */
315            public static void deleteGroupOrganizations(long groupId,
316                    java.util.List<com.liferay.portal.model.Organization> Organizations)
317                    throws com.liferay.portal.kernel.exception.SystemException {
318                    getService().deleteGroupOrganizations(groupId, Organizations);
319            }
320    
321            /**
322            * @throws SystemException if a system exception occurred
323            */
324            public static java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations(
325                    long groupId)
326                    throws com.liferay.portal.kernel.exception.SystemException {
327                    return getService().getGroupOrganizations(groupId);
328            }
329    
330            /**
331            * @throws SystemException if a system exception occurred
332            */
333            public static java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations(
334                    long groupId, int start, int end)
335                    throws com.liferay.portal.kernel.exception.SystemException {
336                    return getService().getGroupOrganizations(groupId, start, end);
337            }
338    
339            /**
340            * @throws SystemException if a system exception occurred
341            */
342            public static java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations(
343                    long groupId, int start, int end,
344                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
345                    throws com.liferay.portal.kernel.exception.SystemException {
346                    return getService()
347                                       .getGroupOrganizations(groupId, start, end, orderByComparator);
348            }
349    
350            /**
351            * @throws SystemException if a system exception occurred
352            */
353            public static int getGroupOrganizationsCount(long groupId)
354                    throws com.liferay.portal.kernel.exception.SystemException {
355                    return getService().getGroupOrganizationsCount(groupId);
356            }
357    
358            /**
359            * @throws SystemException if a system exception occurred
360            */
361            public static boolean hasGroupOrganization(long groupId, long organizationId)
362                    throws com.liferay.portal.kernel.exception.SystemException {
363                    return getService().hasGroupOrganization(groupId, organizationId);
364            }
365    
366            /**
367            * @throws SystemException if a system exception occurred
368            */
369            public static boolean hasGroupOrganizations(long groupId)
370                    throws com.liferay.portal.kernel.exception.SystemException {
371                    return getService().hasGroupOrganizations(groupId);
372            }
373    
374            /**
375            * @throws PortalException
376            * @throws SystemException if a system exception occurred
377            */
378            public static void setGroupOrganizations(long groupId,
379                    long[] organizationIds)
380                    throws com.liferay.portal.kernel.exception.PortalException,
381                            com.liferay.portal.kernel.exception.SystemException {
382                    getService().setGroupOrganizations(groupId, organizationIds);
383            }
384    
385            /**
386            * @throws SystemException if a system exception occurred
387            */
388            public static void addUserOrganization(long userId, long organizationId)
389                    throws com.liferay.portal.kernel.exception.SystemException {
390                    getService().addUserOrganization(userId, organizationId);
391            }
392    
393            /**
394            * @throws SystemException if a system exception occurred
395            */
396            public static void addUserOrganization(long userId,
397                    com.liferay.portal.model.Organization organization)
398                    throws com.liferay.portal.kernel.exception.SystemException {
399                    getService().addUserOrganization(userId, organization);
400            }
401    
402            /**
403            * @throws SystemException if a system exception occurred
404            */
405            public static void addUserOrganizations(long userId, long[] organizationIds)
406                    throws com.liferay.portal.kernel.exception.SystemException {
407                    getService().addUserOrganizations(userId, organizationIds);
408            }
409    
410            /**
411            * @throws SystemException if a system exception occurred
412            */
413            public static void addUserOrganizations(long userId,
414                    java.util.List<com.liferay.portal.model.Organization> Organizations)
415                    throws com.liferay.portal.kernel.exception.SystemException {
416                    getService().addUserOrganizations(userId, Organizations);
417            }
418    
419            /**
420            * @throws SystemException if a system exception occurred
421            */
422            public static void clearUserOrganizations(long userId)
423                    throws com.liferay.portal.kernel.exception.SystemException {
424                    getService().clearUserOrganizations(userId);
425            }
426    
427            /**
428            * @throws SystemException if a system exception occurred
429            */
430            public static void deleteUserOrganization(long userId, long organizationId)
431                    throws com.liferay.portal.kernel.exception.SystemException {
432                    getService().deleteUserOrganization(userId, organizationId);
433            }
434    
435            /**
436            * @throws SystemException if a system exception occurred
437            */
438            public static void deleteUserOrganization(long userId,
439                    com.liferay.portal.model.Organization organization)
440                    throws com.liferay.portal.kernel.exception.SystemException {
441                    getService().deleteUserOrganization(userId, organization);
442            }
443    
444            /**
445            * @throws SystemException if a system exception occurred
446            */
447            public static void deleteUserOrganizations(long userId,
448                    long[] organizationIds)
449                    throws com.liferay.portal.kernel.exception.SystemException {
450                    getService().deleteUserOrganizations(userId, organizationIds);
451            }
452    
453            /**
454            * @throws SystemException if a system exception occurred
455            */
456            public static void deleteUserOrganizations(long userId,
457                    java.util.List<com.liferay.portal.model.Organization> Organizations)
458                    throws com.liferay.portal.kernel.exception.SystemException {
459                    getService().deleteUserOrganizations(userId, Organizations);
460            }
461    
462            /**
463            * @throws SystemException if a system exception occurred
464            */
465            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
466                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
467                    return getService().getUserOrganizations(userId);
468            }
469    
470            /**
471            * @throws SystemException if a system exception occurred
472            */
473            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
474                    long userId, int start, int end)
475                    throws com.liferay.portal.kernel.exception.SystemException {
476                    return getService().getUserOrganizations(userId, start, end);
477            }
478    
479            /**
480            * @throws SystemException if a system exception occurred
481            */
482            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
483                    long userId, int start, int end,
484                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
485                    throws com.liferay.portal.kernel.exception.SystemException {
486                    return getService()
487                                       .getUserOrganizations(userId, start, end, orderByComparator);
488            }
489    
490            /**
491            * @throws SystemException if a system exception occurred
492            */
493            public static int getUserOrganizationsCount(long userId)
494                    throws com.liferay.portal.kernel.exception.SystemException {
495                    return getService().getUserOrganizationsCount(userId);
496            }
497    
498            /**
499            * @throws SystemException if a system exception occurred
500            */
501            public static boolean hasUserOrganization(long userId, long organizationId)
502                    throws com.liferay.portal.kernel.exception.SystemException {
503                    return getService().hasUserOrganization(userId, organizationId);
504            }
505    
506            /**
507            * @throws SystemException if a system exception occurred
508            */
509            public static boolean hasUserOrganizations(long userId)
510                    throws com.liferay.portal.kernel.exception.SystemException {
511                    return getService().hasUserOrganizations(userId);
512            }
513    
514            /**
515            * @throws SystemException if a system exception occurred
516            */
517            public static void setUserOrganizations(long userId, long[] organizationIds)
518                    throws com.liferay.portal.kernel.exception.SystemException {
519                    getService().setUserOrganizations(userId, organizationIds);
520            }
521    
522            /**
523            * Returns the Spring bean ID for this bean.
524            *
525            * @return the Spring bean ID for this bean
526            */
527            public static java.lang.String getBeanIdentifier() {
528                    return getService().getBeanIdentifier();
529            }
530    
531            /**
532            * Sets the Spring bean ID for this bean.
533            *
534            * @param beanIdentifier the Spring bean ID for this bean
535            */
536            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
537                    getService().setBeanIdentifier(beanIdentifier);
538            }
539    
540            /**
541            * Adds an organization.
542            *
543            * <p>
544            * This method handles the creation and bookkeeping of the organization
545            * including its resources, metadata, and internal data structures. It is
546            * not necessary to make a subsequent call to {@link
547            * #addOrganizationResources(long, Organization)}.
548            * </p>
549            *
550            * @param userId the primary key of the creator/owner of the organization
551            * @param parentOrganizationId the primary key of the organization's parent
552            organization
553            * @param name the organization's name
554            * @param site whether the organization is to be associated with a main
555            site
556            * @return the organization
557            * @throws PortalException if a creator or parent organization with the
558            primary key could not be found or if the organization's
559            information was invalid
560            * @throws SystemException if a system exception occurred
561            */
562            public static com.liferay.portal.model.Organization addOrganization(
563                    long userId, long parentOrganizationId, java.lang.String name,
564                    boolean site)
565                    throws com.liferay.portal.kernel.exception.PortalException,
566                            com.liferay.portal.kernel.exception.SystemException {
567                    return getService()
568                                       .addOrganization(userId, parentOrganizationId, name, site);
569            }
570    
571            /**
572            * Adds an organization.
573            *
574            * <p>
575            * This method handles the creation and bookkeeping of the organization
576            * including its resources, metadata, and internal data structures. It is
577            * not necessary to make a subsequent call to {@link
578            * #addOrganizationResources(long, Organization)}.
579            * </p>
580            *
581            * @param userId the primary key of the creator/owner of the
582            organization
583            * @param parentOrganizationId the primary key of the organization's
584            parent organization
585            * @param name the organization's name
586            * @param type the organization's type
587            * @param recursable whether the permissions of the organization are to
588            be inherited by its suborganizations
589            * @param regionId the primary key of the organization's region
590            * @param countryId the primary key of the organization's country
591            * @param statusId the organization's workflow status
592            * @param comments the comments about the organization
593            * @param site whether the organization is to be associated with a main
594            site
595            * @param serviceContext the service context to be applied (optionally
596            <code>null</code>). Can set asset category IDs, asset tag
597            names, and expando bridge attributes for the organization.
598            * @return the organization
599            * @throws PortalException if a creator or parent organization with the
600            primary key could not be found or if the organization's
601            information was invalid
602            * @throws SystemException if a system exception occurred
603            * @deprecated As of 6.2.0, replaced by {@link #addOrganization(long, long,
604            String, String, long, long, int, String, boolean,
605            ServiceContext)}
606            */
607            public static com.liferay.portal.model.Organization addOrganization(
608                    long userId, long parentOrganizationId, java.lang.String name,
609                    java.lang.String type, boolean recursable, long regionId,
610                    long countryId, int statusId, java.lang.String comments, boolean site,
611                    com.liferay.portal.service.ServiceContext serviceContext)
612                    throws com.liferay.portal.kernel.exception.PortalException,
613                            com.liferay.portal.kernel.exception.SystemException {
614                    return getService()
615                                       .addOrganization(userId, parentOrganizationId, name, type,
616                            recursable, regionId, countryId, statusId, comments, site,
617                            serviceContext);
618            }
619    
620            /**
621            * Adds an organization.
622            *
623            * <p>
624            * This method handles the creation and bookkeeping of the organization
625            * including its resources, metadata, and internal data structures. It is
626            * not necessary to make a subsequent call to {@link
627            * #addOrganizationResources(long, Organization)}.
628            * </p>
629            *
630            * @param userId the primary key of the creator/owner of the organization
631            * @param parentOrganizationId the primary key of the organization's parent
632            organization
633            * @param name the organization's name
634            * @param type the organization's type
635            * @param regionId the primary key of the organization's region
636            * @param countryId the primary key of the organization's country
637            * @param statusId the organization's workflow status
638            * @param comments the comments about the organization
639            * @param site whether the organization is to be associated with a main
640            site
641            * @param serviceContext the service context to be applied (optionally
642            <code>null</code>). Can set asset category IDs, asset tag names,
643            and expando bridge attributes for the organization.
644            * @return the organization
645            * @throws PortalException if a creator or parent organization with the
646            primary key could not be found or if the organization's
647            information was invalid
648            * @throws SystemException if a system exception occurred
649            */
650            public static com.liferay.portal.model.Organization addOrganization(
651                    long userId, long parentOrganizationId, java.lang.String name,
652                    java.lang.String type, long regionId, long countryId, int statusId,
653                    java.lang.String comments, boolean site,
654                    com.liferay.portal.service.ServiceContext serviceContext)
655                    throws com.liferay.portal.kernel.exception.PortalException,
656                            com.liferay.portal.kernel.exception.SystemException {
657                    return getService()
658                                       .addOrganization(userId, parentOrganizationId, name, type,
659                            regionId, countryId, statusId, comments, site, serviceContext);
660            }
661    
662            /**
663            * Adds a resource for each type of permission available on the
664            * organization.
665            *
666            * @param userId the primary key of the creator/owner of the organization
667            * @param organization the organization
668            * @throws PortalException if a portal exception occurred
669            * @throws SystemException if a system exception occurred
670            */
671            public static void addOrganizationResources(long userId,
672                    com.liferay.portal.model.Organization organization)
673                    throws com.liferay.portal.kernel.exception.PortalException,
674                            com.liferay.portal.kernel.exception.SystemException {
675                    getService().addOrganizationResources(userId, organization);
676            }
677    
678            /**
679            * Assigns the password policy to the organizations, removing any other
680            * currently assigned password policies.
681            *
682            * @param passwordPolicyId the primary key of the password policy
683            * @param organizationIds the primary keys of the organizations
684            * @throws SystemException if a system exception occurred
685            */
686            public static void addPasswordPolicyOrganizations(long passwordPolicyId,
687                    long[] organizationIds)
688                    throws com.liferay.portal.kernel.exception.SystemException {
689                    getService()
690                            .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
691            }
692    
693            /**
694            * Deletes the logo of the organization.
695            *
696            * @param organizationId the primary key of the organization
697            * @throws PortalException if an organization or parent organization with
698            the primary key could not be found or if the organization's logo
699            could not be found
700            * @throws SystemException if a system exception occurred
701            */
702            public static void deleteLogo(long organizationId)
703                    throws com.liferay.portal.kernel.exception.PortalException,
704                            com.liferay.portal.kernel.exception.SystemException {
705                    getService().deleteLogo(organizationId);
706            }
707    
708            public static com.liferay.portal.model.Organization fetchOrganization(
709                    long companyId, java.lang.String name)
710                    throws com.liferay.portal.kernel.exception.SystemException {
711                    return getService().fetchOrganization(companyId, name);
712            }
713    
714            public static com.liferay.portal.model.Organization fetchOrganizationByUuidAndCompanyId(
715                    java.lang.String uuid, long companyId)
716                    throws com.liferay.portal.kernel.exception.SystemException {
717                    return getService().fetchOrganizationByUuidAndCompanyId(uuid, companyId);
718            }
719    
720            /**
721            * Returns the organization with the name.
722            *
723            * @param companyId the primary key of the organization's company
724            * @param name the organization's name
725            * @return the organization with the name
726            * @throws PortalException if the organization with the name could not be
727            found
728            * @throws SystemException if a system exception occurred
729            */
730            public static com.liferay.portal.model.Organization getOrganization(
731                    long companyId, java.lang.String name)
732                    throws com.liferay.portal.kernel.exception.PortalException,
733                            com.liferay.portal.kernel.exception.SystemException {
734                    return getService().getOrganization(companyId, name);
735            }
736    
737            /**
738            * Returns the primary key of the organization with the name.
739            *
740            * @param companyId the primary key of the organization's company
741            * @param name the organization's name
742            * @return the primary key of the organization with the name, or
743            <code>0</code> if the organization could not be found
744            * @throws SystemException if a system exception occurred
745            */
746            public static long getOrganizationId(long companyId, java.lang.String name)
747                    throws com.liferay.portal.kernel.exception.SystemException {
748                    return getService().getOrganizationId(companyId, name);
749            }
750    
751            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
752                    long userId, int start, int end,
753                    com.liferay.portal.kernel.util.OrderByComparator obc)
754                    throws com.liferay.portal.kernel.exception.PortalException,
755                            com.liferay.portal.kernel.exception.SystemException {
756                    return getService().getOrganizations(userId, start, end, obc);
757            }
758    
759            /**
760            * Returns all the organizations belonging to the parent organization.
761            *
762            * @param companyId the primary key of the organization's company
763            * @param parentOrganizationId the primary key of the organization's parent
764            organization
765            * @return the organizations belonging to the parent organization
766            * @throws SystemException if a system exception occurred
767            */
768            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
769                    long companyId, long parentOrganizationId)
770                    throws com.liferay.portal.kernel.exception.SystemException {
771                    return getService().getOrganizations(companyId, parentOrganizationId);
772            }
773    
774            /**
775            * Returns a range of all the organizations belonging to the parent
776            * organization.
777            *
778            * <p>
779            * Useful when paginating results. Returns a maximum of <code>end -
780            * start</code> instances. <code>start</code> and <code>end</code> are not
781            * primary keys, they are indexes in the result set. Thus, <code>0</code>
782            * refers to the first result in the set. Setting both <code>start</code>
783            * and <code>end</code> to {@link
784            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
785            * result set.
786            * </p>
787            *
788            * @param companyId the primary key of the organization's company
789            * @param parentOrganizationId the primary key of the organization's parent
790            organization
791            * @param start the lower bound of the range of organizations to return
792            * @param end the upper bound of the range of organizations to return (not
793            inclusive)
794            * @return the range of organizations belonging to the parent organization
795            * @throws SystemException if a system exception occurred
796            * @see com.liferay.portal.service.persistence.OrganizationPersistence#findByC_P(
797            long, long, int, int)
798            */
799            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
800                    long companyId, long parentOrganizationId, int start, int end)
801                    throws com.liferay.portal.kernel.exception.SystemException {
802                    return getService()
803                                       .getOrganizations(companyId, parentOrganizationId, start, end);
804            }
805    
806            /**
807            * Returns the organizations with the primary keys.
808            *
809            * @param organizationIds the primary keys of the organizations
810            * @return the organizations with the primary keys
811            * @throws PortalException if any one of the organizations could not be
812            found
813            * @throws SystemException if a system exception occurred
814            */
815            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
816                    long[] organizationIds)
817                    throws com.liferay.portal.kernel.exception.PortalException,
818                            com.liferay.portal.kernel.exception.SystemException {
819                    return getService().getOrganizations(organizationIds);
820            }
821    
822            /**
823            * Returns the number of organizations belonging to the parent organization.
824            *
825            * @param companyId the primary key of the organization's company
826            * @param parentOrganizationId the primary key of the organization's parent
827            organization
828            * @return the number of organizations belonging to the parent organization
829            * @throws SystemException if a system exception occurred
830            */
831            public static int getOrganizationsCount(long companyId,
832                    long parentOrganizationId)
833                    throws com.liferay.portal.kernel.exception.SystemException {
834                    return getService()
835                                       .getOrganizationsCount(companyId, parentOrganizationId);
836            }
837    
838            /**
839            * Returns the parent organizations in order by closest ancestor. The list
840            * starts with the organization itself.
841            *
842            * @param organizationId the primary key of the organization
843            * @return the parent organizations in order by closest ancestor
844            * @throws PortalException if an organization with the primary key could not
845            be found
846            * @throws SystemException if a system exception occurred
847            */
848            public static java.util.List<com.liferay.portal.model.Organization> getParentOrganizations(
849                    long organizationId)
850                    throws com.liferay.portal.kernel.exception.PortalException,
851                            com.liferay.portal.kernel.exception.SystemException {
852                    return getService().getParentOrganizations(organizationId);
853            }
854    
855            /**
856            * Returns the suborganizations of the organizations.
857            *
858            * @param organizations the organizations from which to get
859            suborganizations
860            * @return the suborganizations of the organizations
861            * @throws SystemException if a system exception occurred
862            */
863            public static java.util.List<com.liferay.portal.model.Organization> getSuborganizations(
864                    java.util.List<com.liferay.portal.model.Organization> organizations)
865                    throws com.liferay.portal.kernel.exception.SystemException {
866                    return getService().getSuborganizations(organizations);
867            }
868    
869            /**
870            * Returns the suborganizations of the organization.
871            *
872            * @param companyId the primary key of the organization's company
873            * @param organizationId the primary key of the organization
874            * @return the suborganizations of the organization
875            * @throws SystemException if a system exception occurred
876            */
877            public static java.util.List<com.liferay.portal.model.Organization> getSuborganizations(
878                    long companyId, long organizationId)
879                    throws com.liferay.portal.kernel.exception.SystemException {
880                    return getService().getSuborganizations(companyId, organizationId);
881            }
882    
883            /**
884            * Returns the count of suborganizations of the organization.
885            *
886            * @param companyId the primary key of the organization's company
887            * @param organizationId the primary key of the organization
888            * @return the count of suborganizations of the organization
889            * @throws SystemException if a system exception occurred
890            */
891            public static int getSuborganizationsCount(long companyId,
892                    long organizationId)
893                    throws com.liferay.portal.kernel.exception.SystemException {
894                    return getService().getSuborganizationsCount(companyId, organizationId);
895            }
896    
897            /**
898            * Returns the intersection of <code>allOrganizations</code> and
899            * <code>availableOrganizations</code>.
900            *
901            * @param allOrganizations the organizations to check for availability
902            * @param availableOrganizations the available organizations
903            * @return the intersection of <code>allOrganizations</code> and
904            <code>availableOrganizations</code>
905            */
906            public static java.util.List<com.liferay.portal.model.Organization> getSubsetOrganizations(
907                    java.util.List<com.liferay.portal.model.Organization> allOrganizations,
908                    java.util.List<com.liferay.portal.model.Organization> availableOrganizations) {
909                    return getService()
910                                       .getSubsetOrganizations(allOrganizations,
911                            availableOrganizations);
912            }
913    
914            /**
915            * Returns all the organizations associated with the user. If
916            * includeAdministrative is <code>true</code>, the result includes those
917            * organizations that are not directly associated to the user but he is an
918            * administrator or an owner of the organization.
919            *
920            * @param userId the primary key of the user
921            * @param includeAdministrative whether to includes organizations that are
922            indirectly associated to the user because he is an administrator
923            or an owner of the organization
924            * @return the organizations associated with the user
925            * @throws PortalException if a user with the primary key could not be found
926            * @throws SystemException if a system exception occurred
927            */
928            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
929                    long userId, boolean includeAdministrative)
930                    throws com.liferay.portal.kernel.exception.PortalException,
931                            com.liferay.portal.kernel.exception.SystemException {
932                    return getService().getUserOrganizations(userId, includeAdministrative);
933            }
934    
935            /**
936            * Returns <code>true</code> if the password policy has been assigned to the
937            * organization.
938            *
939            * @param passwordPolicyId the primary key of the password policy
940            * @param organizationId the primary key of the organization
941            * @return <code>true</code> if the password policy has been assigned to the
942            organization; <code>false</code> otherwise
943            * @throws SystemException if a system exception occurred
944            */
945            public static boolean hasPasswordPolicyOrganization(long passwordPolicyId,
946                    long organizationId)
947                    throws com.liferay.portal.kernel.exception.SystemException {
948                    return getService()
949                                       .hasPasswordPolicyOrganization(passwordPolicyId,
950                            organizationId);
951            }
952    
953            /**
954            * Returns <code>true</code> if the user is a member of the organization,
955            * optionally focusing on suborganizations or the specified organization.
956            * This method is usually called to determine if the user has view access to
957            * a resource belonging to the organization.
958            *
959            * <ol>
960            * <li>
961            * If <code>inheritSuborganizations=<code>false</code></code>:
962            * the method checks whether the user belongs to the organization specified
963            * by <code>organizationId</code>. The parameter
964            * <code>includeSpecifiedOrganization</code> is ignored.
965            * </li>
966            * <li>
967            * The parameter <code>includeSpecifiedOrganization</code> is
968            * ignored unless <code>inheritSuborganizations</code> is also
969            * <code>true</code>.
970            * </li>
971            * <li>
972            * If <code>inheritSuborganizations=<code>true</code></code> and
973            * <code>includeSpecifiedOrganization=<code>false</code></code>: the method
974            * checks
975            * whether the user belongs to one of the child organizations of the one
976            * specified by <code>organizationId</code>.
977            * </li>
978            * <li>
979            * If <code>inheritSuborganizations=<code>true</code></code> and
980            * <code>includeSpecifiedOrganization=<code>true</code></code>: the method
981            * checks whether
982            * the user belongs to the organization specified by
983            * <code>organizationId</code> or any of
984            * its child organizations.
985            * </li>
986            * </ol>
987            *
988            * @param userId the primary key of the organization's user
989            * @param organizationId the primary key of the organization
990            * @param inheritSuborganizations if <code>true</code> suborganizations are
991            considered in the determination
992            * @param includeSpecifiedOrganization if <code>true</code> the
993            organization specified by <code>organizationId</code> is
994            considered in the determination
995            * @return <code>true</code> if the user has access to the organization;
996            <code>false</code> otherwise
997            * @throws PortalException if an organization with the primary key could not
998            be found
999            * @throws SystemException if a system exception occurred
1000            * @see com.liferay.portal.service.persistence.OrganizationFinder
1001            */
1002            public static boolean hasUserOrganization(long userId, long organizationId,
1003                    boolean inheritSuborganizations, boolean includeSpecifiedOrganization)
1004                    throws com.liferay.portal.kernel.exception.PortalException,
1005                            com.liferay.portal.kernel.exception.SystemException {
1006                    return getService()
1007                                       .hasUserOrganization(userId, organizationId,
1008                            inheritSuborganizations, includeSpecifiedOrganization);
1009            }
1010    
1011            /**
1012            * Rebuilds the organizations tree.
1013            *
1014            * <p>
1015            * Only call this method if the tree has become stale through operations
1016            * other than normal CRUD. Under normal circumstances the tree is
1017            * automatically rebuilt whenever necessary.
1018            * </p>
1019            *
1020            * @param companyId the primary key of the organization's company
1021            * @throws PortalException if an organization with the primary key could not
1022            be found
1023            * @throws SystemException if a system exception occurred
1024            */
1025            public static void rebuildTree(long companyId)
1026                    throws com.liferay.portal.kernel.exception.PortalException,
1027                            com.liferay.portal.kernel.exception.SystemException {
1028                    getService().rebuildTree(companyId);
1029            }
1030    
1031            /**
1032            * Returns a range of all the organizations of the company.
1033            *
1034            * <p>
1035            * Useful when paginating results. Returns a maximum of <code>end -
1036            * start</code> instances. <code>start</code> and <code>end</code> are not
1037            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1038            * refers to the first result in the set. Setting both <code>start</code>
1039            * and <code>end</code> to {@link
1040            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1041            * result set.
1042            * </p>
1043            *
1044            * @param companyId the primary key of the company
1045            * @param params the finder parameters (optionally <code>null</code>). For
1046            more information see {@link
1047            com.liferay.portlet.usersadmin.util.OrganizationIndexer}
1048            * @param start the lower bound of the range of organizations to return
1049            * @param end the upper bound of the range of organizations to return (not
1050            inclusive)
1051            * @return the range of all the organizations of the company
1052            * @throws SystemException if a system exception occurred
1053            */
1054            public static java.util.List<com.liferay.portal.model.Organization> search(
1055                    long companyId,
1056                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1057                    int start, int end)
1058                    throws com.liferay.portal.kernel.exception.SystemException {
1059                    return getService().search(companyId, params, start, end);
1060            }
1061    
1062            /**
1063            * Returns an ordered range of all the organizations that match the
1064            * keywords, using the indexer. It is preferable to use this method instead
1065            * of the non-indexed version whenever possible for performance reasons.
1066            *
1067            * <p>
1068            * Useful when paginating results. Returns a maximum of <code>end -
1069            * start</code> instances. <code>start</code> and <code>end</code> are not
1070            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1071            * refers to the first result in the set. Setting both <code>start</code>
1072            * and <code>end</code> to {@link
1073            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1074            * result set.
1075            * </p>
1076            *
1077            * @param companyId the primary key of the organization's company
1078            * @param parentOrganizationId the primary key of the organization's parent
1079            organization
1080            * @param keywords the keywords (space separated), which may occur in the
1081            organization's name, street, city, zipcode, type, region or
1082            country (optionally <code>null</code>)
1083            * @param params the finder parameters (optionally <code>null</code>). For
1084            more information see {@link
1085            com.liferay.portlet.usersadmin.util.OrganizationIndexer}
1086            * @param start the lower bound of the range of organizations to return
1087            * @param end the upper bound of the range of organizations to return (not
1088            inclusive)
1089            * @param sort the field and direction by which to sort (optionally
1090            <code>null</code>)
1091            * @return the matching organizations ordered by name
1092            * @throws SystemException if a system exception occurred
1093            * @see com.liferay.portlet.usersadmin.util.OrganizationIndexer
1094            */
1095            public static com.liferay.portal.kernel.search.Hits search(long companyId,
1096                    long parentOrganizationId, java.lang.String keywords,
1097                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1098                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
1099                    throws com.liferay.portal.kernel.exception.SystemException {
1100                    return getService()
1101                                       .search(companyId, parentOrganizationId, keywords, params,
1102                            start, end, sort);
1103            }
1104    
1105            /**
1106            * Returns a name ordered range of all the organizations that match the
1107            * keywords, type, region, and country, without using the indexer. It is
1108            * preferable to use the indexed version {@link #search(long, long, String,
1109            * LinkedHashMap, int, int, Sort)} instead of this method wherever possible
1110            * for performance reasons.
1111            *
1112            * <p>
1113            * Useful when paginating results. Returns a maximum of <code>end -
1114            * start</code> instances. <code>start</code> and <code>end</code> are not
1115            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1116            * refers to the first result in the set. Setting both <code>start</code>
1117            * and <code>end</code> to {@link
1118            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1119            * result set.
1120            * </p>
1121            *
1122            * @param companyId the primary key of the organization's company
1123            * @param parentOrganizationId the primary key of the organization's parent
1124            organization
1125            * @param keywords the keywords (space separated), which may occur in the
1126            organization's name, street, city, or zipcode (optionally
1127            <code>null</code>)
1128            * @param type the organization's type (optionally <code>null</code>)
1129            * @param regionId the primary key of the organization's region (optionally
1130            <code>null</code>)
1131            * @param countryId the primary key of the organization's country
1132            (optionally <code>null</code>)
1133            * @param params the finder params. For more information see {@link
1134            com.liferay.portal.service.persistence.OrganizationFinder}
1135            * @param start the lower bound of the range of organizations to return
1136            * @param end the upper bound of the range of organizations to return (not
1137            inclusive)
1138            * @return the matching organizations ordered by name
1139            * @throws SystemException if a system exception occurred
1140            * @see com.liferay.portal.service.persistence.OrganizationFinder
1141            */
1142            public static java.util.List<com.liferay.portal.model.Organization> search(
1143                    long companyId, long parentOrganizationId, java.lang.String keywords,
1144                    java.lang.String type, java.lang.Long regionId,
1145                    java.lang.Long countryId,
1146                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1147                    int start, int end)
1148                    throws com.liferay.portal.kernel.exception.SystemException {
1149                    return getService()
1150                                       .search(companyId, parentOrganizationId, keywords, type,
1151                            regionId, countryId, params, start, end);
1152            }
1153    
1154            /**
1155            * Returns an ordered range of all the organizations that match the
1156            * keywords, type, region, and country, without using the indexer. It is
1157            * preferable to use the indexed version {@link #search(long, long, String,
1158            * String, String, String, String, String, String, LinkedHashMap, boolean,
1159            * int, int, Sort)} instead of this method wherever possible for performance
1160            * reasons.
1161            *
1162            * <p>
1163            * Useful when paginating results. Returns a maximum of <code>end -
1164            * start</code> instances. <code>start</code> and <code>end</code> are not
1165            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1166            * refers to the first result in the set. Setting both <code>start</code>
1167            * and <code>end</code> to {@link
1168            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1169            * result set.
1170            * </p>
1171            *
1172            * @param companyId the primary key of the organization's company
1173            * @param parentOrganizationId the primary key of the organization's parent
1174            organization
1175            * @param keywords the keywords (space separated), which may occur in the
1176            organization's name, street, city, or zipcode (optionally
1177            <code>null</code>)
1178            * @param type the organization's type (optionally <code>null</code>)
1179            * @param regionId the primary key of the organization's region (optionally
1180            <code>null</code>)
1181            * @param countryId the primary key of the organization's country
1182            (optionally <code>null</code>)
1183            * @param params the finder params. For more information see {@link
1184            com.liferay.portal.service.persistence.OrganizationFinder}
1185            * @param start the lower bound of the range of organizations to return
1186            * @param end the upper bound of the range of organizations to return (not
1187            inclusive)
1188            * @param obc the comparator to order the organizations (optionally
1189            <code>null</code>)
1190            * @return the matching organizations ordered by comparator <code>obc</code>
1191            * @throws SystemException if a system exception occurred
1192            * @see com.liferay.portal.service.persistence.OrganizationFinder
1193            */
1194            public static java.util.List<com.liferay.portal.model.Organization> search(
1195                    long companyId, long parentOrganizationId, java.lang.String keywords,
1196                    java.lang.String type, java.lang.Long regionId,
1197                    java.lang.Long countryId,
1198                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1199                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1200                    throws com.liferay.portal.kernel.exception.SystemException {
1201                    return getService()
1202                                       .search(companyId, parentOrganizationId, keywords, type,
1203                            regionId, countryId, params, start, end, obc);
1204            }
1205    
1206            /**
1207            * Returns a name ordered range of all the organizations with the type,
1208            * region, and country, and whose name, street, city, and zipcode match the
1209            * keywords specified for them, without using the indexer. It is preferable
1210            * to use the indexed version {@link #search(long, long, String, String,
1211            * String, String, String, String, String, LinkedHashMap, boolean, int, int,
1212            * Sort)} instead of this method wherever possible for performance reasons.
1213            *
1214            * <p>
1215            * Useful when paginating results. Returns a maximum of <code>end -
1216            * start</code> instances. <code>start</code> and <code>end</code> are not
1217            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1218            * refers to the first result in the set. Setting both <code>start</code>
1219            * and <code>end</code> to {@link
1220            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1221            * result set.
1222            * </p>
1223            *
1224            * @param companyId the primary key of the organization's company
1225            * @param parentOrganizationId the primary key of the organization's parent
1226            * @param name the name keywords (space separated, optionally
1227            <code>null</code>)
1228            * @param type the organization's type (optionally <code>null</code>)
1229            * @param street the street keywords (optionally <code>null</code>)
1230            * @param city the city keywords (optionally <code>null</code>)
1231            * @param zip the zipcode keywords (optionally <code>null</code>)
1232            * @param regionId the primary key of the organization's region (optionally
1233            <code>null</code>)
1234            * @param countryId the primary key of the organization's country
1235            (optionally <code>null</code>)
1236            * @param params the finder parameters (optionally <code>null</code>). For
1237            more information see {@link
1238            com.liferay.portal.service.persistence.OrganizationFinder}
1239            * @param andOperator whether every field must match its keywords, or just
1240            one field. For example, &quot;organizations with the name
1241            'Employees' and city 'Chicago'&quot; vs &quot;organizations with
1242            the name 'Employees' or the city 'Chicago'&quot;.
1243            * @param start the lower bound of the range of organizations to return
1244            * @param end the upper bound of the range of organizations to return (not
1245            inclusive)
1246            * @return the matching organizations ordered by name
1247            * @throws SystemException if a system exception occurred
1248            * @see com.liferay.portal.service.persistence.OrganizationFinder
1249            */
1250            public static java.util.List<com.liferay.portal.model.Organization> search(
1251                    long companyId, long parentOrganizationId, java.lang.String name,
1252                    java.lang.String type, java.lang.String street, java.lang.String city,
1253                    java.lang.String zip, java.lang.Long regionId,
1254                    java.lang.Long countryId,
1255                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1256                    boolean andOperator, int start, int end)
1257                    throws com.liferay.portal.kernel.exception.SystemException {
1258                    return getService()
1259                                       .search(companyId, parentOrganizationId, name, type, street,
1260                            city, zip, regionId, countryId, params, andOperator, start, end);
1261            }
1262    
1263            /**
1264            * Returns an ordered range of all the organizations with the type, region,
1265            * and country, and whose name, street, city, and zipcode match the keywords
1266            * specified for them, without using the indexer. It is preferable to use
1267            * the indexed version {@link #search(long, long, String, String, String,
1268            * String, String, String, String, LinkedHashMap, boolean, int, int, Sort)}
1269            * instead of this method wherever possible for performance reasons.
1270            *
1271            * <p>
1272            * Useful when paginating results. Returns a maximum of <code>end -
1273            * start</code> instances. <code>start</code> and <code>end</code> are not
1274            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1275            * refers to the first result in the set. Setting both <code>start</code>
1276            * and <code>end</code> to {@link
1277            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1278            * result set.
1279            * </p>
1280            *
1281            * @param companyId the primary key of the organization's company
1282            * @param parentOrganizationId the primary key of the organization's parent
1283            organization
1284            * @param name the name keywords (space separated, optionally
1285            <code>null</code>)
1286            * @param type the organization's type (optionally <code>null</code>)
1287            * @param street the street keywords (optionally <code>null</code>)
1288            * @param city the city keywords (optionally <code>null</code>)
1289            * @param zip the zipcode keywords (optionally <code>null</code>)
1290            * @param regionId the primary key of the organization's region (optionally
1291            <code>null</code>)
1292            * @param countryId the primary key of the organization's country
1293            (optionally <code>null</code>)
1294            * @param params the finder parameters (optionally <code>null</code>). For
1295            more information see {@link
1296            com.liferay.portal.service.persistence.OrganizationFinder}
1297            * @param andOperator whether every field must match its keywords, or just
1298            one field. For example, &quot;organizations with the name
1299            'Employees' and city 'Chicago'&quot; vs &quot;organizations with
1300            the name 'Employees' or the city 'Chicago'&quot;.
1301            * @param start the lower bound of the range of organizations to return
1302            * @param end the upper bound of the range of organizations to return (not
1303            inclusive)
1304            * @param obc the comparator to order the organizations (optionally
1305            <code>null</code>)
1306            * @return the matching organizations ordered by comparator <code>obc</code>
1307            * @throws SystemException if a system exception occurred
1308            * @see com.liferay.portal.service.persistence.OrganizationFinder
1309            */
1310            public static java.util.List<com.liferay.portal.model.Organization> search(
1311                    long companyId, long parentOrganizationId, java.lang.String name,
1312                    java.lang.String type, java.lang.String street, java.lang.String city,
1313                    java.lang.String zip, java.lang.Long regionId,
1314                    java.lang.Long countryId,
1315                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1316                    boolean andOperator, int start, int end,
1317                    com.liferay.portal.kernel.util.OrderByComparator obc)
1318                    throws com.liferay.portal.kernel.exception.SystemException {
1319                    return getService()
1320                                       .search(companyId, parentOrganizationId, name, type, street,
1321                            city, zip, regionId, countryId, params, andOperator, start, end, obc);
1322            }
1323    
1324            /**
1325            * Returns an ordered range of all the organizations whose name, type, or
1326            * location fields match the keywords specified for them, using the indexer.
1327            * It is preferable to use this method instead of the non-indexed version
1328            * whenever possible for performance reasons.
1329            *
1330            * <p>
1331            * Useful when paginating results. Returns a maximum of <code>end -
1332            * start</code> instances. <code>start</code> and <code>end</code> are not
1333            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1334            * refers to the first result in the set. Setting both <code>start</code>
1335            * and <code>end</code> to {@link
1336            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1337            * result set.
1338            * </p>
1339            *
1340            * @param companyId the primary key of the organization's company
1341            * @param parentOrganizationId the primary key of the organization's parent
1342            organization
1343            * @param name the name keywords (space separated, optionally
1344            <code>null</code>)
1345            * @param type the type keywords (optionally <code>null</code>)
1346            * @param street the street keywords (optionally <code>null</code>)
1347            * @param city the city keywords (optionally <code>null</code>)
1348            * @param zip the zipcode keywords (optionally <code>null</code>)
1349            * @param region the region keywords (optionally <code>null</code>)
1350            * @param country the country keywords (optionally <code>null</code>)
1351            * @param params the finder parameters (optionally <code>null</code>). For
1352            more information see {@link
1353            com.liferay.portlet.usersadmin.util.OrganizationIndexer}.
1354            * @param andSearch whether every field must match its keywords or just one
1355            field
1356            * @param start the lower bound of the range of organizations to return
1357            * @param end the upper bound of the range of organizations to return (not
1358            inclusive)
1359            * @param sort the field and direction by which to sort (optionally
1360            <code>null</code>)
1361            * @return the matching organizations ordered by <code>sort</code>
1362            * @throws SystemException if a system exception occurred
1363            * @see com.liferay.portlet.usersadmin.util.OrganizationIndexer
1364            */
1365            public static com.liferay.portal.kernel.search.Hits search(long companyId,
1366                    long parentOrganizationId, java.lang.String name,
1367                    java.lang.String type, java.lang.String street, java.lang.String city,
1368                    java.lang.String zip, java.lang.String region,
1369                    java.lang.String country,
1370                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1371                    boolean andSearch, int start, int end,
1372                    com.liferay.portal.kernel.search.Sort sort)
1373                    throws com.liferay.portal.kernel.exception.SystemException {
1374                    return getService()
1375                                       .search(companyId, parentOrganizationId, name, type, street,
1376                            city, zip, region, country, params, andSearch, start, end, sort);
1377            }
1378    
1379            /**
1380            * Returns the number of organizations that match the keywords, type,
1381            * region, and country.
1382            *
1383            * @param companyId the primary key of the organization's company
1384            * @param parentOrganizationId the primary key of the organization's parent
1385            organization
1386            * @param keywords the keywords (space separated), which may occur in the
1387            organization's name, street, city, or zipcode (optionally
1388            <code>null</code>)
1389            * @param type the organization's type (optionally <code>null</code>)
1390            * @param regionId the primary key of the organization's region (optionally
1391            <code>null</code>)
1392            * @param countryId the primary key of the organization's country
1393            (optionally <code>null</code>)
1394            * @param params the finder parameters (optionally <code>null</code>). For
1395            more information see {@link
1396            com.liferay.portal.service.persistence.OrganizationFinder}
1397            * @return the number of matching organizations
1398            * @throws SystemException if a system exception occurred
1399            * @see com.liferay.portal.service.persistence.OrganizationFinder
1400            */
1401            public static int searchCount(long companyId, long parentOrganizationId,
1402                    java.lang.String keywords, java.lang.String type,
1403                    java.lang.Long regionId, java.lang.Long countryId,
1404                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1405                    throws com.liferay.portal.kernel.exception.SystemException {
1406                    return getService()
1407                                       .searchCount(companyId, parentOrganizationId, keywords,
1408                            type, regionId, countryId, params);
1409            }
1410    
1411            /**
1412            * Returns the number of organizations with the type, region, and country,
1413            * and whose name, street, city, and zipcode match the keywords specified
1414            * for them.
1415            *
1416            * @param companyId the primary key of the organization's company
1417            * @param parentOrganizationId the primary key of the organization's parent
1418            organization
1419            * @param name the name keywords (space separated, optionally
1420            <code>null</code>)
1421            * @param type the organization's type (optionally <code>null</code>)
1422            * @param street the street keywords (optionally <code>null</code>)
1423            * @param city the city keywords (optionally <code>null</code>)
1424            * @param zip the zipcode keywords (optionally <code>null</code>)
1425            * @param regionId the primary key of the organization's region (optionally
1426            <code>null</code>)
1427            * @param countryId the primary key of the organization's country
1428            (optionally <code>null</code>)
1429            * @param params the finder parameters (optionally <code>null</code>). For
1430            more information see {@link
1431            com.liferay.portal.service.persistence.OrganizationFinder}
1432            * @param andOperator whether every field must match its keywords, or just
1433            one field. For example, &quot;organizations with the name
1434            'Employees' and city 'Chicago'&quot; vs &quot;organizations with
1435            the name 'Employees' or the city 'Chicago'&quot;.
1436            * @return the number of matching organizations
1437            * @throws SystemException if a system exception occurred
1438            * @see com.liferay.portal.service.persistence.OrganizationFinder
1439            */
1440            public static int searchCount(long companyId, long parentOrganizationId,
1441                    java.lang.String name, java.lang.String type, java.lang.String street,
1442                    java.lang.String city, java.lang.String zip, java.lang.Long regionId,
1443                    java.lang.Long countryId,
1444                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1445                    boolean andOperator)
1446                    throws com.liferay.portal.kernel.exception.SystemException {
1447                    return getService()
1448                                       .searchCount(companyId, parentOrganizationId, name, type,
1449                            street, city, zip, regionId, countryId, params, andOperator);
1450            }
1451    
1452            /**
1453            * Removes the organizations from the group.
1454            *
1455            * @param groupId the primary key of the group
1456            * @param organizationIds the primary keys of the organizations
1457            * @throws PortalException if a portal exception occurred
1458            * @throws SystemException if a system exception occurred
1459            */
1460            public static void unsetGroupOrganizations(long groupId,
1461                    long[] organizationIds)
1462                    throws com.liferay.portal.kernel.exception.PortalException,
1463                            com.liferay.portal.kernel.exception.SystemException {
1464                    getService().unsetGroupOrganizations(groupId, organizationIds);
1465            }
1466    
1467            /**
1468            * Removes the organizations from the password policy.
1469            *
1470            * @param passwordPolicyId the primary key of the password policy
1471            * @param organizationIds the primary keys of the organizations
1472            * @throws SystemException if a system exception occurred
1473            */
1474            public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
1475                    long[] organizationIds)
1476                    throws com.liferay.portal.kernel.exception.SystemException {
1477                    getService()
1478                            .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
1479            }
1480    
1481            /**
1482            * Updates the organization's asset with the new asset categories and tag
1483            * names, removing and adding asset categories and tag names as necessary.
1484            *
1485            * @param userId the primary key of the user
1486            * @param organization the organization
1487            * @param assetCategoryIds the primary keys of the asset categories
1488            * @param assetTagNames the asset tag names
1489            * @throws PortalException if a user with the primary key could not be found
1490            * @throws SystemException if a system exception occurred
1491            */
1492            public static void updateAsset(long userId,
1493                    com.liferay.portal.model.Organization organization,
1494                    long[] assetCategoryIds, java.lang.String[] assetTagNames)
1495                    throws com.liferay.portal.kernel.exception.PortalException,
1496                            com.liferay.portal.kernel.exception.SystemException {
1497                    getService()
1498                            .updateAsset(userId, organization, assetCategoryIds, assetTagNames);
1499            }
1500    
1501            /**
1502            * Updates the organization.
1503            *
1504            * @param companyId the primary key of the organization's company
1505            * @param organizationId the primary key of the organization
1506            * @param parentOrganizationId the primary key of organization's parent
1507            organization
1508            * @param name the organization's name
1509            * @param type the organization's type
1510            * @param recursable whether permissions of the organization are to be
1511            inherited by its suborganizations
1512            * @param regionId the primary key of the organization's region
1513            * @param countryId the primary key of the organization's country
1514            * @param statusId the organization's workflow status
1515            * @param comments the comments about the organization
1516            * @param site whether the organization is to be associated with a main
1517            site
1518            * @param serviceContext the service context to be applied (optionally
1519            <code>null</code>). Can set asset category IDs and asset tag
1520            names for the organization, and merge expando bridge
1521            attributes for the organization.
1522            * @return the organization
1523            * @throws PortalException if an organization or parent organization
1524            with the primary key could not be found or if the new
1525            information was invalid
1526            * @throws SystemException if a system exception occurred
1527            * @deprecated As of 6.2.0, replaced by {@link #updateOrganization(long,
1528            long, long, String, String, long, long, int, String, boolean,
1529            ServiceContext)}
1530            */
1531            public static com.liferay.portal.model.Organization updateOrganization(
1532                    long companyId, long organizationId, long parentOrganizationId,
1533                    java.lang.String name, java.lang.String type, boolean recursable,
1534                    long regionId, long countryId, int statusId, java.lang.String comments,
1535                    boolean site, com.liferay.portal.service.ServiceContext serviceContext)
1536                    throws com.liferay.portal.kernel.exception.PortalException,
1537                            com.liferay.portal.kernel.exception.SystemException {
1538                    return getService()
1539                                       .updateOrganization(companyId, organizationId,
1540                            parentOrganizationId, name, type, recursable, regionId, countryId,
1541                            statusId, comments, site, serviceContext);
1542            }
1543    
1544            /**
1545            * Updates the organization.
1546            *
1547            * @param companyId the primary key of the organization's company
1548            * @param organizationId the primary key of the organization
1549            * @param parentOrganizationId the primary key of organization's parent
1550            organization
1551            * @param name the organization's name
1552            * @param type the organization's type
1553            * @param regionId the primary key of the organization's region
1554            * @param countryId the primary key of the organization's country
1555            * @param statusId the organization's workflow status
1556            * @param comments the comments about the organization
1557            * @param site whether the organization is to be associated with a main
1558            site
1559            * @param serviceContext the service context to be applied (optionally
1560            <code>null</code>). Can set asset category IDs and asset tag
1561            names for the organization, and merge expando bridge attributes
1562            for the organization.
1563            * @return the organization
1564            * @throws PortalException if an organization or parent organization with
1565            the primary key could not be found or if the new information was
1566            invalid
1567            * @throws SystemException if a system exception occurred
1568            */
1569            public static com.liferay.portal.model.Organization updateOrganization(
1570                    long companyId, long organizationId, long parentOrganizationId,
1571                    java.lang.String name, java.lang.String type, long regionId,
1572                    long countryId, int statusId, java.lang.String comments, boolean site,
1573                    com.liferay.portal.service.ServiceContext serviceContext)
1574                    throws com.liferay.portal.kernel.exception.PortalException,
1575                            com.liferay.portal.kernel.exception.SystemException {
1576                    return getService()
1577                                       .updateOrganization(companyId, organizationId,
1578                            parentOrganizationId, name, type, regionId, countryId, statusId,
1579                            comments, site, serviceContext);
1580            }
1581    
1582            public static OrganizationLocalService getService() {
1583                    if (_service == null) {
1584                            _service = (OrganizationLocalService)PortalBeanLocatorUtil.locate(OrganizationLocalService.class.getName());
1585    
1586                            ReferenceRegistry.registerReference(OrganizationLocalServiceUtil.class,
1587                                    "_service");
1588                    }
1589    
1590                    return _service;
1591            }
1592    
1593            /**
1594             * @deprecated As of 6.2.0
1595             */
1596            public void setService(OrganizationLocalService service) {
1597            }
1598    
1599            private static OrganizationLocalService _service;
1600    }