001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.service;
022:
023: /**
024: * <a href="OrganizationServiceUtil.java.html"><b><i>View Source</i></b></a>
025: *
026: * <p>
027: * ServiceBuilder generated this class. Modifications in this class will be
028: * overwritten the next time is generated.
029: * </p>
030: *
031: * <p>
032: * This class provides static methods for the
033: * <code>com.liferay.portal.service.OrganizationService</code>
034: * bean. The static methods of this class calls the same methods of the bean
035: * instance. It's convenient to be able to just write one line to call a method
036: * on a bean instead of writing a lookup call and a method call.
037: * </p>
038: *
039: * <p>
040: * <code>com.liferay.portal.service.OrganizationServiceFactory</code>
041: * is responsible for the lookup of the bean.
042: * </p>
043: *
044: * @author Brian Wing Shun Chan
045: *
046: * @see com.liferay.portal.service.OrganizationService
047: * @see com.liferay.portal.service.OrganizationServiceFactory
048: *
049: */
050: public class OrganizationServiceUtil {
051: public static void addGroupOrganizations(long groupId,
052: long[] organizationIds)
053: throws com.liferay.portal.PortalException,
054: com.liferay.portal.SystemException,
055: java.rmi.RemoteException {
056: OrganizationService organizationService = OrganizationServiceFactory
057: .getService();
058:
059: organizationService.addGroupOrganizations(groupId,
060: organizationIds);
061: }
062:
063: public static void addPasswordPolicyOrganizations(
064: long passwordPolicyId, long[] organizationIds)
065: throws com.liferay.portal.PortalException,
066: com.liferay.portal.SystemException,
067: java.rmi.RemoteException {
068: OrganizationService organizationService = OrganizationServiceFactory
069: .getService();
070:
071: organizationService.addPasswordPolicyOrganizations(
072: passwordPolicyId, organizationIds);
073: }
074:
075: public static com.liferay.portal.model.Organization addOrganization(
076: long parentOrganizationId, java.lang.String name, int type,
077: boolean recursable, long regionId, long countryId,
078: int statusId, java.lang.String comments)
079: throws com.liferay.portal.PortalException,
080: com.liferay.portal.SystemException,
081: java.rmi.RemoteException {
082: OrganizationService organizationService = OrganizationServiceFactory
083: .getService();
084:
085: return organizationService.addOrganization(
086: parentOrganizationId, name, type, recursable, regionId,
087: countryId, statusId, comments);
088: }
089:
090: public static void deleteOrganization(long organizationId)
091: throws com.liferay.portal.PortalException,
092: com.liferay.portal.SystemException,
093: java.rmi.RemoteException {
094: OrganizationService organizationService = OrganizationServiceFactory
095: .getService();
096:
097: organizationService.deleteOrganization(organizationId);
098: }
099:
100: public static com.liferay.portal.model.Organization getOrganization(
101: long organizationId)
102: throws com.liferay.portal.PortalException,
103: com.liferay.portal.SystemException,
104: java.rmi.RemoteException {
105: OrganizationService organizationService = OrganizationServiceFactory
106: .getService();
107:
108: return organizationService.getOrganization(organizationId);
109: }
110:
111: public static long getOrganizationId(long companyId,
112: java.lang.String name)
113: throws com.liferay.portal.PortalException,
114: com.liferay.portal.SystemException,
115: java.rmi.RemoteException {
116: OrganizationService organizationService = OrganizationServiceFactory
117: .getService();
118:
119: return organizationService.getOrganizationId(companyId, name);
120: }
121:
122: public static java.util.List getUserOrganizations(long userId)
123: throws com.liferay.portal.PortalException,
124: com.liferay.portal.SystemException,
125: java.rmi.RemoteException {
126: OrganizationService organizationService = OrganizationServiceFactory
127: .getService();
128:
129: return organizationService.getUserOrganizations(userId);
130: }
131:
132: public static void setGroupOrganizations(long groupId,
133: long[] organizationIds)
134: throws com.liferay.portal.PortalException,
135: com.liferay.portal.SystemException,
136: java.rmi.RemoteException {
137: OrganizationService organizationService = OrganizationServiceFactory
138: .getService();
139:
140: organizationService.setGroupOrganizations(groupId,
141: organizationIds);
142: }
143:
144: public static void unsetGroupOrganizations(long groupId,
145: long[] organizationIds)
146: throws com.liferay.portal.PortalException,
147: com.liferay.portal.SystemException,
148: java.rmi.RemoteException {
149: OrganizationService organizationService = OrganizationServiceFactory
150: .getService();
151:
152: organizationService.unsetGroupOrganizations(groupId,
153: organizationIds);
154: }
155:
156: public static void unsetPasswordPolicyOrganizations(
157: long passwordPolicyId, long[] organizationIds)
158: throws com.liferay.portal.PortalException,
159: com.liferay.portal.SystemException,
160: java.rmi.RemoteException {
161: OrganizationService organizationService = OrganizationServiceFactory
162: .getService();
163:
164: organizationService.unsetPasswordPolicyOrganizations(
165: passwordPolicyId, organizationIds);
166: }
167:
168: public static com.liferay.portal.model.Organization updateOrganization(
169: long organizationId, long parentOrganizationId,
170: java.lang.String name, int type, boolean recursable,
171: long regionId, long countryId, int statusId,
172: java.lang.String comments)
173: throws com.liferay.portal.PortalException,
174: com.liferay.portal.SystemException,
175: java.rmi.RemoteException {
176: OrganizationService organizationService = OrganizationServiceFactory
177: .getService();
178:
179: return organizationService.updateOrganization(organizationId,
180: parentOrganizationId, name, type, recursable, regionId,
181: countryId, statusId, comments);
182: }
183: }
|