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="OrganizationServiceUtil.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.OrganizationService</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.OrganizationServiceFactory</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.OrganizationService
48   * @see com.liferay.portal.service.OrganizationServiceFactory
49   *
50   */
51  public class OrganizationServiceUtil {
52      public static void addGroupOrganizations(long groupId,
53          long[] organizationIds)
54          throws com.liferay.portal.PortalException, 
55              com.liferay.portal.SystemException, java.rmi.RemoteException {
56          OrganizationService organizationService = OrganizationServiceFactory.getService();
57          organizationService.addGroupOrganizations(groupId, organizationIds);
58      }
59  
60      public static void addPasswordPolicyOrganizations(long passwordPolicyId,
61          long[] organizationIds)
62          throws com.liferay.portal.PortalException, 
63              com.liferay.portal.SystemException, java.rmi.RemoteException {
64          OrganizationService organizationService = OrganizationServiceFactory.getService();
65          organizationService.addPasswordPolicyOrganizations(passwordPolicyId,
66              organizationIds);
67      }
68  
69      public static com.liferay.portal.model.Organization addOrganization(
70          long parentOrganizationId, java.lang.String name, boolean location,
71          boolean recursable, long regionId, long countryId, int statusId)
72          throws com.liferay.portal.PortalException, 
73              com.liferay.portal.SystemException, java.rmi.RemoteException {
74          OrganizationService organizationService = OrganizationServiceFactory.getService();
75  
76          return organizationService.addOrganization(parentOrganizationId, name,
77              location, recursable, regionId, countryId, statusId);
78      }
79  
80      public static void deleteOrganization(long organizationId)
81          throws com.liferay.portal.PortalException, 
82              com.liferay.portal.SystemException, java.rmi.RemoteException {
83          OrganizationService organizationService = OrganizationServiceFactory.getService();
84          organizationService.deleteOrganization(organizationId);
85      }
86  
87      public static com.liferay.portal.model.Organization getOrganization(
88          long organizationId)
89          throws com.liferay.portal.PortalException, 
90              com.liferay.portal.SystemException, java.rmi.RemoteException {
91          OrganizationService organizationService = OrganizationServiceFactory.getService();
92  
93          return organizationService.getOrganization(organizationId);
94      }
95  
96      public static long getOrganizationId(long companyId, java.lang.String name)
97          throws com.liferay.portal.PortalException, 
98              com.liferay.portal.SystemException, java.rmi.RemoteException {
99          OrganizationService organizationService = OrganizationServiceFactory.getService();
100 
101         return organizationService.getOrganizationId(companyId, name);
102     }
103 
104     public static java.util.List getUserOrganizations(long userId)
105         throws com.liferay.portal.PortalException, 
106             com.liferay.portal.SystemException, java.rmi.RemoteException {
107         OrganizationService organizationService = OrganizationServiceFactory.getService();
108 
109         return organizationService.getUserOrganizations(userId);
110     }
111 
112     public static void setGroupOrganizations(long groupId,
113         long[] organizationIds)
114         throws com.liferay.portal.PortalException, 
115             com.liferay.portal.SystemException, java.rmi.RemoteException {
116         OrganizationService organizationService = OrganizationServiceFactory.getService();
117         organizationService.setGroupOrganizations(groupId, organizationIds);
118     }
119 
120     public static void unsetGroupOrganizations(long groupId,
121         long[] organizationIds)
122         throws com.liferay.portal.PortalException, 
123             com.liferay.portal.SystemException, java.rmi.RemoteException {
124         OrganizationService organizationService = OrganizationServiceFactory.getService();
125         organizationService.unsetGroupOrganizations(groupId, organizationIds);
126     }
127 
128     public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
129         long[] organizationIds)
130         throws com.liferay.portal.PortalException, 
131             com.liferay.portal.SystemException, java.rmi.RemoteException {
132         OrganizationService organizationService = OrganizationServiceFactory.getService();
133         organizationService.unsetPasswordPolicyOrganizations(passwordPolicyId,
134             organizationIds);
135     }
136 
137     public static com.liferay.portal.model.Organization updateOrganization(
138         long organizationId, long parentOrganizationId, java.lang.String name,
139         boolean location, boolean recursable, long regionId, long countryId,
140         int statusId)
141         throws com.liferay.portal.PortalException, 
142             com.liferay.portal.SystemException, java.rmi.RemoteException {
143         OrganizationService organizationService = OrganizationServiceFactory.getService();
144 
145         return organizationService.updateOrganization(organizationId,
146             parentOrganizationId, name, location, recursable, regionId,
147             countryId, statusId);
148     }
149 
150     public static com.liferay.portal.model.Organization updateOrganization(
151         long organizationId, java.lang.String comments)
152         throws com.liferay.portal.PortalException, 
153             com.liferay.portal.SystemException, java.rmi.RemoteException {
154         OrganizationService organizationService = OrganizationServiceFactory.getService();
155 
156         return organizationService.updateOrganization(organizationId, comments);
157     }
158 }