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