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.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.jsonwebservice.JSONWebService;
022    import com.liferay.portal.kernel.security.access.control.AccessControlled;
023    import com.liferay.portal.kernel.transaction.Isolation;
024    import com.liferay.portal.kernel.transaction.Propagation;
025    import com.liferay.portal.kernel.transaction.Transactional;
026    
027    /**
028     * Provides the remote service interface for Organization. Methods of this
029     * service are expected to have security checks based on the propagated JAAS
030     * credentials because this service can be accessed remotely.
031     *
032     * @author Brian Wing Shun Chan
033     * @see OrganizationServiceUtil
034     * @see com.liferay.portal.service.base.OrganizationServiceBaseImpl
035     * @see com.liferay.portal.service.impl.OrganizationServiceImpl
036     * @generated
037     */
038    @AccessControlled
039    @JSONWebService
040    @ProviderType
041    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
042            PortalException.class, SystemException.class})
043    public interface OrganizationService extends BaseService {
044            /*
045             * NOTE FOR DEVELOPERS:
046             *
047             * Never modify or reference this interface directly. Always use {@link OrganizationServiceUtil} to access the organization remote service. Add custom service methods to {@link com.liferay.portal.service.impl.OrganizationServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
048             */
049    
050            /**
051            * Adds the organizations to the group.
052            *
053            * @param groupId the primary key of the group
054            * @param organizationIds the primary keys of the organizations
055            */
056            public void addGroupOrganizations(long groupId, long[] organizationIds)
057                    throws PortalException;
058    
059            /**
060            * Adds an organization with additional parameters.
061            *
062            * <p>
063            * This method handles the creation and bookkeeping of the organization
064            * including its resources, metadata, and internal data structures.
065            * </p>
066            *
067            * @param parentOrganizationId the primary key of the organization's
068            parent organization
069            * @param name the organization's name
070            * @param type the organization's type
071            * @param recursable whether the permissions of the organization are to
072            be inherited by its suborganizations
073            * @param regionId the primary key of the organization's region
074            * @param countryId the primary key of the organization's country
075            * @param statusId the organization's workflow status
076            * @param comments the comments about the organization
077            * @param site whether the organization is to be associated with a main
078            site
079            * @param addresses the organization's addresses
080            * @param emailAddresses the organization's email addresses
081            * @param orgLabors the organization's hours of operation
082            * @param phones the organization's phone numbers
083            * @param websites the organization's websites
084            * @param serviceContext the service context to be applied (optionally
085            <code>null</code>). Can set asset category IDs, asset tag
086            names, and expando bridge attributes for the organization.
087            * @return the organization
088            * @deprecated As of 6.2.0, replaced by {@link #addOrganization(long,
089            String, String, long, long, int, String, boolean, List, List,
090            List, List, List, ServiceContext)}
091            */
092            @java.lang.Deprecated
093            public com.liferay.portal.model.Organization addOrganization(
094                    long parentOrganizationId, java.lang.String name,
095                    java.lang.String type, boolean recursable, long regionId,
096                    long countryId, long statusId, java.lang.String comments, boolean site,
097                    java.util.List<com.liferay.portal.model.Address> addresses,
098                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
099                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
100                    java.util.List<com.liferay.portal.model.Phone> phones,
101                    java.util.List<com.liferay.portal.model.Website> websites,
102                    com.liferay.portal.service.ServiceContext serviceContext)
103                    throws PortalException;
104    
105            /**
106            * Adds an organization.
107            *
108            * <p>
109            * This method handles the creation and bookkeeping of the organization
110            * including its resources, metadata, and internal data structures.
111            * </p>
112            *
113            * @param parentOrganizationId the primary key of the organization's
114            parent organization
115            * @param name the organization's name
116            * @param type the organization's type
117            * @param recursable whether the permissions of the organization are to
118            be inherited by its suborganizations
119            * @param regionId the primary key of the organization's region
120            * @param countryId the primary key of the organization's country
121            * @param statusId the organization's workflow status
122            * @param comments the comments about the organization
123            * @param site whether the organization is to be associated with a main
124            site
125            * @param serviceContext the service context to be applied (optionally
126            <code>null</code>). Can set asset category IDs, asset tag
127            names, and expando bridge attributes for the organization.
128            * @return the organization
129            * @deprecated As of 6.2.0, replaced by {@link #addOrganization(long,
130            String, String, long, long, int, String, boolean,
131            ServiceContext)}
132            */
133            @java.lang.Deprecated
134            public com.liferay.portal.model.Organization addOrganization(
135                    long parentOrganizationId, java.lang.String name,
136                    java.lang.String type, boolean recursable, long regionId,
137                    long countryId, long statusId, java.lang.String comments, boolean site,
138                    com.liferay.portal.service.ServiceContext serviceContext)
139                    throws PortalException;
140    
141            /**
142            * Adds an organization with additional parameters.
143            *
144            * <p>
145            * This method handles the creation and bookkeeping of the organization
146            * including its resources, metadata, and internal data structures.
147            * </p>
148            *
149            * @param parentOrganizationId the primary key of the organization's parent
150            organization
151            * @param name the organization's name
152            * @param type the organization's type
153            * @param regionId the primary key of the organization's region
154            * @param countryId the primary key of the organization's country
155            * @param statusId the organization's workflow status
156            * @param comments the comments about the organization
157            * @param site whether the organization is to be associated with a main
158            site
159            * @param addresses the organization's addresses
160            * @param emailAddresses the organization's email addresses
161            * @param orgLabors the organization's hours of operation
162            * @param phones the organization's phone numbers
163            * @param websites the organization's websites
164            * @param serviceContext the service context to be applied (optionally
165            <code>null</code>). Can set asset category IDs, asset tag names,
166            and expando bridge attributes for the organization.
167            * @return the organization
168            */
169            public com.liferay.portal.model.Organization addOrganization(
170                    long parentOrganizationId, java.lang.String name,
171                    java.lang.String type, long regionId, long countryId, long statusId,
172                    java.lang.String comments, boolean site,
173                    java.util.List<com.liferay.portal.model.Address> addresses,
174                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
175                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
176                    java.util.List<com.liferay.portal.model.Phone> phones,
177                    java.util.List<com.liferay.portal.model.Website> websites,
178                    com.liferay.portal.service.ServiceContext serviceContext)
179                    throws PortalException;
180    
181            /**
182            * Adds an organization.
183            *
184            * <p>
185            * This method handles the creation and bookkeeping of the organization
186            * including its resources, metadata, and internal data structures.
187            * </p>
188            *
189            * @param parentOrganizationId the primary key of the organization's parent
190            organization
191            * @param name the organization's name
192            * @param type the organization's type
193            * @param regionId the primary key of the organization's region
194            * @param countryId the primary key of the organization's country
195            * @param statusId the organization's workflow status
196            * @param comments the comments about the organization
197            * @param site whether the organization is to be associated with a main
198            site
199            * @param serviceContext the service context to be applied (optionally
200            <code>null</code>). Can set asset category IDs, asset tag names,
201            and expando bridge attributes for the organization.
202            * @return the organization
203            */
204            public com.liferay.portal.model.Organization addOrganization(
205                    long parentOrganizationId, java.lang.String name,
206                    java.lang.String type, long regionId, long countryId, long statusId,
207                    java.lang.String comments, boolean site,
208                    com.liferay.portal.service.ServiceContext serviceContext)
209                    throws PortalException;
210    
211            /**
212            * Assigns the password policy to the organizations, removing any other
213            * currently assigned password policies.
214            *
215            * @param passwordPolicyId the primary key of the password policy
216            * @param organizationIds the primary keys of the organizations
217            */
218            public void addPasswordPolicyOrganizations(long passwordPolicyId,
219                    long[] organizationIds) throws PortalException;
220    
221            /**
222            * Deletes the organization's logo.
223            *
224            * @param organizationId the primary key of the organization
225            */
226            public void deleteLogo(long organizationId) throws PortalException;
227    
228            /**
229            * Deletes the organization. The organization's associated resources and
230            * assets are also deleted.
231            *
232            * @param organizationId the primary key of the organization
233            */
234            public void deleteOrganization(long organizationId)
235                    throws PortalException;
236    
237            /**
238            * Returns the organization with the primary key.
239            *
240            * @param organizationId the primary key of the organization
241            * @return the organization with the primary key, or <code>null</code> if an
242            organization with the primary key could not be found or if the
243            user did not have permission to view the organization
244            */
245            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
246            public com.liferay.portal.model.Organization fetchOrganization(
247                    long organizationId) throws PortalException;
248    
249            /**
250            * Returns all the organizations which the user has permission to manage.
251            *
252            * @param actionId the permitted action
253            * @param max the maximum number of the organizations to be considered
254            * @return the organizations which the user has permission to manage
255            * @deprecated As of 6.2.0, replaced by {@link #getOrganizations(long, long,
256            int, int)}
257            */
258            @java.lang.Deprecated
259            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
260            public java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
261                    java.lang.String actionId, int max) throws PortalException;
262    
263            /**
264            * Returns the OSGi service identifier.
265            *
266            * @return the OSGi service identifier
267            */
268            public java.lang.String getOSGiServiceIdentifier();
269    
270            /**
271            * Returns the organization with the primary key.
272            *
273            * @param organizationId the primary key of the organization
274            * @return the organization with the primary key
275            */
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public com.liferay.portal.model.Organization getOrganization(
278                    long organizationId) throws PortalException;
279    
280            /**
281            * Returns the primary key of the organization with the name.
282            *
283            * @param companyId the primary key of the organization's company
284            * @param name the organization's name
285            * @return the primary key of the organization with the name, or
286            <code>0</code> if the organization could not be found
287            */
288            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
289            public long getOrganizationId(long companyId, java.lang.String name)
290                    throws PortalException;
291    
292            /**
293            * Returns all the organizations belonging to the parent organization.
294            *
295            * @param companyId the primary key of the organizations' company
296            * @param parentOrganizationId the primary key of the organizations' parent
297            organization
298            * @return the organizations belonging to the parent organization
299            */
300            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
301            public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
302                    long companyId, long parentOrganizationId);
303    
304            /**
305            * Returns a range of all the organizations belonging to the parent
306            * organization.
307            *
308            * <p>
309            * Useful when paginating results. Returns a maximum of <code>end -
310            * start</code> instances. <code>start</code> and <code>end</code> are not
311            * primary keys, they are indexes in the result set. Thus, <code>0</code>
312            * refers to the first result in the set. Setting both <code>start</code>
313            * and <code>end</code> to {@link
314            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
315            * result set.
316            * </p>
317            *
318            * @param companyId the primary key of the organizations' company
319            * @param parentOrganizationId the primary key of the organizations' parent
320            organization
321            * @param start the lower bound of the range of organizations to return
322            * @param end the upper bound of the range of organizations to return (not
323            inclusive)
324            * @return the range of organizations belonging to the parent organization
325            */
326            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
327            public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
328                    long companyId, long parentOrganizationId, int start, int end);
329    
330            /**
331            * Returns the number of organizations belonging to the parent organization.
332            *
333            * @param companyId the primary key of the organizations' company
334            * @param parentOrganizationId the primary key of the organizations' parent
335            organization
336            * @return the number of organizations belonging to the parent organization
337            */
338            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
339            public int getOrganizationsCount(long companyId, long parentOrganizationId);
340    
341            /**
342            * Returns all the organizations with which the user is explicitly
343            * associated.
344            *
345            * <p>
346            * A user is considered to be <i>explicitly</i> associated with an
347            * organization if his account is individually created within the
348            * organization or if the user is later added as a member.
349            * </p>
350            *
351            * @param userId the primary key of the user
352            * @return the organizations with which the user is explicitly associated
353            */
354            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
355            public java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
356                    long userId) throws PortalException;
357    
358            /**
359            * Sets the organizations in the group, removing and adding organizations to
360            * the group as necessary.
361            *
362            * @param groupId the primary key of the group
363            * @param organizationIds the primary keys of the organizations
364            */
365            public void setGroupOrganizations(long groupId, long[] organizationIds)
366                    throws PortalException;
367    
368            /**
369            * Removes the organizations from the group.
370            *
371            * @param groupId the primary key of the group
372            * @param organizationIds the primary keys of the organizations
373            */
374            public void unsetGroupOrganizations(long groupId, long[] organizationIds)
375                    throws PortalException;
376    
377            /**
378            * Removes the organizations from the password policy.
379            *
380            * @param passwordPolicyId the primary key of the password policy
381            * @param organizationIds the primary keys of the organizations
382            */
383            public void unsetPasswordPolicyOrganizations(long passwordPolicyId,
384                    long[] organizationIds) throws PortalException;
385    
386            /**
387            * Updates the organization with additional parameters.
388            *
389            * @param organizationId the primary key of the organization
390            * @param parentOrganizationId the primary key of the organization's
391            parent organization
392            * @param name the organization's name
393            * @param type the organization's type
394            * @param recursable whether the permissions of the organization are to
395            be inherited by its suborganizations
396            * @param regionId the primary key of the organization's region
397            * @param countryId the primary key of the organization's country
398            * @param statusId the organization's workflow status
399            * @param comments the comments about the organization
400            * @param site whether the organization is to be associated with a main
401            site
402            * @param addresses the organization's addresses
403            * @param emailAddresses the organization's email addresses
404            * @param orgLabors the organization's hours of operation
405            * @param phones the organization's phone numbers
406            * @param websites the organization's websites
407            * @param serviceContext the service context to be applied (optionally
408            <code>null</code>). Can set asset category IDs and asset tag
409            names for the organization, and merge expando bridge
410            attributes for the organization.
411            * @return the organization
412            * @deprecated As of 6.2.0, replaced by {@link #updateOrganization(long,
413            long, String, String, long, long, int, String, boolean,
414            byte[], boolean, List, List, List, List, List,
415            ServiceContext)}
416            */
417            @java.lang.Deprecated
418            public com.liferay.portal.model.Organization updateOrganization(
419                    long organizationId, long parentOrganizationId, java.lang.String name,
420                    java.lang.String type, boolean recursable, long regionId,
421                    long countryId, long statusId, java.lang.String comments, boolean site,
422                    java.util.List<com.liferay.portal.model.Address> addresses,
423                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
424                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
425                    java.util.List<com.liferay.portal.model.Phone> phones,
426                    java.util.List<com.liferay.portal.model.Website> websites,
427                    com.liferay.portal.service.ServiceContext serviceContext)
428                    throws PortalException;
429    
430            /**
431            * Updates the organization.
432            *
433            * @param organizationId the primary key of the organization
434            * @param parentOrganizationId the primary key of the organization's
435            parent organization
436            * @param name the organization's name
437            * @param type the organization's type
438            * @param recursable whether permissions of the organization are to be
439            inherited by its suborganizations
440            * @param regionId the primary key of the organization's region
441            * @param countryId the primary key of the organization's country
442            * @param statusId the organization's workflow status
443            * @param comments the comments about the organization
444            * @param site whether the organization is to be associated with a main
445            site
446            * @param serviceContext the service context to be applied (optionally
447            <code>null</code>). Can set asset category IDs and asset tag
448            names for the organization, and merge expando bridge
449            attributes for the organization.
450            * @return the organization
451            * @deprecated As of 6.2.0, replaced by {@link #updateOrganization(long,
452            long, String, String, long, long, int, String, boolean,
453            ServiceContext)}
454            */
455            @java.lang.Deprecated
456            public com.liferay.portal.model.Organization updateOrganization(
457                    long organizationId, long parentOrganizationId, java.lang.String name,
458                    java.lang.String type, boolean recursable, long regionId,
459                    long countryId, long statusId, java.lang.String comments, boolean site,
460                    com.liferay.portal.service.ServiceContext serviceContext)
461                    throws PortalException;
462    
463            /**
464            * Updates the organization with additional parameters.
465            *
466            * @param organizationId the primary key of the organization
467            * @param parentOrganizationId the primary key of the organization's parent
468            organization
469            * @param name the organization's name
470            * @param type the organization's type
471            * @param regionId the primary key of the organization's region
472            * @param countryId the primary key of the organization's country
473            * @param statusId the organization's workflow status
474            * @param comments the comments about the organization
475            * @param logo whether to update the ogranization's logo
476            * @param logoBytes the new logo image data
477            * @param site whether the organization is to be associated with a main
478            site
479            * @param addresses the organization's addresses
480            * @param emailAddresses the organization's email addresses
481            * @param orgLabors the organization's hours of operation
482            * @param phones the organization's phone numbers
483            * @param websites the organization's websites
484            * @param serviceContext the service context to be applied (optionally
485            <code>null</code>). Can set asset category IDs and asset tag
486            names for the organization, and merge expando bridge attributes
487            for the organization.
488            * @return the organization
489            */
490            public com.liferay.portal.model.Organization updateOrganization(
491                    long organizationId, long parentOrganizationId, java.lang.String name,
492                    java.lang.String type, long regionId, long countryId, long statusId,
493                    java.lang.String comments, boolean logo, byte[] logoBytes,
494                    boolean site,
495                    java.util.List<com.liferay.portal.model.Address> addresses,
496                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
497                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
498                    java.util.List<com.liferay.portal.model.Phone> phones,
499                    java.util.List<com.liferay.portal.model.Website> websites,
500                    com.liferay.portal.service.ServiceContext serviceContext)
501                    throws PortalException;
502    
503            /**
504            * Updates the organization with additional parameters.
505            *
506            * @param organizationId the primary key of the organization
507            * @param parentOrganizationId the primary key of the organization's
508            parent organization
509            * @param name the organization's name
510            * @param type the organization's type
511            * @param regionId the primary key of the organization's region
512            * @param countryId the primary key of the organization's country
513            * @param statusId the organization's workflow status
514            * @param comments the comments about the organization
515            * @param site whether the organization is to be associated with a main
516            site
517            * @param addresses the organization's addresses
518            * @param emailAddresses the organization's email addresses
519            * @param orgLabors the organization's hours of operation
520            * @param phones the organization's phone numbers
521            * @param websites the organization's websites
522            * @param serviceContext the service context to be applied (optionally
523            <code>null</code>). Can set asset category IDs and asset tag
524            names for the organization, and merge expando bridge
525            attributes for the organization.
526            * @return the organization
527            * @deprecated As of 7.0.0, replaced by {@link #updateOrganization(long,
528            long, String, String, long, long, int, String, boolean,
529            byte[], boolean, List, List, List, List, List,
530            ServiceContext)}
531            */
532            @java.lang.Deprecated
533            public com.liferay.portal.model.Organization updateOrganization(
534                    long organizationId, long parentOrganizationId, java.lang.String name,
535                    java.lang.String type, long regionId, long countryId, long statusId,
536                    java.lang.String comments, boolean site,
537                    java.util.List<com.liferay.portal.model.Address> addresses,
538                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
539                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
540                    java.util.List<com.liferay.portal.model.Phone> phones,
541                    java.util.List<com.liferay.portal.model.Website> websites,
542                    com.liferay.portal.service.ServiceContext serviceContext)
543                    throws PortalException;
544    
545            /**
546            * Updates the organization.
547            *
548            * @param organizationId the primary key of the organization
549            * @param parentOrganizationId the primary key of the organization's parent
550            organization
551            * @param name the organization's name
552            * @param type the organization's type
553            * @param regionId the primary key of the organization's region
554            * @param countryId the primary key of the organization's country
555            * @param statusId the organization's workflow status
556            * @param comments the comments about the organization
557            * @param site whether the organization is to be associated with a main
558            site
559            * @param serviceContext the service context to be applied (optionally
560            <code>null</code>). Can set asset category IDs and asset tag
561            names for the organization, and merge expando bridge attributes
562            for the organization.
563            * @return the organization
564            */
565            public com.liferay.portal.model.Organization updateOrganization(
566                    long organizationId, long parentOrganizationId, java.lang.String name,
567                    java.lang.String type, long regionId, long countryId, long statusId,
568                    java.lang.String comments, boolean site,
569                    com.liferay.portal.service.ServiceContext serviceContext)
570                    throws PortalException;
571    }