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