001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the remote service utility for Organization. This utility wraps
024     * {@link com.liferay.portal.service.impl.OrganizationServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on a remote server. Methods of this service are expected to have security
027     * checks based on the propagated JAAS credentials because this service can be
028     * accessed remotely.
029     *
030     * @author Brian Wing Shun Chan
031     * @see OrganizationService
032     * @see com.liferay.portal.service.base.OrganizationServiceBaseImpl
033     * @see com.liferay.portal.service.impl.OrganizationServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class OrganizationServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.OrganizationServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the organizations to the group.
046            *
047            * @param groupId the primary key of the group
048            * @param organizationIds the primary keys of the organizations
049            */
050            public static void addGroupOrganizations(long groupId,
051                    long[] organizationIds)
052                    throws com.liferay.portal.kernel.exception.PortalException {
053                    getService().addGroupOrganizations(groupId, organizationIds);
054            }
055    
056            /**
057            * Adds an organization with additional parameters.
058            *
059            * <p>
060            * This method handles the creation and bookkeeping of the organization
061            * including its resources, metadata, and internal data structures.
062            * </p>
063            *
064            * @param parentOrganizationId the primary key of the organization's parent
065            organization
066            * @param name the organization's name
067            * @param type the organization's type
068            * @param regionId the primary key of the organization's region
069            * @param countryId the primary key of the organization's country
070            * @param statusId the organization's workflow status
071            * @param comments the comments about the organization
072            * @param site whether the organization is to be associated with a main
073            site
074            * @param addresses the organization's addresses
075            * @param emailAddresses the organization's email addresses
076            * @param orgLabors the organization's hours of operation
077            * @param phones the organization's phone numbers
078            * @param websites the organization's websites
079            * @param serviceContext the service context to be applied (optionally
080            <code>null</code>). Can set asset category IDs, asset tag names,
081            and expando bridge attributes for the organization.
082            * @return the organization
083            */
084            public static com.liferay.portal.kernel.model.Organization addOrganization(
085                    long parentOrganizationId, java.lang.String name,
086                    java.lang.String type, long regionId, long countryId, long statusId,
087                    java.lang.String comments, boolean site,
088                    java.util.List<com.liferay.portal.kernel.model.Address> addresses,
089                    java.util.List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
090                    java.util.List<com.liferay.portal.kernel.model.OrgLabor> orgLabors,
091                    java.util.List<com.liferay.portal.kernel.model.Phone> phones,
092                    java.util.List<com.liferay.portal.kernel.model.Website> websites,
093                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
094                    throws com.liferay.portal.kernel.exception.PortalException {
095                    return getService()
096                                       .addOrganization(parentOrganizationId, name, type, regionId,
097                            countryId, statusId, comments, site, addresses, emailAddresses,
098                            orgLabors, phones, websites, serviceContext);
099            }
100    
101            /**
102            * Adds an organization.
103            *
104            * <p>
105            * This method handles the creation and bookkeeping of the organization
106            * including its resources, metadata, and internal data structures.
107            * </p>
108            *
109            * @param parentOrganizationId the primary key of the organization's parent
110            organization
111            * @param name the organization's name
112            * @param type the organization's type
113            * @param regionId the primary key of the organization's region
114            * @param countryId the primary key of the organization's country
115            * @param statusId the organization's workflow status
116            * @param comments the comments about the organization
117            * @param site whether the organization is to be associated with a main
118            site
119            * @param serviceContext the service context to be applied (optionally
120            <code>null</code>). Can set asset category IDs, asset tag names,
121            and expando bridge attributes for the organization.
122            * @return the organization
123            */
124            public static com.liferay.portal.kernel.model.Organization addOrganization(
125                    long parentOrganizationId, java.lang.String name,
126                    java.lang.String type, long regionId, long countryId, long statusId,
127                    java.lang.String comments, boolean site,
128                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
129                    throws com.liferay.portal.kernel.exception.PortalException {
130                    return getService()
131                                       .addOrganization(parentOrganizationId, name, type, regionId,
132                            countryId, statusId, comments, site, serviceContext);
133            }
134    
135            /**
136            * Assigns the password policy to the organizations, removing any other
137            * currently assigned password policies.
138            *
139            * @param passwordPolicyId the primary key of the password policy
140            * @param organizationIds the primary keys of the organizations
141            */
142            public static void addPasswordPolicyOrganizations(long passwordPolicyId,
143                    long[] organizationIds)
144                    throws com.liferay.portal.kernel.exception.PortalException {
145                    getService()
146                            .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
147            }
148    
149            /**
150            * Deletes the organization's logo.
151            *
152            * @param organizationId the primary key of the organization
153            */
154            public static void deleteLogo(long organizationId)
155                    throws com.liferay.portal.kernel.exception.PortalException {
156                    getService().deleteLogo(organizationId);
157            }
158    
159            /**
160            * Deletes the organization. The organization's associated resources and
161            * assets are also deleted.
162            *
163            * @param organizationId the primary key of the organization
164            */
165            public static void deleteOrganization(long organizationId)
166                    throws com.liferay.portal.kernel.exception.PortalException {
167                    getService().deleteOrganization(organizationId);
168            }
169    
170            /**
171            * Returns the organization with the primary key.
172            *
173            * @param organizationId the primary key of the organization
174            * @return the organization with the primary key, or <code>null</code> if an
175            organization with the primary key could not be found or if the
176            user did not have permission to view the organization
177            */
178            public static com.liferay.portal.kernel.model.Organization fetchOrganization(
179                    long organizationId)
180                    throws com.liferay.portal.kernel.exception.PortalException {
181                    return getService().fetchOrganization(organizationId);
182            }
183    
184            /**
185            * Returns the OSGi service identifier.
186            *
187            * @return the OSGi service identifier
188            */
189            public static java.lang.String getOSGiServiceIdentifier() {
190                    return getService().getOSGiServiceIdentifier();
191            }
192    
193            /**
194            * Returns the organization with the primary key.
195            *
196            * @param organizationId the primary key of the organization
197            * @return the organization with the primary key
198            */
199            public static com.liferay.portal.kernel.model.Organization getOrganization(
200                    long organizationId)
201                    throws com.liferay.portal.kernel.exception.PortalException {
202                    return getService().getOrganization(organizationId);
203            }
204    
205            /**
206            * Returns the primary key of the organization with the name.
207            *
208            * @param companyId the primary key of the organization's company
209            * @param name the organization's name
210            * @return the primary key of the organization with the name, or
211            <code>0</code> if the organization could not be found
212            */
213            public static long getOrganizationId(long companyId, java.lang.String name)
214                    throws com.liferay.portal.kernel.exception.PortalException {
215                    return getService().getOrganizationId(companyId, name);
216            }
217    
218            /**
219            * Returns all the organizations belonging to the parent organization.
220            *
221            * @param companyId the primary key of the organizations' company
222            * @param parentOrganizationId the primary key of the organizations' parent
223            organization
224            * @return the organizations belonging to the parent organization
225            */
226            public static java.util.List<com.liferay.portal.kernel.model.Organization> getOrganizations(
227                    long companyId, long parentOrganizationId) {
228                    return getService().getOrganizations(companyId, parentOrganizationId);
229            }
230    
231            /**
232            * Returns a range of all the organizations belonging to the parent
233            * organization.
234            *
235            * <p>
236            * Useful when paginating results. Returns a maximum of <code>end -
237            * start</code> instances. <code>start</code> and <code>end</code> are not
238            * primary keys, they are indexes in the result set. Thus, <code>0</code>
239            * refers to the first result in the set. Setting both <code>start</code>
240            * and <code>end</code> to {@link
241            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
242            * result set.
243            * </p>
244            *
245            * @param companyId the primary key of the organizations' company
246            * @param parentOrganizationId the primary key of the organizations' parent
247            organization
248            * @param start the lower bound of the range of organizations to return
249            * @param end the upper bound of the range of organizations to return (not
250            inclusive)
251            * @return the range of organizations belonging to the parent organization
252            */
253            public static java.util.List<com.liferay.portal.kernel.model.Organization> getOrganizations(
254                    long companyId, long parentOrganizationId, int start, int end) {
255                    return getService()
256                                       .getOrganizations(companyId, parentOrganizationId, start, end);
257            }
258    
259            /**
260            * Returns the number of organizations belonging to the parent organization.
261            *
262            * @param companyId the primary key of the organizations' company
263            * @param parentOrganizationId the primary key of the organizations' parent
264            organization
265            * @return the number of organizations belonging to the parent organization
266            */
267            public static int getOrganizationsCount(long companyId,
268                    long parentOrganizationId) {
269                    return getService()
270                                       .getOrganizationsCount(companyId, parentOrganizationId);
271            }
272    
273            /**
274            * Returns all the organizations with which the user is explicitly
275            * associated.
276            *
277            * <p>
278            * A user is considered to be <i>explicitly</i> associated with an
279            * organization if his account is individually created within the
280            * organization or if the user is later added as a member.
281            * </p>
282            *
283            * @param userId the primary key of the user
284            * @return the organizations with which the user is explicitly associated
285            */
286            public static java.util.List<com.liferay.portal.kernel.model.Organization> getUserOrganizations(
287                    long userId) throws com.liferay.portal.kernel.exception.PortalException {
288                    return getService().getUserOrganizations(userId);
289            }
290    
291            /**
292            * Sets the organizations in the group, removing and adding organizations to
293            * the group as necessary.
294            *
295            * @param groupId the primary key of the group
296            * @param organizationIds the primary keys of the organizations
297            */
298            public static void setGroupOrganizations(long groupId,
299                    long[] organizationIds)
300                    throws com.liferay.portal.kernel.exception.PortalException {
301                    getService().setGroupOrganizations(groupId, organizationIds);
302            }
303    
304            /**
305            * Removes the organizations from the group.
306            *
307            * @param groupId the primary key of the group
308            * @param organizationIds the primary keys of the organizations
309            */
310            public static void unsetGroupOrganizations(long groupId,
311                    long[] organizationIds)
312                    throws com.liferay.portal.kernel.exception.PortalException {
313                    getService().unsetGroupOrganizations(groupId, organizationIds);
314            }
315    
316            /**
317            * Removes the organizations from the password policy.
318            *
319            * @param passwordPolicyId the primary key of the password policy
320            * @param organizationIds the primary keys of the organizations
321            */
322            public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
323                    long[] organizationIds)
324                    throws com.liferay.portal.kernel.exception.PortalException {
325                    getService()
326                            .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
327            }
328    
329            /**
330            * Updates the organization with additional parameters.
331            *
332            * @param organizationId the primary key of the organization
333            * @param parentOrganizationId the primary key of the organization's parent
334            organization
335            * @param name the organization's name
336            * @param type the organization's type
337            * @param regionId the primary key of the organization's region
338            * @param countryId the primary key of the organization's country
339            * @param statusId the organization's workflow status
340            * @param comments the comments about the organization
341            * @param logo whether to update the ogranization's logo
342            * @param logoBytes the new logo image data
343            * @param site whether the organization is to be associated with a main
344            site
345            * @param addresses the organization's addresses
346            * @param emailAddresses the organization's email addresses
347            * @param orgLabors the organization's hours of operation
348            * @param phones the organization's phone numbers
349            * @param websites the organization's websites
350            * @param serviceContext the service context to be applied (optionally
351            <code>null</code>). Can set asset category IDs and asset tag
352            names for the organization, and merge expando bridge attributes
353            for the organization.
354            * @return the organization
355            */
356            public static com.liferay.portal.kernel.model.Organization updateOrganization(
357                    long organizationId, long parentOrganizationId, java.lang.String name,
358                    java.lang.String type, long regionId, long countryId, long statusId,
359                    java.lang.String comments, boolean logo, byte[] logoBytes,
360                    boolean site,
361                    java.util.List<com.liferay.portal.kernel.model.Address> addresses,
362                    java.util.List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
363                    java.util.List<com.liferay.portal.kernel.model.OrgLabor> orgLabors,
364                    java.util.List<com.liferay.portal.kernel.model.Phone> phones,
365                    java.util.List<com.liferay.portal.kernel.model.Website> websites,
366                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
367                    throws com.liferay.portal.kernel.exception.PortalException {
368                    return getService()
369                                       .updateOrganization(organizationId, parentOrganizationId,
370                            name, type, regionId, countryId, statusId, comments, logo,
371                            logoBytes, site, addresses, emailAddresses, orgLabors, phones,
372                            websites, serviceContext);
373            }
374    
375            /**
376            * Updates the organization with additional parameters.
377            *
378            * @param organizationId the primary key of the organization
379            * @param parentOrganizationId the primary key of the organization's
380            parent organization
381            * @param name the organization's name
382            * @param type the organization's type
383            * @param regionId the primary key of the organization's region
384            * @param countryId the primary key of the organization's country
385            * @param statusId the organization's workflow status
386            * @param comments the comments about the organization
387            * @param site whether the organization is to be associated with a main
388            site
389            * @param addresses the organization's addresses
390            * @param emailAddresses the organization's email addresses
391            * @param orgLabors the organization's hours of operation
392            * @param phones the organization's phone numbers
393            * @param websites the organization's websites
394            * @param serviceContext the service context to be applied (optionally
395            <code>null</code>). Can set asset category IDs and asset tag
396            names for the organization, and merge expando bridge
397            attributes for the organization.
398            * @return the organization
399            * @deprecated As of 7.0.0, replaced by {@link #updateOrganization(long,
400            long, String, String, long, long, long, String, boolean,
401            byte[], boolean, List, List, List, List, List,
402            ServiceContext)}
403            */
404            @Deprecated
405            public static com.liferay.portal.kernel.model.Organization updateOrganization(
406                    long organizationId, long parentOrganizationId, java.lang.String name,
407                    java.lang.String type, long regionId, long countryId, long statusId,
408                    java.lang.String comments, boolean site,
409                    java.util.List<com.liferay.portal.kernel.model.Address> addresses,
410                    java.util.List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
411                    java.util.List<com.liferay.portal.kernel.model.OrgLabor> orgLabors,
412                    java.util.List<com.liferay.portal.kernel.model.Phone> phones,
413                    java.util.List<com.liferay.portal.kernel.model.Website> websites,
414                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
415                    throws com.liferay.portal.kernel.exception.PortalException {
416                    return getService()
417                                       .updateOrganization(organizationId, parentOrganizationId,
418                            name, type, regionId, countryId, statusId, comments, site,
419                            addresses, emailAddresses, orgLabors, phones, websites,
420                            serviceContext);
421            }
422    
423            /**
424            * Updates the organization.
425            *
426            * @param organizationId the primary key of the organization
427            * @param parentOrganizationId the primary key of the organization's parent
428            organization
429            * @param name the organization's name
430            * @param type the organization's type
431            * @param regionId the primary key of the organization's region
432            * @param countryId the primary key of the organization's country
433            * @param statusId the organization's workflow status
434            * @param comments the comments about the organization
435            * @param site whether the organization is to be associated with a main
436            site
437            * @param serviceContext the service context to be applied (optionally
438            <code>null</code>). Can set asset category IDs and asset tag
439            names for the organization, and merge expando bridge attributes
440            for the organization.
441            * @return the organization
442            */
443            public static com.liferay.portal.kernel.model.Organization updateOrganization(
444                    long organizationId, long parentOrganizationId, java.lang.String name,
445                    java.lang.String type, long regionId, long countryId, long statusId,
446                    java.lang.String comments, boolean site,
447                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
448                    throws com.liferay.portal.kernel.exception.PortalException {
449                    return getService()
450                                       .updateOrganization(organizationId, parentOrganizationId,
451                            name, type, regionId, countryId, statusId, comments, site,
452                            serviceContext);
453            }
454    
455            public static OrganizationService getService() {
456                    if (_service == null) {
457                            _service = (OrganizationService)PortalBeanLocatorUtil.locate(OrganizationService.class.getName());
458    
459                            ReferenceRegistry.registerReference(OrganizationServiceUtil.class,
460                                    "_service");
461                    }
462    
463                    return _service;
464            }
465    
466            private static OrganizationService _service;
467    }