001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
020    import com.liferay.portal.kernel.transaction.Isolation;
021    import com.liferay.portal.kernel.transaction.Propagation;
022    import com.liferay.portal.kernel.transaction.Transactional;
023    
024    /**
025     * The interface for the organization remote service.
026     *
027     * <p>
028     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
029     * </p>
030     *
031     * @author Brian Wing Shun Chan
032     * @see OrganizationServiceUtil
033     * @see com.liferay.portal.service.base.OrganizationServiceBaseImpl
034     * @see com.liferay.portal.service.impl.OrganizationServiceImpl
035     * @generated
036     */
037    @JSONWebService
038    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
039            PortalException.class, SystemException.class})
040    public interface OrganizationService {
041            /*
042             * NOTE FOR DEVELOPERS:
043             *
044             * 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.
045             */
046    
047            /**
048            * Adds the organizations to the group.
049            *
050            * @param groupId the primary key of the group
051            * @param organizationIds the primary keys of the organizations
052            * @throws PortalException if a group or organization with the primary key
053            could not be found or if the user did not have permission to
054            assign group members
055            * @throws SystemException if a system exception occurred
056            */
057            public void addGroupOrganizations(long groupId, long[] organizationIds)
058                    throws com.liferay.portal.kernel.exception.PortalException,
059                            com.liferay.portal.kernel.exception.SystemException;
060    
061            /**
062            * Adds an organization with additional parameters.
063            *
064            * <p>
065            * This method handles the creation and bookkeeping of the organization
066            * including its resources, metadata, and internal data structures.
067            * </p>
068            *
069            * @param parentOrganizationId the primary key of the organization's parent
070            organization
071            * @param name the organization's name
072            * @param type the organization's type
073            * @param recursable whether the permissions of the organization are to be
074            inherited by its sub-organizations
075            * @param regionId the primary key of the organization's region
076            * @param countryId the primary key of the organization's country
077            * @param statusId the organization's workflow status
078            * @param comments the comments about the organization
079            * @param site whether the organization is to be associated with a main
080            site
081            * @param addresses the organization's addresses
082            * @param emailAddresses the organization's email addresses
083            * @param orgLabors the organization's hours of operation
084            * @param phones the organization's phone numbers
085            * @param websites the organization's websites
086            * @param serviceContext the organization's service context (optionally
087            <code>null</code>). Can specify the organization's asset category
088            IDs, asset tag names, and expando bridge attributes.
089            * @return the organization
090            * @throws PortalException if a parent organization with the primary key
091            could not be found, if the organization's information was
092            invalid, or if the user did not have permission to add the
093            organization
094            * @throws SystemException if a system exception occurred
095            */
096            public com.liferay.portal.model.Organization addOrganization(
097                    long parentOrganizationId, java.lang.String name,
098                    java.lang.String type, boolean recursable, long regionId,
099                    long countryId, int statusId, java.lang.String comments, boolean site,
100                    java.util.List<com.liferay.portal.model.Address> addresses,
101                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
102                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
103                    java.util.List<com.liferay.portal.model.Phone> phones,
104                    java.util.List<com.liferay.portal.model.Website> websites,
105                    com.liferay.portal.service.ServiceContext serviceContext)
106                    throws com.liferay.portal.kernel.exception.PortalException,
107                            com.liferay.portal.kernel.exception.SystemException;
108    
109            /**
110            * Adds an organization.
111            *
112            * <p>
113            * This method handles the creation and bookkeeping of the organization
114            * including its resources, metadata, and internal data structures.
115            * </p>
116            *
117            * @param parentOrganizationId the primary key of the organization's parent
118            organization
119            * @param name the organization's name
120            * @param type the organization's type
121            * @param recursable whether the permissions of the organization are to be
122            inherited by its sub-organizations
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 organization's service context (optionally
130            <code>null</code>). Can specify the organization's asset category
131            IDs, asset tag names, and expando bridge attributes.
132            * @return the organization
133            * @throws PortalException if the parent organization with the primary key
134            could not be found, if the organization information was invalid,
135            or if the user did not have permission to add the organization
136            * @throws SystemException if a system exception occurred
137            */
138            public com.liferay.portal.model.Organization addOrganization(
139                    long parentOrganizationId, java.lang.String name,
140                    java.lang.String type, boolean recursable, long regionId,
141                    long countryId, int statusId, java.lang.String comments, boolean site,
142                    com.liferay.portal.service.ServiceContext serviceContext)
143                    throws com.liferay.portal.kernel.exception.PortalException,
144                            com.liferay.portal.kernel.exception.SystemException;
145    
146            /**
147            * Assigns the password policy to the organizations, removing any other
148            * currently assigned password policies.
149            *
150            * @param passwordPolicyId the primary key of the password policy
151            * @param organizationIds the primary keys of the organizations
152            * @throws PortalException if the user did not have permission to update the
153            password policy
154            * @throws SystemException if a system exception occurred
155            */
156            public void addPasswordPolicyOrganizations(long passwordPolicyId,
157                    long[] organizationIds)
158                    throws com.liferay.portal.kernel.exception.PortalException,
159                            com.liferay.portal.kernel.exception.SystemException;
160    
161            /**
162            * Deletes the logo of the organization.
163            *
164            * @param organizationId the primary key of the organization
165            * @throws PortalException if an organization with the primary key could not
166            be found, if the organization's logo could not be found, or if
167            the user did not have permission to update the organization
168            * @throws SystemException if a system exception occurred
169            */
170            public void deleteLogo(long organizationId)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException;
173    
174            /**
175            * Deletes the organization. The organization's associated resources and
176            * assets are also deleted.
177            *
178            * @param organizationId the primary key of the organization
179            * @throws PortalException if an organization with the primary key could not
180            be found, if the user did not have permission to delete the
181            organization, if the organization had a workflow in approved
182            status, or if the organization was a parent organization
183            * @throws SystemException if a system exception occurred
184            */
185            public void deleteOrganization(long organizationId)
186                    throws com.liferay.portal.kernel.exception.PortalException,
187                            com.liferay.portal.kernel.exception.SystemException;
188    
189            /**
190            * Returns all the organizations which the user has permission to manage.
191            *
192            * @param actionId the permitted action
193            * @param max the maximum number of the organizations to be considered
194            * @return the organizations which the user has permission to manage
195            * @throws PortalException if a portal exception occurred
196            * @throws SystemException if a system exception occurred
197            * @deprecated Replaced by {@link #getOrganizations(long, long, int, int)}
198            */
199            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200            public java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
201                    java.lang.String actionId, int max)
202                    throws com.liferay.portal.kernel.exception.PortalException,
203                            com.liferay.portal.kernel.exception.SystemException;
204    
205            /**
206            * Returns the organization with the primary key.
207            *
208            * @param organizationId the primary key of the organization
209            * @return the organization with the primary key
210            * @throws PortalException if an organization with the primary key could not
211            be found or if the user did not have permission to view the
212            organization
213            * @throws SystemException if a system exception occurred
214            */
215            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
216            public com.liferay.portal.model.Organization getOrganization(
217                    long organizationId)
218                    throws com.liferay.portal.kernel.exception.PortalException,
219                            com.liferay.portal.kernel.exception.SystemException;
220    
221            /**
222            * Returns the primary key of the organization with the name.
223            *
224            * @param companyId the primary key of the organization's company
225            * @param name the organization's name
226            * @return the primary key of the organization with the name, or
227            <code>0</code> if the organization could not be found
228            * @throws SystemException if a system exception occurred
229            */
230            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
231            public long getOrganizationId(long companyId, java.lang.String name)
232                    throws com.liferay.portal.kernel.exception.SystemException;
233    
234            /**
235            * Returns all the organizations belonging to the parent organization.
236            *
237            * @param companyId the primary key of the organizations' company
238            * @param parentOrganizationId the primary key of the organizations' parent
239            organization
240            * @return the organizations belonging to the parent organization
241            * @throws SystemException if a system exception occurred
242            */
243            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
244            public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
245                    long companyId, long parentOrganizationId)
246                    throws com.liferay.portal.kernel.exception.SystemException;
247    
248            /**
249            * Returns a range of all the organizations belonging to the parent
250            * organization.
251            *
252            * <p>
253            * Useful when paginating results. Returns a maximum of <code>end -
254            * start</code> instances. <code>start</code> and <code>end</code> are not
255            * primary keys, they are indexes in the result set. Thus, <code>0</code>
256            * refers to the first result in the set. Setting both <code>start</code>
257            * and <code>end</code> to {@link
258            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
259            * result set.
260            * </p>
261            *
262            * @param companyId the primary key of the organizations' company
263            * @param parentOrganizationId the primary key of the organizations' parent
264            organization
265            * @param start the lower bound of the range of organizations to return
266            * @param end the upper bound of the range of organizations to return (not
267            inclusive)
268            * @return the range of organizations belonging to the parent organization
269            * @throws SystemException if a system exception occurred
270            */
271            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
272            public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
273                    long companyId, long parentOrganizationId, int start, int end)
274                    throws com.liferay.portal.kernel.exception.SystemException;
275    
276            /**
277            * Returns the number of organizations belonging to the parent organization.
278            *
279            * @param companyId the primary key of the organizations' company
280            * @param parentOrganizationId the primary key of the organizations' parent
281            organization
282            * @return the number of organizations belonging to the parent organization
283            * @throws SystemException if a system exception occurred
284            */
285            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
286            public int getOrganizationsCount(long companyId, long parentOrganizationId)
287                    throws com.liferay.portal.kernel.exception.SystemException;
288    
289            /**
290            * Returns all the organizations associated with the user.
291            *
292            * @param userId the primary key of the user
293            * @return the organizations associated with the user
294            * @throws PortalException if a user with the primary key could not be found
295            * @throws SystemException if a system exception occurred
296            */
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
299                    long userId)
300                    throws com.liferay.portal.kernel.exception.PortalException,
301                            com.liferay.portal.kernel.exception.SystemException;
302    
303            /**
304            * Returns all the organizations associated with the user, optionally
305            * including the organizations associated with the user groups to which the
306            * user belongs.
307            *
308            * @param userId the primary key of the user
309            * @param inheritUserGroups whether to include organizations associated
310            with the user groups to which the user belongs
311            * @return the organizations associated with the user
312            * @throws PortalException if a user with the primary key could not be found
313            * @throws SystemException if a system exception occurred
314            */
315            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
316            public java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
317                    long userId, boolean inheritUserGroups)
318                    throws com.liferay.portal.kernel.exception.PortalException,
319                            com.liferay.portal.kernel.exception.SystemException;
320    
321            /**
322            * Sets the organizations in the group, removing and adding organizations to
323            * the group as necessary.
324            *
325            * @param groupId the primary key of the group
326            * @param organizationIds the primary keys of the organizations
327            * @throws PortalException if a group or organization with the primary key
328            could not be found or if the user did not have permission to
329            assign group members
330            * @throws SystemException if a system exception occurred
331            */
332            public void setGroupOrganizations(long groupId, long[] organizationIds)
333                    throws com.liferay.portal.kernel.exception.PortalException,
334                            com.liferay.portal.kernel.exception.SystemException;
335    
336            /**
337            * Removes the organizations from the group.
338            *
339            * @param groupId the primary key of the group
340            * @param organizationIds the primary keys of the organizations
341            * @throws PortalException if a group or organization with the primary key
342            could not be found or if the user did not have permission to
343            assign group members
344            * @throws SystemException if a system exception occurred
345            */
346            public void unsetGroupOrganizations(long groupId, long[] organizationIds)
347                    throws com.liferay.portal.kernel.exception.PortalException,
348                            com.liferay.portal.kernel.exception.SystemException;
349    
350            /**
351            * Removes the organizations from the password policy.
352            *
353            * @param passwordPolicyId the primary key of the password policy
354            * @param organizationIds the primary keys of the organizations
355            * @throws PortalException if a password policy or organization with the
356            primary key could not be found, or if the user did not have
357            permission to update the password policy.
358            * @throws SystemException if a system exception occurred
359            */
360            public void unsetPasswordPolicyOrganizations(long passwordPolicyId,
361                    long[] organizationIds)
362                    throws com.liferay.portal.kernel.exception.PortalException,
363                            com.liferay.portal.kernel.exception.SystemException;
364    
365            /**
366            * Updates the organization with additional parameters.
367            *
368            * @param organizationId the primary key of the organization
369            * @param parentOrganizationId the primary key of the organization's parent
370            organization
371            * @param name the organization's name
372            * @param type the organization's type
373            * @param recursable whether the permissions of the organization are to be
374            inherited by its sub-organizations
375            * @param regionId the primary key of the organization's region
376            * @param countryId the primary key of the organization's country
377            * @param statusId the organization's workflow status
378            * @param comments the comments about the organization
379            * @param site whether the organization is to be associated with a main
380            site
381            * @param addresses the organization's addresses
382            * @param emailAddresses the organization's email addresses
383            * @param orgLabors the organization's hours of operation
384            * @param phones the organization's phone numbers
385            * @param websites the organization's websites
386            * @param serviceContext the organization's service context (optionally
387            <code>null</code>). Can specify the organization's replacement
388            asset category IDs, replacement asset tag names, and new expando
389            bridge attributes.
390            * @return the organization
391            * @throws PortalException if an organization or parent organization with
392            the primary key could not be found, if the user did not have
393            permission to update the organization information, or if the new
394            information was invalid
395            * @throws SystemException if a system exception occurred
396            */
397            public com.liferay.portal.model.Organization updateOrganization(
398                    long organizationId, long parentOrganizationId, java.lang.String name,
399                    java.lang.String type, boolean recursable, long regionId,
400                    long countryId, int statusId, java.lang.String comments, boolean site,
401                    java.util.List<com.liferay.portal.model.Address> addresses,
402                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
403                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
404                    java.util.List<com.liferay.portal.model.Phone> phones,
405                    java.util.List<com.liferay.portal.model.Website> websites,
406                    com.liferay.portal.service.ServiceContext serviceContext)
407                    throws com.liferay.portal.kernel.exception.PortalException,
408                            com.liferay.portal.kernel.exception.SystemException;
409    
410            /**
411            * Updates the organization.
412            *
413            * @param organizationId the primary key of the organization
414            * @param parentOrganizationId the primary key of the organization's parent
415            organization
416            * @param name the organization's name
417            * @param type the organization's type
418            * @param recursable whether permissions of the organization are to be
419            inherited by its sub-organizations
420            * @param regionId the primary key of the organization's region
421            * @param countryId the primary key of the organization's country
422            * @param statusId the organization's workflow status
423            * @param comments the comments about the organization
424            * @param site whether the organization is to be associated with a main
425            site
426            * @param serviceContext the organization's service context (optionally
427            <code>null</code>). Can specify the organization's replacement
428            asset category IDs, replacement asset tag names, and new expando
429            bridge attributes.
430            * @return the organization
431            * @throws PortalException if an organization or parent organization with
432            the primary key could not be found, if the user did not have
433            permission to update the organization, or if the new information
434            was invalid
435            * @throws SystemException if a system exception occurred
436            */
437            public com.liferay.portal.model.Organization updateOrganization(
438                    long organizationId, long parentOrganizationId, java.lang.String name,
439                    java.lang.String type, boolean recursable, long regionId,
440                    long countryId, int statusId, java.lang.String comments, boolean site,
441                    com.liferay.portal.service.ServiceContext serviceContext)
442                    throws com.liferay.portal.kernel.exception.PortalException,
443                            com.liferay.portal.kernel.exception.SystemException;
444    }