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="UserGroupServiceUtil.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.UserGroupService</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.UserGroupServiceFactory</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.UserGroupService
047: * @see com.liferay.portal.service.UserGroupServiceFactory
048: *
049: */
050: public class UserGroupServiceUtil {
051: public static void addGroupUserGroups(long groupId,
052: long[] userGroupIds)
053: throws com.liferay.portal.PortalException,
054: com.liferay.portal.SystemException,
055: java.rmi.RemoteException {
056: UserGroupService userGroupService = UserGroupServiceFactory
057: .getService();
058:
059: userGroupService.addGroupUserGroups(groupId, userGroupIds);
060: }
061:
062: public static com.liferay.portal.model.UserGroup addUserGroup(
063: java.lang.String name, java.lang.String description)
064: throws com.liferay.portal.PortalException,
065: com.liferay.portal.SystemException,
066: java.rmi.RemoteException {
067: UserGroupService userGroupService = UserGroupServiceFactory
068: .getService();
069:
070: return userGroupService.addUserGroup(name, description);
071: }
072:
073: public static void deleteUserGroup(long userGroupId)
074: throws com.liferay.portal.PortalException,
075: com.liferay.portal.SystemException,
076: java.rmi.RemoteException {
077: UserGroupService userGroupService = UserGroupServiceFactory
078: .getService();
079:
080: userGroupService.deleteUserGroup(userGroupId);
081: }
082:
083: public static com.liferay.portal.model.UserGroup getUserGroup(
084: long userGroupId)
085: throws com.liferay.portal.PortalException,
086: com.liferay.portal.SystemException,
087: java.rmi.RemoteException {
088: UserGroupService userGroupService = UserGroupServiceFactory
089: .getService();
090:
091: return userGroupService.getUserGroup(userGroupId);
092: }
093:
094: public static com.liferay.portal.model.UserGroup getUserGroup(
095: java.lang.String name)
096: throws com.liferay.portal.PortalException,
097: com.liferay.portal.SystemException,
098: java.rmi.RemoteException {
099: UserGroupService userGroupService = UserGroupServiceFactory
100: .getService();
101:
102: return userGroupService.getUserGroup(name);
103: }
104:
105: public static java.util.List getUserUserGroups(long userId)
106: throws com.liferay.portal.PortalException,
107: com.liferay.portal.SystemException,
108: java.rmi.RemoteException {
109: UserGroupService userGroupService = UserGroupServiceFactory
110: .getService();
111:
112: return userGroupService.getUserUserGroups(userId);
113: }
114:
115: public static void unsetGroupUserGroups(long groupId,
116: long[] userGroupIds)
117: throws com.liferay.portal.PortalException,
118: com.liferay.portal.SystemException,
119: java.rmi.RemoteException {
120: UserGroupService userGroupService = UserGroupServiceFactory
121: .getService();
122:
123: userGroupService.unsetGroupUserGroups(groupId, userGroupIds);
124: }
125:
126: public static com.liferay.portal.model.UserGroup updateUserGroup(
127: long userGroupId, java.lang.String name,
128: java.lang.String description)
129: throws com.liferay.portal.PortalException,
130: com.liferay.portal.SystemException,
131: java.rmi.RemoteException {
132: UserGroupService userGroupService = UserGroupServiceFactory
133: .getService();
134:
135: return userGroupService.updateUserGroup(userGroupId, name,
136: description);
137: }
138: }
|