1   /**
2    * Copyright (c) 2000-2008 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   * <p>
43   * <code>com.liferay.portal.service.OrganizationLocalServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portal.service.OrganizationLocalService
50   * @see com.liferay.portal.service.OrganizationLocalServiceFactory
51   *
52   */
53  public class OrganizationLocalServiceUtil {
54      public static com.liferay.portal.model.Organization addOrganization(
55          com.liferay.portal.model.Organization organization)
56          throws com.liferay.portal.SystemException {
57          OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
58  
59          return organizationLocalService.addOrganization(organization);
60      }
61  
62      public static void deleteOrganization(long organizationId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
66  
67          organizationLocalService.deleteOrganization(organizationId);
68      }
69  
70      public static void deleteOrganization(
71          com.liferay.portal.model.Organization organization)
72          throws com.liferay.portal.SystemException {
73          OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
74  
75          organizationLocalService.deleteOrganization(organization);
76      }
77  
78      public static java.util.List<Object> dynamicQuery(
79          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
80          throws com.liferay.portal.SystemException {
81          OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
82  
83          return organizationLocalService.dynamicQuery(dynamicQuery);
84      }
85  
86      public static java.util.List<Object> dynamicQuery(
87          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
88          int end) throws com.liferay.portal.SystemException {
89          OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
90  
91          return organizationLocalService.dynamicQuery(dynamicQuery, start, end);
92      }
93  
94      public static com.liferay.portal.model.Organization getOrganization(
95          long organizationId)
96          throws com.liferay.portal.PortalException,
97              com.liferay.portal.SystemException {
98          OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
99  
100         return organizationLocalService.getOrganization(organizationId);
101     }
102 
103     public static com.liferay.portal.model.Organization updateOrganization(
104         com.liferay.portal.model.Organization organization)
105         throws com.liferay.portal.SystemException {
106         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
107 
108         return organizationLocalService.updateOrganization(organization);
109     }
110 
111     public static void addGroupOrganizations(long groupId,
112         long[] organizationIds) throws com.liferay.portal.SystemException {
113         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
114 
115         organizationLocalService.addGroupOrganizations(groupId, organizationIds);
116     }
117 
118     public static com.liferay.portal.model.Organization addOrganization(
119         long userId, long parentOrganizationId, java.lang.String name,
120         int type, boolean recursable, long regionId, long countryId,
121         int statusId, java.lang.String comments)
122         throws com.liferay.portal.PortalException,
123             com.liferay.portal.SystemException {
124         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
125 
126         return organizationLocalService.addOrganization(userId,
127             parentOrganizationId, name, type, recursable, regionId, countryId,
128             statusId, comments);
129     }
130 
131     public static void addOrganizationResources(long userId,
132         com.liferay.portal.model.Organization organization)
133         throws com.liferay.portal.PortalException,
134             com.liferay.portal.SystemException {
135         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
136 
137         organizationLocalService.addOrganizationResources(userId, organization);
138     }
139 
140     public static void addPasswordPolicyOrganizations(long passwordPolicyId,
141         long[] organizationIds) throws com.liferay.portal.SystemException {
142         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
143 
144         organizationLocalService.addPasswordPolicyOrganizations(passwordPolicyId,
145             organizationIds);
146     }
147 
148     public static java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations(
149         long groupId) throws com.liferay.portal.SystemException {
150         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
151 
152         return organizationLocalService.getGroupOrganizations(groupId);
153     }
154 
155     public static java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
156         long userId) throws com.liferay.portal.SystemException {
157         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
158 
159         return organizationLocalService.getManageableOrganizations(userId);
160     }
161 
162     public static com.liferay.portal.model.Organization getOrganization(
163         long companyId, java.lang.String name)
164         throws com.liferay.portal.PortalException,
165             com.liferay.portal.SystemException {
166         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
167 
168         return organizationLocalService.getOrganization(companyId, name);
169     }
170 
171     public static long getOrganizationId(long companyId, java.lang.String name)
172         throws com.liferay.portal.SystemException {
173         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
174 
175         return organizationLocalService.getOrganizationId(companyId, name);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.Organization> getOrganizations(
179         long[] organizationIds)
180         throws com.liferay.portal.PortalException,
181             com.liferay.portal.SystemException {
182         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
183 
184         return organizationLocalService.getOrganizations(organizationIds);
185     }
186 
187     public static java.util.List<com.liferay.portal.model.Organization> getParentOrganizations(
188         long organizationId)
189         throws com.liferay.portal.PortalException,
190             com.liferay.portal.SystemException {
191         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
192 
193         return organizationLocalService.getParentOrganizations(organizationId);
194     }
195 
196     public static java.util.List<com.liferay.portal.model.Organization> getSuborganizations(
197         java.util.List<com.liferay.portal.model.Organization> organizations)
198         throws com.liferay.portal.SystemException {
199         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
200 
201         return organizationLocalService.getSuborganizations(organizations);
202     }
203 
204     public static java.util.List<com.liferay.portal.model.Organization> getSubsetOrganizations(
205         java.util.List<com.liferay.portal.model.Organization> allOrganizations,
206         java.util.List<com.liferay.portal.model.Organization> availableOrganizations) {
207         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
208 
209         return organizationLocalService.getSubsetOrganizations(allOrganizations,
210             availableOrganizations);
211     }
212 
213     public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
214         long userId) throws com.liferay.portal.SystemException {
215         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
216 
217         return organizationLocalService.getUserOrganizations(userId);
218     }
219 
220     public static int getUserOrganizationsCount(long userId)
221         throws com.liferay.portal.SystemException {
222         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
223 
224         return organizationLocalService.getUserOrganizationsCount(userId);
225     }
226 
227     public static boolean hasGroupOrganization(long groupId, long organizationId)
228         throws com.liferay.portal.SystemException {
229         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
230 
231         return organizationLocalService.hasGroupOrganization(groupId,
232             organizationId);
233     }
234 
235     public static boolean hasUserOrganization(long userId, long organizationId)
236         throws com.liferay.portal.SystemException {
237         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
238 
239         return organizationLocalService.hasUserOrganization(userId,
240             organizationId);
241     }
242 
243     public static boolean hasPasswordPolicyOrganization(long passwordPolicyId,
244         long organizationId) throws com.liferay.portal.SystemException {
245         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
246 
247         return organizationLocalService.hasPasswordPolicyOrganization(passwordPolicyId,
248             organizationId);
249     }
250 
251     public static java.util.List<com.liferay.portal.model.Organization> search(
252         long companyId, long parentOrganizationId, java.lang.String keywords,
253         int type, java.lang.Long regionId, java.lang.Long countryId,
254         java.util.LinkedHashMap<String, Object> params, int start, int end)
255         throws com.liferay.portal.SystemException {
256         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
257 
258         return organizationLocalService.search(companyId, parentOrganizationId,
259             keywords, type, regionId, countryId, params, start, end);
260     }
261 
262     public static java.util.List<com.liferay.portal.model.Organization> search(
263         long companyId, long parentOrganizationId, java.lang.String keywords,
264         int type, java.lang.Long regionId, java.lang.Long countryId,
265         java.util.LinkedHashMap<String, Object> params, int start, int end,
266         com.liferay.portal.kernel.util.OrderByComparator obc)
267         throws com.liferay.portal.SystemException {
268         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
269 
270         return organizationLocalService.search(companyId, parentOrganizationId,
271             keywords, type, regionId, countryId, params, start, end, obc);
272     }
273 
274     public static java.util.List<com.liferay.portal.model.Organization> search(
275         long companyId, long parentOrganizationId, java.lang.String name,
276         int type, java.lang.String street, java.lang.String city,
277         java.lang.String zip, java.lang.Long regionId,
278         java.lang.Long countryId,
279         java.util.LinkedHashMap<String, Object> params, boolean andOperator,
280         int start, int end) throws com.liferay.portal.SystemException {
281         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
282 
283         return organizationLocalService.search(companyId, parentOrganizationId,
284             name, type, street, city, zip, regionId, countryId, params,
285             andOperator, start, end);
286     }
287 
288     public static java.util.List<com.liferay.portal.model.Organization> search(
289         long companyId, long parentOrganizationId, java.lang.String name,
290         int type, java.lang.String street, java.lang.String city,
291         java.lang.String zip, java.lang.Long regionId,
292         java.lang.Long countryId,
293         java.util.LinkedHashMap<String, Object> params, boolean andOperator,
294         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
295         throws com.liferay.portal.SystemException {
296         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
297 
298         return organizationLocalService.search(companyId, parentOrganizationId,
299             name, type, street, city, zip, regionId, countryId, params,
300             andOperator, start, end, obc);
301     }
302 
303     public static int searchCount(long companyId, long parentOrganizationId,
304         java.lang.String keywords, int type, java.lang.Long regionId,
305         java.lang.Long countryId, java.util.LinkedHashMap<String, Object> params)
306         throws com.liferay.portal.SystemException {
307         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
308 
309         return organizationLocalService.searchCount(companyId,
310             parentOrganizationId, keywords, type, regionId, countryId, params);
311     }
312 
313     public static int searchCount(long companyId, long parentOrganizationId,
314         java.lang.String name, int type, java.lang.String street,
315         java.lang.String city, java.lang.String zip, java.lang.Long regionId,
316         java.lang.Long countryId,
317         java.util.LinkedHashMap<String, Object> params, boolean andOperator)
318         throws com.liferay.portal.SystemException {
319         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
320 
321         return organizationLocalService.searchCount(companyId,
322             parentOrganizationId, name, type, street, city, zip, regionId,
323             countryId, params, andOperator);
324     }
325 
326     public static void setGroupOrganizations(long groupId,
327         long[] organizationIds) throws com.liferay.portal.SystemException {
328         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
329 
330         organizationLocalService.setGroupOrganizations(groupId, organizationIds);
331     }
332 
333     public static void unsetGroupOrganizations(long groupId,
334         long[] organizationIds) throws com.liferay.portal.SystemException {
335         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
336 
337         organizationLocalService.unsetGroupOrganizations(groupId,
338             organizationIds);
339     }
340 
341     public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
342         long[] organizationIds) throws com.liferay.portal.SystemException {
343         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
344 
345         organizationLocalService.unsetPasswordPolicyOrganizations(passwordPolicyId,
346             organizationIds);
347     }
348 
349     public static com.liferay.portal.model.Organization updateOrganization(
350         long companyId, long organizationId, long parentOrganizationId,
351         java.lang.String name, int type, boolean recursable, long regionId,
352         long countryId, int statusId, java.lang.String comments)
353         throws com.liferay.portal.PortalException,
354             com.liferay.portal.SystemException {
355         OrganizationLocalService organizationLocalService = OrganizationLocalServiceFactory.getService();
356 
357         return organizationLocalService.updateOrganization(companyId,
358             organizationId, parentOrganizationId, name, type, recursable,
359             regionId, countryId, statusId, comments);
360     }
361 }