1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service;
24  
25  
26  /**
27   * <a href="OrganizationLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portal.service.OrganizationLocalService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * @author Brian Wing Shun Chan
43   *
44   * @see com.liferay.portal.service.OrganizationLocalService
45   *
46   */
47  public class OrganizationLocalServiceUtil {
48      public static com.liferay.portal.model.Organization addOrganization(
49          com.liferay.portal.model.Organization organization)
50          throws com.liferay.portal.SystemException {
51          return getService().addOrganization(organization);
52      }
53  
54      public static com.liferay.portal.model.Organization createOrganization(
55          long organizationId) {
56          return getService().createOrganization(organizationId);
57      }
58  
59      public static void deleteOrganization(long organizationId)
60          throws com.liferay.portal.PortalException,
61              com.liferay.portal.SystemException {
62          getService().deleteOrganization(organizationId);
63      }
64  
65      public static void deleteOrganization(
66          com.liferay.portal.model.Organization organization)
67          throws com.liferay.portal.SystemException {
68          getService().deleteOrganization(organization);
69      }
70  
71      public static java.util.List<Object> dynamicQuery(
72          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
73          throws com.liferay.portal.SystemException {
74          return getService().dynamicQuery(dynamicQuery);
75      }
76  
77      public static java.util.List<Object> dynamicQuery(
78          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
79          int end) throws com.liferay.portal.SystemException {
80          return getService().dynamicQuery(dynamicQuery, start, end);
81      }
82  
83      public static com.liferay.portal.model.Organization getOrganization(
84          long organizationId)
85          throws com.liferay.portal.PortalException,
86              com.liferay.portal.SystemException {
87          return getService().getOrganization(organizationId);
88      }
89  
90      public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
91          int start, int end) throws com.liferay.portal.SystemException {
92          return getService().getOrganizations(start, end);
93      }
94  
95      public static int getOrganizationsCount()
96          throws com.liferay.portal.SystemException {
97          return getService().getOrganizationsCount();
98      }
99  
100     public static com.liferay.portal.model.Organization updateOrganization(
101         com.liferay.portal.model.Organization organization)
102         throws com.liferay.portal.SystemException {
103         return getService().updateOrganization(organization);
104     }
105 
106     public static void addGroupOrganizations(long groupId,
107         long[] organizationIds) throws com.liferay.portal.SystemException {
108         getService().addGroupOrganizations(groupId, organizationIds);
109     }
110 
111     public static com.liferay.portal.model.Organization addOrganization(
112         long userId, long parentOrganizationId, java.lang.String name,
113         java.lang.String type, boolean recursable, long regionId,
114         long countryId, int statusId, java.lang.String comments,
115         com.liferay.portal.service.ServiceContext serviceContext)
116         throws com.liferay.portal.PortalException,
117             com.liferay.portal.SystemException {
118         return getService()
119                    .addOrganization(userId, parentOrganizationId, name, type,
120             recursable, regionId, countryId, statusId, comments, serviceContext);
121     }
122 
123     public static void addOrganizationResources(long userId,
124         com.liferay.portal.model.Organization organization)
125         throws com.liferay.portal.PortalException,
126             com.liferay.portal.SystemException {
127         getService().addOrganizationResources(userId, organization);
128     }
129 
130     public static void addPasswordPolicyOrganizations(long passwordPolicyId,
131         long[] organizationIds) throws com.liferay.portal.SystemException {
132         getService()
133             .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
134     }
135 
136     public static void deleteLogo(long organizationId)
137         throws com.liferay.portal.PortalException,
138             com.liferay.portal.SystemException {
139         getService().deleteLogo(organizationId);
140     }
141 
142     public static java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations(
143         long groupId) throws com.liferay.portal.SystemException {
144         return getService().getGroupOrganizations(groupId);
145     }
146 
147     public static java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
148         long userId) throws com.liferay.portal.SystemException {
149         return getService().getManageableOrganizations(userId);
150     }
151 
152     public static com.liferay.portal.model.Organization getOrganization(
153         long companyId, java.lang.String name)
154         throws com.liferay.portal.PortalException,
155             com.liferay.portal.SystemException {
156         return getService().getOrganization(companyId, name);
157     }
158 
159     public static long getOrganizationId(long companyId, java.lang.String name)
160         throws com.liferay.portal.SystemException {
161         return getService().getOrganizationId(companyId, name);
162     }
163 
164     public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
165         long[] organizationIds)
166         throws com.liferay.portal.PortalException,
167             com.liferay.portal.SystemException {
168         return getService().getOrganizations(organizationIds);
169     }
170 
171     public static java.util.List<com.liferay.portal.model.Organization> getParentOrganizations(
172         long organizationId)
173         throws com.liferay.portal.PortalException,
174             com.liferay.portal.SystemException {
175         return getService().getParentOrganizations(organizationId);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.Organization> getSuborganizations(
179         java.util.List<com.liferay.portal.model.Organization> organizations)
180         throws com.liferay.portal.SystemException {
181         return getService().getSuborganizations(organizations);
182     }
183 
184     public static java.util.List<com.liferay.portal.model.Organization> getSubsetOrganizations(
185         java.util.List<com.liferay.portal.model.Organization> allOrganizations,
186         java.util.List<com.liferay.portal.model.Organization> availableOrganizations) {
187         return getService()
188                    .getSubsetOrganizations(allOrganizations,
189             availableOrganizations);
190     }
191 
192     public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
193         long userId) throws com.liferay.portal.SystemException {
194         return getService().getUserOrganizations(userId);
195     }
196 
197     public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
198         long userId, int start, int end)
199         throws com.liferay.portal.SystemException {
200         return getService().getUserOrganizations(userId, start, end);
201     }
202 
203     public static int getUserOrganizationsCount(long userId)
204         throws com.liferay.portal.SystemException {
205         return getService().getUserOrganizationsCount(userId);
206     }
207 
208     public static boolean hasGroupOrganization(long groupId, long organizationId)
209         throws com.liferay.portal.SystemException {
210         return getService().hasGroupOrganization(groupId, organizationId);
211     }
212 
213     public static boolean hasUserOrganization(long userId, long organizationId)
214         throws com.liferay.portal.SystemException {
215         return getService().hasUserOrganization(userId, organizationId);
216     }
217 
218     public static boolean hasPasswordPolicyOrganization(long passwordPolicyId,
219         long organizationId) throws com.liferay.portal.SystemException {
220         return getService()
221                    .hasPasswordPolicyOrganization(passwordPolicyId,
222             organizationId);
223     }
224 
225     public static java.util.List<com.liferay.portal.model.Organization> search(
226         long companyId, long parentOrganizationId, java.lang.String keywords,
227         java.lang.String type, java.lang.Long regionId,
228         java.lang.Long countryId,
229         java.util.LinkedHashMap<String, Object> params, int start, int end)
230         throws com.liferay.portal.SystemException {
231         return getService()
232                    .search(companyId, parentOrganizationId, keywords, type,
233             regionId, countryId, params, start, end);
234     }
235 
236     public static java.util.List<com.liferay.portal.model.Organization> search(
237         long companyId, long parentOrganizationId, java.lang.String keywords,
238         java.lang.String type, java.lang.Long regionId,
239         java.lang.Long countryId,
240         java.util.LinkedHashMap<String, Object> params, int start, int end,
241         com.liferay.portal.kernel.util.OrderByComparator obc)
242         throws com.liferay.portal.SystemException {
243         return getService()
244                    .search(companyId, parentOrganizationId, keywords, type,
245             regionId, countryId, params, start, end, obc);
246     }
247 
248     public static java.util.List<com.liferay.portal.model.Organization> search(
249         long companyId, long parentOrganizationId, java.lang.String name,
250         java.lang.String type, java.lang.String street, java.lang.String city,
251         java.lang.String zip, java.lang.Long regionId,
252         java.lang.Long countryId,
253         java.util.LinkedHashMap<String, Object> params, boolean andOperator,
254         int start, int end) throws com.liferay.portal.SystemException {
255         return getService()
256                    .search(companyId, parentOrganizationId, name, type, street,
257             city, zip, regionId, countryId, params, andOperator, start, end);
258     }
259 
260     public static java.util.List<com.liferay.portal.model.Organization> search(
261         long companyId, long parentOrganizationId, java.lang.String name,
262         java.lang.String type, java.lang.String street, java.lang.String city,
263         java.lang.String zip, java.lang.Long regionId,
264         java.lang.Long countryId,
265         java.util.LinkedHashMap<String, Object> params, boolean andOperator,
266         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
267         throws com.liferay.portal.SystemException {
268         return getService()
269                    .search(companyId, parentOrganizationId, name, type, street,
270             city, zip, regionId, countryId, params, andOperator, start, end, obc);
271     }
272 
273     public static int searchCount(long companyId, long parentOrganizationId,
274         java.lang.String keywords, java.lang.String type,
275         java.lang.Long regionId, java.lang.Long countryId,
276         java.util.LinkedHashMap<String, Object> params)
277         throws com.liferay.portal.SystemException {
278         return getService()
279                    .searchCount(companyId, parentOrganizationId, keywords,
280             type, regionId, countryId, params);
281     }
282 
283     public static int searchCount(long companyId, long parentOrganizationId,
284         java.lang.String name, java.lang.String type, java.lang.String street,
285         java.lang.String city, java.lang.String zip, java.lang.Long regionId,
286         java.lang.Long countryId,
287         java.util.LinkedHashMap<String, Object> params, boolean andOperator)
288         throws com.liferay.portal.SystemException {
289         return getService()
290                    .searchCount(companyId, parentOrganizationId, name, type,
291             street, city, zip, regionId, countryId, params, andOperator);
292     }
293 
294     public static void setGroupOrganizations(long groupId,
295         long[] organizationIds) throws com.liferay.portal.SystemException {
296         getService().setGroupOrganizations(groupId, organizationIds);
297     }
298 
299     public static void unsetGroupOrganizations(long groupId,
300         long[] organizationIds) throws com.liferay.portal.SystemException {
301         getService().unsetGroupOrganizations(groupId, organizationIds);
302     }
303 
304     public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
305         long[] organizationIds) throws com.liferay.portal.SystemException {
306         getService()
307             .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
308     }
309 
310     public static com.liferay.portal.model.Organization updateOrganization(
311         long companyId, long organizationId, long parentOrganizationId,
312         java.lang.String name, java.lang.String type, boolean recursable,
313         long regionId, long countryId, int statusId, java.lang.String comments,
314         com.liferay.portal.service.ServiceContext serviceContext)
315         throws com.liferay.portal.PortalException,
316             com.liferay.portal.SystemException {
317         return getService()
318                    .updateOrganization(companyId, organizationId,
319             parentOrganizationId, name, type, recursable, regionId, countryId,
320             statusId, comments, serviceContext);
321     }
322 
323     public static OrganizationLocalService getService() {
324         if (_service == null) {
325             throw new RuntimeException("OrganizationLocalService is not set");
326         }
327 
328         return _service;
329     }
330 
331     public void setService(OrganizationLocalService service) {
332         _service = service;
333     }
334 
335     private static OrganizationLocalService _service;
336 }