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