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