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