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