001    /**
002     * Copyright (c) 2000-2013 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    
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 suborganizations
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 suborganizations
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 PortalException if the user did not have permission to view the
243            organization
244            * @throws SystemException if a system exception occurred
245            */
246            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
247            public long getOrganizationId(long companyId, java.lang.String name)
248                    throws com.liferay.portal.kernel.exception.PortalException,
249                            com.liferay.portal.kernel.exception.SystemException;
250    
251            /**
252            * Returns all the organizations belonging to the parent organization.
253            *
254            * @param companyId the primary key of the organizations' company
255            * @param parentOrganizationId the primary key of the organizations' parent
256            organization
257            * @return the organizations belonging to the parent organization
258            * @throws SystemException if a system exception occurred
259            */
260            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261            public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
262                    long companyId, long parentOrganizationId)
263                    throws com.liferay.portal.kernel.exception.SystemException;
264    
265            /**
266            * Returns a range of all the organizations belonging to the parent
267            * organization.
268            *
269            * <p>
270            * Useful when paginating results. Returns a maximum of <code>end -
271            * start</code> instances. <code>start</code> and <code>end</code> are not
272            * primary keys, they are indexes in the result set. Thus, <code>0</code>
273            * refers to the first result in the set. Setting both <code>start</code>
274            * and <code>end</code> to {@link
275            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
276            * result set.
277            * </p>
278            *
279            * @param companyId the primary key of the organizations' company
280            * @param parentOrganizationId the primary key of the organizations' parent
281            organization
282            * @param start the lower bound of the range of organizations to return
283            * @param end the upper bound of the range of organizations to return (not
284            inclusive)
285            * @return the range of organizations belonging to the parent organization
286            * @throws SystemException if a system exception occurred
287            */
288            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
289            public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
290                    long companyId, long parentOrganizationId, int start, int end)
291                    throws com.liferay.portal.kernel.exception.SystemException;
292    
293            /**
294            * Returns the number of organizations belonging to the parent organization.
295            *
296            * @param companyId the primary key of the organizations' company
297            * @param parentOrganizationId the primary key of the organizations' parent
298            organization
299            * @return the number of organizations belonging to the parent organization
300            * @throws SystemException if a system exception occurred
301            */
302            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
303            public int getOrganizationsCount(long companyId, long parentOrganizationId)
304                    throws com.liferay.portal.kernel.exception.SystemException;
305    
306            /**
307            * Returns all the organizations associated with the user.
308            *
309            * @param userId the primary key of the user
310            * @return the organizations associated with the user
311            * @throws PortalException if a user with the primary key could not be found
312            * @throws SystemException if a system exception occurred
313            */
314            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
315            public java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
316                    long userId)
317                    throws com.liferay.portal.kernel.exception.PortalException,
318                            com.liferay.portal.kernel.exception.SystemException;
319    
320            /**
321            * Sets the organizations in the group, removing and adding organizations to
322            * the group as necessary.
323            *
324            * @param groupId the primary key of the group
325            * @param organizationIds the primary keys of the organizations
326            * @throws PortalException if a group or organization with the primary key
327            could not be found or if the user did not have permission to
328            assign group members
329            * @throws SystemException if a system exception occurred
330            */
331            public void setGroupOrganizations(long groupId, long[] organizationIds)
332                    throws com.liferay.portal.kernel.exception.PortalException,
333                            com.liferay.portal.kernel.exception.SystemException;
334    
335            /**
336            * Removes the organizations from the group.
337            *
338            * @param groupId the primary key of the group
339            * @param organizationIds the primary keys of the organizations
340            * @throws PortalException if a group or organization with the primary key
341            could not be found or if the user did not have permission to
342            assign group members
343            * @throws SystemException if a system exception occurred
344            */
345            public void unsetGroupOrganizations(long groupId, long[] organizationIds)
346                    throws com.liferay.portal.kernel.exception.PortalException,
347                            com.liferay.portal.kernel.exception.SystemException;
348    
349            /**
350            * Removes the organizations from the password policy.
351            *
352            * @param passwordPolicyId the primary key of the password policy
353            * @param organizationIds the primary keys of the organizations
354            * @throws PortalException if a password policy or organization with the
355            primary key could not be found, or if the user did not have
356            permission to update the password policy
357            * @throws SystemException if a system exception occurred
358            */
359            public void unsetPasswordPolicyOrganizations(long passwordPolicyId,
360                    long[] organizationIds)
361                    throws com.liferay.portal.kernel.exception.PortalException,
362                            com.liferay.portal.kernel.exception.SystemException;
363    
364            /**
365            * Updates the organization with additional parameters.
366            *
367            * @param organizationId the primary key of the organization
368            * @param parentOrganizationId the primary key of the organization's parent
369            organization
370            * @param name the organization's name
371            * @param type the organization's type
372            * @param recursable whether the permissions of the organization are to be
373            inherited by its suborganizations
374            * @param regionId the primary key of the organization's region
375            * @param countryId the primary key of the organization's country
376            * @param statusId the organization's workflow status
377            * @param comments the comments about the organization
378            * @param site whether the organization is to be associated with a main
379            site
380            * @param addresses the organization's addresses
381            * @param emailAddresses the organization's email addresses
382            * @param orgLabors the organization's hours of operation
383            * @param phones the organization's phone numbers
384            * @param websites the organization's websites
385            * @param serviceContext the organization's service context (optionally
386            <code>null</code>). Can set asset category IDs and asset tag
387            names for the organization, and merge expando bridge attributes
388            for the organization.
389            * @return the organization
390            * @throws PortalException if an organization or parent organization with
391            the primary key could not be found, if the user did not have
392            permission to update the organization information, or if the new
393            information was invalid
394            * @throws SystemException if a system exception occurred
395            */
396            public com.liferay.portal.model.Organization updateOrganization(
397                    long organizationId, long parentOrganizationId, java.lang.String name,
398                    java.lang.String type, boolean recursable, long regionId,
399                    long countryId, int statusId, java.lang.String comments, boolean site,
400                    java.util.List<com.liferay.portal.model.Address> addresses,
401                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
402                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
403                    java.util.List<com.liferay.portal.model.Phone> phones,
404                    java.util.List<com.liferay.portal.model.Website> websites,
405                    com.liferay.portal.service.ServiceContext serviceContext)
406                    throws com.liferay.portal.kernel.exception.PortalException,
407                            com.liferay.portal.kernel.exception.SystemException;
408    
409            /**
410            * Updates the organization.
411            *
412            * @param organizationId the primary key of the organization
413            * @param parentOrganizationId the primary key of the organization's parent
414            organization
415            * @param name the organization's name
416            * @param type the organization's type
417            * @param recursable whether permissions of the organization are to be
418            inherited by its suborganizations
419            * @param regionId the primary key of the organization's region
420            * @param countryId the primary key of the organization's country
421            * @param statusId the organization's workflow status
422            * @param comments the comments about the organization
423            * @param site whether the organization is to be associated with a main
424            site
425            * @param serviceContext the organization's service context (optionally
426            <code>null</code>). Can set asset category IDs and asset tag
427            names for the organization, and merge expando bridge attributes
428            for the organization.
429            * @return the organization
430            * @throws PortalException if an organization or parent organization with
431            the primary key could not be found, if the user did not have
432            permission to update the organization, or if the new information
433            was invalid
434            * @throws SystemException if a system exception occurred
435            */
436            public com.liferay.portal.model.Organization updateOrganization(
437                    long organizationId, long parentOrganizationId, java.lang.String name,
438                    java.lang.String type, boolean recursable, long regionId,
439                    long countryId, int statusId, java.lang.String comments, boolean site,
440                    com.liferay.portal.service.ServiceContext serviceContext)
441                    throws com.liferay.portal.kernel.exception.PortalException,
442                            com.liferay.portal.kernel.exception.SystemException;
443    }