1
22
23 package com.liferay.portal.service.http;
24
25 import com.liferay.portal.service.GroupServiceUtil;
26
27 import org.json.JSONArray;
28 import org.json.JSONObject;
29
30
74 public class GroupServiceJSON {
75 public static JSONObject addGroup(java.lang.String name,
76 java.lang.String description, int type, java.lang.String friendlyURL,
77 boolean active)
78 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
79 com.liferay.portal.PortalException {
80 com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(name,
81 description, type, friendlyURL, active);
82
83 return GroupJSONSerializer.toJSONObject(returnValue);
84 }
85
86 public static JSONObject addGroup(long liveGroupId, java.lang.String name,
87 java.lang.String description, int type, java.lang.String friendlyURL,
88 boolean active)
89 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
90 com.liferay.portal.PortalException {
91 com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(liveGroupId,
92 name, description, type, friendlyURL, active);
93
94 return GroupJSONSerializer.toJSONObject(returnValue);
95 }
96
97 public static void addRoleGroups(long roleId, long[] groupIds)
98 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
99 com.liferay.portal.PortalException {
100 GroupServiceUtil.addRoleGroups(roleId, groupIds);
101 }
102
103 public static void deleteGroup(long groupId)
104 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
105 com.liferay.portal.PortalException {
106 GroupServiceUtil.deleteGroup(groupId);
107 }
108
109 public static JSONObject getGroup(long groupId)
110 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
111 com.liferay.portal.PortalException {
112 com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(groupId);
113
114 return GroupJSONSerializer.toJSONObject(returnValue);
115 }
116
117 public static JSONObject getGroup(long companyId, java.lang.String name)
118 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
119 com.liferay.portal.PortalException {
120 com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(companyId,
121 name);
122
123 return GroupJSONSerializer.toJSONObject(returnValue);
124 }
125
126 public static JSONArray getOrganizationsGroups(java.util.List organizations)
127 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
128 com.liferay.portal.PortalException {
129 java.util.List returnValue = GroupServiceUtil.getOrganizationsGroups(organizations);
130
131 return GroupJSONSerializer.toJSONArray(returnValue);
132 }
133
134 public static JSONArray getUserGroupsGroups(java.util.List userGroups)
135 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
136 com.liferay.portal.PortalException {
137 java.util.List returnValue = GroupServiceUtil.getUserGroupsGroups(userGroups);
138
139 return GroupJSONSerializer.toJSONArray(returnValue);
140 }
141
142 public static boolean hasUserGroup(long userId, long groupId)
143 throws java.rmi.RemoteException, com.liferay.portal.SystemException {
144 boolean returnValue = GroupServiceUtil.hasUserGroup(userId, groupId);
145
146 return returnValue;
147 }
148
149 public static JSONArray search(long companyId, java.lang.String name,
150 java.lang.String description, java.lang.String[] params, int begin,
151 int end)
152 throws java.rmi.RemoteException, com.liferay.portal.SystemException {
153 java.util.List returnValue = GroupServiceUtil.search(companyId, name,
154 description, params, begin, end);
155
156 return GroupJSONSerializer.toJSONArray(returnValue);
157 }
158
159 public static int searchCount(long companyId, java.lang.String name,
160 java.lang.String description, java.lang.String[] params)
161 throws java.rmi.RemoteException, com.liferay.portal.SystemException {
162 int returnValue = GroupServiceUtil.searchCount(companyId, name,
163 description, params);
164
165 return returnValue;
166 }
167
168 public static void setRoleGroups(long roleId, long[] groupIds)
169 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
170 com.liferay.portal.PortalException {
171 GroupServiceUtil.setRoleGroups(roleId, groupIds);
172 }
173
174 public static void unsetRoleGroups(long roleId, long[] groupIds)
175 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
176 com.liferay.portal.PortalException {
177 GroupServiceUtil.unsetRoleGroups(roleId, groupIds);
178 }
179
180 public static JSONObject updateGroup(long groupId, java.lang.String name,
181 java.lang.String description, int type, java.lang.String friendlyURL,
182 boolean active)
183 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
184 com.liferay.portal.PortalException {
185 com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId,
186 name, description, type, friendlyURL, active);
187
188 return GroupJSONSerializer.toJSONObject(returnValue);
189 }
190
191 public static JSONObject updateGroup(long groupId,
192 java.lang.String typeSettings)
193 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
194 com.liferay.portal.PortalException {
195 com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId,
196 typeSettings);
197
198 return GroupJSONSerializer.toJSONObject(returnValue);
199 }
200 }