001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the organization remote service. This utility wraps {@link com.liferay.portal.service.impl.OrganizationServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * 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.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see OrganizationService
030     * @see com.liferay.portal.service.base.OrganizationServiceBaseImpl
031     * @see com.liferay.portal.service.impl.OrganizationServiceImpl
032     * @generated
033     */
034    public class OrganizationServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.OrganizationServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static void addGroupOrganizations(long groupId,
041                    long[] organizationIds)
042                    throws com.liferay.portal.kernel.exception.PortalException,
043                            com.liferay.portal.kernel.exception.SystemException {
044                    getService().addGroupOrganizations(groupId, organizationIds);
045            }
046    
047            public static com.liferay.portal.model.Organization addOrganization(
048                    long parentOrganizationId, java.lang.String name,
049                    java.lang.String type, boolean recursable, long regionId,
050                    long countryId, int statusId, java.lang.String comments,
051                    java.util.List<com.liferay.portal.model.Address> addresses,
052                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
053                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
054                    java.util.List<com.liferay.portal.model.Phone> phones,
055                    java.util.List<com.liferay.portal.model.Website> websites,
056                    com.liferay.portal.service.ServiceContext serviceContext)
057                    throws com.liferay.portal.kernel.exception.PortalException,
058                            com.liferay.portal.kernel.exception.SystemException {
059                    return getService()
060                                       .addOrganization(parentOrganizationId, name, type,
061                            recursable, regionId, countryId, statusId, comments, addresses,
062                            emailAddresses, orgLabors, phones, websites, serviceContext);
063            }
064    
065            public static com.liferay.portal.model.Organization addOrganization(
066                    long parentOrganizationId, java.lang.String name,
067                    java.lang.String type, boolean recursable, long regionId,
068                    long countryId, int statusId, java.lang.String comments,
069                    com.liferay.portal.service.ServiceContext serviceContext)
070                    throws com.liferay.portal.kernel.exception.PortalException,
071                            com.liferay.portal.kernel.exception.SystemException {
072                    return getService()
073                                       .addOrganization(parentOrganizationId, name, type,
074                            recursable, regionId, countryId, statusId, comments, serviceContext);
075            }
076    
077            public static void addPasswordPolicyOrganizations(long passwordPolicyId,
078                    long[] organizationIds)
079                    throws com.liferay.portal.kernel.exception.PortalException,
080                            com.liferay.portal.kernel.exception.SystemException {
081                    getService()
082                            .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
083            }
084    
085            public static void deleteLogo(long organizationId)
086                    throws com.liferay.portal.kernel.exception.PortalException,
087                            com.liferay.portal.kernel.exception.SystemException {
088                    getService().deleteLogo(organizationId);
089            }
090    
091            public static void deleteOrganization(long organizationId)
092                    throws com.liferay.portal.kernel.exception.PortalException,
093                            com.liferay.portal.kernel.exception.SystemException {
094                    getService().deleteOrganization(organizationId);
095            }
096    
097            public static java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
098                    java.lang.String actionId, int max)
099                    throws com.liferay.portal.kernel.exception.PortalException,
100                            com.liferay.portal.kernel.exception.SystemException {
101                    return getService().getManageableOrganizations(actionId, max);
102            }
103    
104            public static com.liferay.portal.model.Organization getOrganization(
105                    long organizationId)
106                    throws com.liferay.portal.kernel.exception.PortalException,
107                            com.liferay.portal.kernel.exception.SystemException {
108                    return getService().getOrganization(organizationId);
109            }
110    
111            public static long getOrganizationId(long companyId, java.lang.String name)
112                    throws com.liferay.portal.kernel.exception.SystemException {
113                    return getService().getOrganizationId(companyId, name);
114            }
115    
116            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
117                    long companyId, long parentOrganizationId)
118                    throws com.liferay.portal.kernel.exception.SystemException {
119                    return getService().getOrganizations(companyId, parentOrganizationId);
120            }
121    
122            public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
123                    long companyId, long parentOrganizationId, int start, int end)
124                    throws com.liferay.portal.kernel.exception.SystemException {
125                    return getService()
126                                       .getOrganizations(companyId, parentOrganizationId, start, end);
127            }
128    
129            public static int getOrganizationsCount(long companyId,
130                    long parentOrganizationId)
131                    throws com.liferay.portal.kernel.exception.SystemException {
132                    return getService()
133                                       .getOrganizationsCount(companyId, parentOrganizationId);
134            }
135    
136            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
137                    long userId)
138                    throws com.liferay.portal.kernel.exception.PortalException,
139                            com.liferay.portal.kernel.exception.SystemException {
140                    return getService().getUserOrganizations(userId);
141            }
142    
143            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
144                    long userId, boolean inheritUserGroups)
145                    throws com.liferay.portal.kernel.exception.PortalException,
146                            com.liferay.portal.kernel.exception.SystemException {
147                    return getService().getUserOrganizations(userId, inheritUserGroups);
148            }
149    
150            public static void setGroupOrganizations(long groupId,
151                    long[] organizationIds)
152                    throws com.liferay.portal.kernel.exception.PortalException,
153                            com.liferay.portal.kernel.exception.SystemException {
154                    getService().setGroupOrganizations(groupId, organizationIds);
155            }
156    
157            public static void unsetGroupOrganizations(long groupId,
158                    long[] organizationIds)
159                    throws com.liferay.portal.kernel.exception.PortalException,
160                            com.liferay.portal.kernel.exception.SystemException {
161                    getService().unsetGroupOrganizations(groupId, organizationIds);
162            }
163    
164            public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
165                    long[] organizationIds)
166                    throws com.liferay.portal.kernel.exception.PortalException,
167                            com.liferay.portal.kernel.exception.SystemException {
168                    getService()
169                            .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
170            }
171    
172            public static com.liferay.portal.model.Organization updateOrganization(
173                    long organizationId, long parentOrganizationId, java.lang.String name,
174                    java.lang.String type, boolean recursable, long regionId,
175                    long countryId, int statusId, java.lang.String comments,
176                    java.util.List<com.liferay.portal.model.Address> addresses,
177                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
178                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
179                    java.util.List<com.liferay.portal.model.Phone> phones,
180                    java.util.List<com.liferay.portal.model.Website> websites,
181                    com.liferay.portal.service.ServiceContext serviceContext)
182                    throws com.liferay.portal.kernel.exception.PortalException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    return getService()
185                                       .updateOrganization(organizationId, parentOrganizationId,
186                            name, type, recursable, regionId, countryId, statusId, comments,
187                            addresses, emailAddresses, orgLabors, phones, websites,
188                            serviceContext);
189            }
190    
191            public static com.liferay.portal.model.Organization updateOrganization(
192                    long organizationId, long parentOrganizationId, java.lang.String name,
193                    java.lang.String type, boolean recursable, long regionId,
194                    long countryId, int statusId, java.lang.String comments,
195                    com.liferay.portal.service.ServiceContext serviceContext)
196                    throws com.liferay.portal.kernel.exception.PortalException,
197                            com.liferay.portal.kernel.exception.SystemException {
198                    return getService()
199                                       .updateOrganization(organizationId, parentOrganizationId,
200                            name, type, recursable, regionId, countryId, statusId, comments,
201                            serviceContext);
202            }
203    
204            public static OrganizationService getService() {
205                    if (_service == null) {
206                            _service = (OrganizationService)PortalBeanLocatorUtil.locate(OrganizationService.class.getName());
207    
208                            ReferenceRegistry.registerReference(OrganizationServiceUtil.class,
209                                    "_service");
210                            MethodCache.remove(OrganizationService.class);
211                    }
212    
213                    return _service;
214            }
215    
216            public void setService(OrganizationService service) {
217                    MethodCache.remove(OrganizationService.class);
218    
219                    _service = service;
220    
221                    ReferenceRegistry.registerReference(OrganizationServiceUtil.class,
222                            "_service");
223                    MethodCache.remove(OrganizationService.class);
224            }
225    
226            private static OrganizationService _service;
227    }