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