1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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="OrganizationServiceUtil.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   * {@link OrganizationService} bean. The static methods of
37   * this class calls the same methods of the bean instance. It's convenient to be
38   * able to just write one line to call a method on a bean instead of writing a
39   * lookup call and a method call.
40   * </p>
41   *
42   * @author    Brian Wing Shun Chan
43   * @see       OrganizationService
44   * @generated
45   */
46  public class OrganizationServiceUtil {
47      public static void addGroupOrganizations(long groupId,
48          long[] organizationIds)
49          throws com.liferay.portal.PortalException,
50              com.liferay.portal.SystemException, java.rmi.RemoteException {
51          getService().addGroupOrganizations(groupId, organizationIds);
52      }
53  
54      public static void addPasswordPolicyOrganizations(long passwordPolicyId,
55          long[] organizationIds)
56          throws com.liferay.portal.PortalException,
57              com.liferay.portal.SystemException, java.rmi.RemoteException {
58          getService()
59              .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
60      }
61  
62      public static com.liferay.portal.model.Organization addOrganization(
63          long parentOrganizationId, java.lang.String name, int type,
64          boolean recursable, long regionId, long countryId, int statusId,
65          java.lang.String comments)
66          throws com.liferay.portal.PortalException,
67              com.liferay.portal.SystemException, java.rmi.RemoteException {
68          return getService()
69                     .addOrganization(parentOrganizationId, name, type,
70              recursable, regionId, countryId, statusId, comments);
71      }
72  
73      public static void deleteOrganization(long organizationId)
74          throws com.liferay.portal.PortalException,
75              com.liferay.portal.SystemException, java.rmi.RemoteException {
76          getService().deleteOrganization(organizationId);
77      }
78  
79      public static com.liferay.portal.model.Organization getOrganization(
80          long organizationId)
81          throws com.liferay.portal.PortalException,
82              com.liferay.portal.SystemException, java.rmi.RemoteException {
83          return getService().getOrganization(organizationId);
84      }
85  
86      public static long getOrganizationId(long companyId, java.lang.String name)
87          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
88          return getService().getOrganizationId(companyId, name);
89      }
90  
91      public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
92          long userId)
93          throws com.liferay.portal.PortalException,
94              com.liferay.portal.SystemException, java.rmi.RemoteException {
95          return getService().getUserOrganizations(userId);
96      }
97  
98      public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
99          long userId, boolean inheritUserGroups)
100         throws com.liferay.portal.PortalException,
101             com.liferay.portal.SystemException, java.rmi.RemoteException {
102         return getService().getUserOrganizations(userId, inheritUserGroups);
103     }
104 
105     public static void setGroupOrganizations(long groupId,
106         long[] organizationIds)
107         throws com.liferay.portal.PortalException,
108             com.liferay.portal.SystemException, java.rmi.RemoteException {
109         getService().setGroupOrganizations(groupId, organizationIds);
110     }
111 
112     public static void unsetGroupOrganizations(long groupId,
113         long[] organizationIds)
114         throws com.liferay.portal.PortalException,
115             com.liferay.portal.SystemException, java.rmi.RemoteException {
116         getService().unsetGroupOrganizations(groupId, organizationIds);
117     }
118 
119     public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
120         long[] organizationIds)
121         throws com.liferay.portal.PortalException,
122             com.liferay.portal.SystemException, java.rmi.RemoteException {
123         getService()
124             .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds);
125     }
126 
127     public static com.liferay.portal.model.Organization updateOrganization(
128         long organizationId, long parentOrganizationId, java.lang.String name,
129         int type, boolean recursable, long regionId, long countryId,
130         int statusId, java.lang.String comments)
131         throws com.liferay.portal.PortalException,
132             com.liferay.portal.SystemException, java.rmi.RemoteException {
133         return getService()
134                    .updateOrganization(organizationId, parentOrganizationId,
135             name, type, recursable, regionId, countryId, statusId, comments);
136     }
137 
138     public static OrganizationService getService() {
139         if (_service == null) {
140             throw new RuntimeException("OrganizationService is not set");
141         }
142 
143         return _service;
144     }
145 
146     public void setService(OrganizationService service) {
147         _service = service;
148     }
149 
150     private static OrganizationService _service;
151 }