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