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 com.liferay.portal.model.Organization updateOrganization(
107         com.liferay.portal.model.Organization organization, boolean merge)
108         throws com.liferay.portal.SystemException {
109         return getService().updateOrganization(organization, merge);
110     }
111 
112     public static void addGroupOrganizations(long groupId,
113         long[] organizationIds) throws com.liferay.portal.SystemException {
114         getService().addGroupOrganizations(groupId, organizationIds);
115     }
116 
117     public static com.liferay.portal.model.Organization addOrganization(
118         long userId, long parentOrganizationId, java.lang.String name,
119         int type, boolean recursable, long regionId, long countryId,
120         int statusId, java.lang.String comments)
121         throws com.liferay.portal.PortalException,
122             com.liferay.portal.SystemException {
123         return getService()
124                    .addOrganization(userId, parentOrganizationId, name, type,
125             recursable, regionId, countryId, statusId, comments);
126     }
127 
128     public static void addOrganizationResources(long userId,
129         com.liferay.portal.model.Organization organization)
130         throws com.liferay.portal.PortalException,
131             com.liferay.portal.SystemException {
132         getService().addOrganizationResources(userId, organization);
133     }
134 
135     public static void addPasswordPolicyOrganizations(long passwordPolicyId,
136         long[] organizationIds) throws com.liferay.portal.SystemException {
137         getService()
138             .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
139     }
140 
141     public static java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations(
142         long groupId) throws com.liferay.portal.SystemException {
143         return getService().getGroupOrganizations(groupId);
144     }
145 
146     public static com.liferay.portal.model.Organization getOrganization(
147         long companyId, java.lang.String name)
148         throws com.liferay.portal.PortalException,
149             com.liferay.portal.SystemException {
150         return getService().getOrganization(companyId, name);
151     }
152 
153     public static long getOrganizationId(long companyId, java.lang.String name)
154         throws com.liferay.portal.SystemException {
155         return getService().getOrganizationId(companyId, name);
156     }
157 
158     public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
159         long[] organizationIds)
160         throws com.liferay.portal.PortalException,
161             com.liferay.portal.SystemException {
162         return getService().getOrganizations(organizationIds);
163     }
164 
165     public static java.util.List<com.liferay.portal.model.Organization> getParentOrganizations(
166         long organizationId)
167         throws com.liferay.portal.PortalException,
168             com.liferay.portal.SystemException {
169         return getService().getParentOrganizations(organizationId);
170     }
171 
172     public static java.util.List<com.liferay.portal.model.Organization> getSuborganizations(
173         java.util.List<com.liferay.portal.model.Organization> organizations)
174         throws com.liferay.portal.SystemException {
175         return getService().getSuborganizations(organizations);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.Organization> getSubsetOrganizations(
179         java.util.List<com.liferay.portal.model.Organization> allOrganizations,
180         java.util.List<com.liferay.portal.model.Organization> availableOrganizations) {
181         return getService()
182                    .getSubsetOrganizations(allOrganizations,
183             availableOrganizations);
184     }
185 
186     public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
187         long userId)
188         throws com.liferay.portal.PortalException,
189             com.liferay.portal.SystemException {
190         return getService().getUserOrganizations(userId);
191     }
192 
193     public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
194         long userId, boolean inherit)
195         throws com.liferay.portal.PortalException,
196             com.liferay.portal.SystemException {
197         return getService().getUserOrganizations(userId, inherit);
198     }
199 
200     public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
201         long userId, int start, int end)
202         throws com.liferay.portal.PortalException,
203             com.liferay.portal.SystemException {
204         return getService().getUserOrganizations(userId, start, end);
205     }
206 
207     public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
208         long userId, boolean inherit, int start, int end)
209         throws com.liferay.portal.PortalException,
210             com.liferay.portal.SystemException {
211         return getService().getUserOrganizations(userId, inherit, start, end);
212     }
213 
214     public static int getUserOrganizationsCount(long userId)
215         throws com.liferay.portal.SystemException {
216         return getService().getUserOrganizationsCount(userId);
217     }
218 
219     public static boolean hasGroupOrganization(long groupId, long organizationId)
220         throws com.liferay.portal.SystemException {
221         return getService().hasGroupOrganization(groupId, organizationId);
222     }
223 
224     public static boolean hasUserOrganization(long userId, long organizationId)
225         throws com.liferay.portal.SystemException {
226         return getService().hasUserOrganization(userId, organizationId);
227     }
228 
229     public static boolean hasUserOrganization(long userId, long organizationId,
230         boolean inheritUserGroups)
231         throws com.liferay.portal.PortalException,
232             com.liferay.portal.SystemException {
233         return getService()
234                    .hasUserOrganization(userId, organizationId,
235             inheritUserGroups);
236     }
237 
238     public static boolean hasPasswordPolicyOrganization(long passwordPolicyId,
239         long organizationId) throws com.liferay.portal.SystemException {
240         return getService()
241                    .hasPasswordPolicyOrganization(passwordPolicyId,
242             organizationId);
243     }
244 
245     public static void rebuildTree(long companyId, boolean force)
246         throws com.liferay.portal.SystemException {
247         getService().rebuildTree(companyId, force);
248     }
249 
250     public static java.util.List<com.liferay.portal.model.Organization> search(
251         long companyId, long parentOrganizationId, java.lang.String keywords,
252         int type, java.lang.Long regionId, java.lang.Long countryId,
253         java.util.LinkedHashMap<String, Object> params, int start, int end)
254         throws com.liferay.portal.SystemException {
255         return getService()
256                    .search(companyId, parentOrganizationId, keywords, type,
257             regionId, countryId, params, start, end);
258     }
259 
260     public static java.util.List<com.liferay.portal.model.Organization> search(
261         long companyId, long parentOrganizationId, java.lang.String keywords,
262         int type, java.lang.Long regionId, java.lang.Long countryId,
263         java.util.LinkedHashMap<String, Object> params, int start, int end,
264         com.liferay.portal.kernel.util.OrderByComparator obc)
265         throws com.liferay.portal.SystemException {
266         return getService()
267                    .search(companyId, parentOrganizationId, keywords, type,
268             regionId, countryId, params, start, end, obc);
269     }
270 
271     public static java.util.List<com.liferay.portal.model.Organization> search(
272         long companyId, long parentOrganizationId, java.lang.String name,
273         int type, java.lang.String street, java.lang.String city,
274         java.lang.String zip, java.lang.Long regionId,
275         java.lang.Long countryId,
276         java.util.LinkedHashMap<String, Object> params, boolean andOperator,
277         int start, int end) throws com.liferay.portal.SystemException {
278         return getService()
279                    .search(companyId, parentOrganizationId, name, type, street,
280             city, zip, regionId, countryId, params, andOperator, start, end);
281     }
282 
283     public static java.util.List<com.liferay.portal.model.Organization> search(
284         long companyId, long parentOrganizationId, java.lang.String name,
285         int type, java.lang.String street, java.lang.String city,
286         java.lang.String zip, java.lang.Long regionId,
287         java.lang.Long countryId,
288         java.util.LinkedHashMap<String, Object> params, boolean andOperator,
289         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
290         throws com.liferay.portal.SystemException {
291         return getService()
292                    .search(companyId, parentOrganizationId, name, type, street,
293             city, zip, regionId, countryId, params, andOperator, start, end, obc);
294     }
295 
296     public static int searchCount(long companyId, long parentOrganizationId,
297         java.lang.String keywords, int type, java.lang.Long regionId,
298         java.lang.Long countryId, java.util.LinkedHashMap<String, Object> params)
299         throws com.liferay.portal.SystemException {
300         return getService()
301                    .searchCount(companyId, parentOrganizationId, keywords,
302             type, regionId, countryId, params);
303     }
304 
305     public static int searchCount(long companyId, long parentOrganizationId,
306         java.lang.String name, int type, java.lang.String street,
307         java.lang.String city, java.lang.String zip, java.lang.Long regionId,
308         java.lang.Long countryId,
309         java.util.LinkedHashMap<String, Object> params, boolean andOperator)
310         throws com.liferay.portal.SystemException {
311         return getService()
312                    .searchCount(companyId, parentOrganizationId, name, type,
313             street, city, zip, regionId, countryId, params, andOperator);
314     }
315 
316     public static void setGroupOrganizations(long groupId,
317         long[] organizationIds) throws com.liferay.portal.SystemException {
318         getService().setGroupOrganizations(groupId, organizationIds);
319     }
320 
321     public static void unsetGroupOrganizations(long groupId,
322         long[] organizationIds) throws com.liferay.portal.SystemException {
323         getService().unsetGroupOrganizations(groupId, organizationIds);
324     }
325 
326     public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
327         long[] organizationIds) throws com.liferay.portal.SystemException {
328         getService()
329             .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
330     }
331 
332     public static com.liferay.portal.model.Organization updateOrganization(
333         long companyId, long organizationId, long parentOrganizationId,
334         java.lang.String name, int type, boolean recursable, long regionId,
335         long countryId, int statusId, java.lang.String comments)
336         throws com.liferay.portal.PortalException,
337             com.liferay.portal.SystemException {
338         return getService()
339                    .updateOrganization(companyId, organizationId,
340             parentOrganizationId, name, type, recursable, regionId, countryId,
341             statusId, comments);
342     }
343 
344     public static OrganizationLocalService getService() {
345         if (_service == null) {
346             throw new RuntimeException("OrganizationLocalService is not set");
347         }
348 
349         return _service;
350     }
351 
352     public void setService(OrganizationLocalService service) {
353         _service = service;
354     }
355 
356     private static OrganizationLocalService _service;
357 }