001    /**
002     * Copyright (c) 2000-2010 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.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * <p>
021     * This class provides static methods for the
022     * {@link OrganizationService} bean. The static methods of
023     * this class calls the same methods of the bean instance. It's convenient to be
024     * able to just write one line to call a method on a bean instead of writing a
025     * lookup call and a method call.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       OrganizationService
030     * @generated
031     */
032    public class OrganizationServiceUtil {
033            public static void addGroupOrganizations(long groupId,
034                    long[] organizationIds)
035                    throws com.liferay.portal.kernel.exception.PortalException,
036                            com.liferay.portal.kernel.exception.SystemException {
037                    getService().addGroupOrganizations(groupId, organizationIds);
038            }
039    
040            public static void addPasswordPolicyOrganizations(long passwordPolicyId,
041                    long[] organizationIds)
042                    throws com.liferay.portal.kernel.exception.PortalException,
043                            com.liferay.portal.kernel.exception.SystemException {
044                    getService()
045                            .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
046            }
047    
048            public static com.liferay.portal.model.Organization addOrganization(
049                    long parentOrganizationId, java.lang.String name,
050                    java.lang.String type, boolean recursable, long regionId,
051                    long countryId, int statusId, java.lang.String comments,
052                    com.liferay.portal.service.ServiceContext serviceContext)
053                    throws com.liferay.portal.kernel.exception.PortalException,
054                            com.liferay.portal.kernel.exception.SystemException {
055                    return getService()
056                                       .addOrganization(parentOrganizationId, name, type,
057                            recursable, regionId, countryId, statusId, comments, serviceContext);
058            }
059    
060            public static com.liferay.portal.model.Organization addOrganization(
061                    long parentOrganizationId, java.lang.String name,
062                    java.lang.String type, boolean recursable, long regionId,
063                    long countryId, int statusId, java.lang.String comments,
064                    java.util.List<com.liferay.portal.model.Address> addresses,
065                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
066                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
067                    java.util.List<com.liferay.portal.model.Phone> phones,
068                    java.util.List<com.liferay.portal.model.Website> websites,
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, addresses,
075                            emailAddresses, orgLabors, phones, websites, serviceContext);
076            }
077    
078            public static void deleteLogo(long organizationId)
079                    throws com.liferay.portal.kernel.exception.PortalException,
080                            com.liferay.portal.kernel.exception.SystemException {
081                    getService().deleteLogo(organizationId);
082            }
083    
084            public static void deleteOrganization(long organizationId)
085                    throws com.liferay.portal.kernel.exception.PortalException,
086                            com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteOrganization(organizationId);
088            }
089    
090            public static java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
091                    java.lang.String actionId, int max)
092                    throws com.liferay.portal.kernel.exception.PortalException,
093                            com.liferay.portal.kernel.exception.SystemException {
094                    return getService().getManageableOrganizations(actionId, max);
095            }
096    
097            public static com.liferay.portal.model.Organization getOrganization(
098                    long organizationId)
099                    throws com.liferay.portal.kernel.exception.PortalException,
100                            com.liferay.portal.kernel.exception.SystemException {
101                    return getService().getOrganization(organizationId);
102            }
103    
104            public static long getOrganizationId(long companyId, java.lang.String name)
105                    throws com.liferay.portal.kernel.exception.SystemException {
106                    return getService().getOrganizationId(companyId, name);
107            }
108    
109            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
110                    long userId)
111                    throws com.liferay.portal.kernel.exception.PortalException,
112                            com.liferay.portal.kernel.exception.SystemException {
113                    return getService().getUserOrganizations(userId);
114            }
115    
116            public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
117                    long userId, boolean inheritUserGroups)
118                    throws com.liferay.portal.kernel.exception.PortalException,
119                            com.liferay.portal.kernel.exception.SystemException {
120                    return getService().getUserOrganizations(userId, inheritUserGroups);
121            }
122    
123            public static void setGroupOrganizations(long groupId,
124                    long[] organizationIds)
125                    throws com.liferay.portal.kernel.exception.PortalException,
126                            com.liferay.portal.kernel.exception.SystemException {
127                    getService().setGroupOrganizations(groupId, organizationIds);
128            }
129    
130            public static void unsetGroupOrganizations(long groupId,
131                    long[] organizationIds)
132                    throws com.liferay.portal.kernel.exception.PortalException,
133                            com.liferay.portal.kernel.exception.SystemException {
134                    getService().unsetGroupOrganizations(groupId, organizationIds);
135            }
136    
137            public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
138                    long[] organizationIds)
139                    throws com.liferay.portal.kernel.exception.PortalException,
140                            com.liferay.portal.kernel.exception.SystemException {
141                    getService()
142                            .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
143            }
144    
145            public static com.liferay.portal.model.Organization updateOrganization(
146                    long organizationId, long parentOrganizationId, java.lang.String name,
147                    java.lang.String type, boolean recursable, long regionId,
148                    long countryId, int statusId, java.lang.String comments,
149                    com.liferay.portal.service.ServiceContext serviceContext)
150                    throws com.liferay.portal.kernel.exception.PortalException,
151                            com.liferay.portal.kernel.exception.SystemException {
152                    return getService()
153                                       .updateOrganization(organizationId, parentOrganizationId,
154                            name, type, recursable, regionId, countryId, statusId, comments,
155                            serviceContext);
156            }
157    
158            public static com.liferay.portal.model.Organization updateOrganization(
159                    long organizationId, long parentOrganizationId, java.lang.String name,
160                    java.lang.String type, boolean recursable, long regionId,
161                    long countryId, int statusId, java.lang.String comments,
162                    java.util.List<com.liferay.portal.model.Address> addresses,
163                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
164                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
165                    java.util.List<com.liferay.portal.model.Phone> phones,
166                    java.util.List<com.liferay.portal.model.Website> websites,
167                    com.liferay.portal.service.ServiceContext serviceContext)
168                    throws com.liferay.portal.kernel.exception.PortalException,
169                            com.liferay.portal.kernel.exception.SystemException {
170                    return getService()
171                                       .updateOrganization(organizationId, parentOrganizationId,
172                            name, type, recursable, regionId, countryId, statusId, comments,
173                            addresses, emailAddresses, orgLabors, phones, websites,
174                            serviceContext);
175            }
176    
177            public static OrganizationService getService() {
178                    if (_service == null) {
179                            _service = (OrganizationService)PortalBeanLocatorUtil.locate(OrganizationService.class.getName());
180                    }
181    
182                    return _service;
183            }
184    
185            public void setService(OrganizationService service) {
186                    _service = service;
187            }
188    
189            private static OrganizationService _service;
190    }