1
22
23 package com.liferay.portlet.tags.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.BooleanWrapper;
28 import com.liferay.portal.kernel.util.LongWrapper;
29 import com.liferay.portal.kernel.util.MethodWrapper;
30 import com.liferay.portal.kernel.util.NullWrapper;
31 import com.liferay.portal.security.auth.HttpPrincipal;
32 import com.liferay.portal.service.http.TunnelUtil;
33
34 import com.liferay.portlet.tags.service.TagsVocabularyServiceUtil;
35
36
75 public class TagsVocabularyServiceHttp {
76 public static com.liferay.portlet.tags.model.TagsVocabulary addVocabulary(
77 HttpPrincipal httpPrincipal, java.lang.String name, boolean folksonomy,
78 com.liferay.portal.service.ServiceContext serviceContext)
79 throws com.liferay.portal.PortalException,
80 com.liferay.portal.SystemException {
81 try {
82 Object paramObj0 = name;
83
84 if (name == null) {
85 paramObj0 = new NullWrapper("java.lang.String");
86 }
87
88 Object paramObj1 = new BooleanWrapper(folksonomy);
89
90 Object paramObj2 = serviceContext;
91
92 if (serviceContext == null) {
93 paramObj2 = new NullWrapper(
94 "com.liferay.portal.service.ServiceContext");
95 }
96
97 MethodWrapper methodWrapper = new MethodWrapper(TagsVocabularyServiceUtil.class.getName(),
98 "addVocabulary",
99 new Object[] { paramObj0, paramObj1, paramObj2 });
100
101 Object returnObj = null;
102
103 try {
104 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
105 }
106 catch (Exception e) {
107 if (e instanceof com.liferay.portal.PortalException) {
108 throw (com.liferay.portal.PortalException)e;
109 }
110
111 if (e instanceof com.liferay.portal.SystemException) {
112 throw (com.liferay.portal.SystemException)e;
113 }
114
115 throw new com.liferay.portal.SystemException(e);
116 }
117
118 return (com.liferay.portlet.tags.model.TagsVocabulary)returnObj;
119 }
120 catch (com.liferay.portal.SystemException se) {
121 _log.error(se, se);
122
123 throw se;
124 }
125 }
126
127 public static void deleteVocabulary(HttpPrincipal httpPrincipal,
128 long vocabularyId)
129 throws com.liferay.portal.PortalException,
130 com.liferay.portal.SystemException {
131 try {
132 Object paramObj0 = new LongWrapper(vocabularyId);
133
134 MethodWrapper methodWrapper = new MethodWrapper(TagsVocabularyServiceUtil.class.getName(),
135 "deleteVocabulary", new Object[] { paramObj0 });
136
137 try {
138 TunnelUtil.invoke(httpPrincipal, methodWrapper);
139 }
140 catch (Exception e) {
141 if (e instanceof com.liferay.portal.PortalException) {
142 throw (com.liferay.portal.PortalException)e;
143 }
144
145 if (e instanceof com.liferay.portal.SystemException) {
146 throw (com.liferay.portal.SystemException)e;
147 }
148
149 throw new com.liferay.portal.SystemException(e);
150 }
151 }
152 catch (com.liferay.portal.SystemException se) {
153 _log.error(se, se);
154
155 throw se;
156 }
157 }
158
159 public static java.util.List<com.liferay.portlet.tags.model.TagsVocabulary> getCompanyVocabularies(
160 HttpPrincipal httpPrincipal, long companyId, boolean folksonomy)
161 throws com.liferay.portal.PortalException,
162 com.liferay.portal.SystemException {
163 try {
164 Object paramObj0 = new LongWrapper(companyId);
165
166 Object paramObj1 = new BooleanWrapper(folksonomy);
167
168 MethodWrapper methodWrapper = new MethodWrapper(TagsVocabularyServiceUtil.class.getName(),
169 "getCompanyVocabularies",
170 new Object[] { paramObj0, paramObj1 });
171
172 Object returnObj = null;
173
174 try {
175 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
176 }
177 catch (Exception e) {
178 if (e instanceof com.liferay.portal.PortalException) {
179 throw (com.liferay.portal.PortalException)e;
180 }
181
182 if (e instanceof com.liferay.portal.SystemException) {
183 throw (com.liferay.portal.SystemException)e;
184 }
185
186 throw new com.liferay.portal.SystemException(e);
187 }
188
189 return (java.util.List<com.liferay.portlet.tags.model.TagsVocabulary>)returnObj;
190 }
191 catch (com.liferay.portal.SystemException se) {
192 _log.error(se, se);
193
194 throw se;
195 }
196 }
197
198 public static java.util.List<com.liferay.portlet.tags.model.TagsVocabulary> getGroupVocabularies(
199 HttpPrincipal httpPrincipal, long groupId, boolean folksonomy)
200 throws com.liferay.portal.PortalException,
201 com.liferay.portal.SystemException {
202 try {
203 Object paramObj0 = new LongWrapper(groupId);
204
205 Object paramObj1 = new BooleanWrapper(folksonomy);
206
207 MethodWrapper methodWrapper = new MethodWrapper(TagsVocabularyServiceUtil.class.getName(),
208 "getGroupVocabularies",
209 new Object[] { paramObj0, paramObj1 });
210
211 Object returnObj = null;
212
213 try {
214 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
215 }
216 catch (Exception e) {
217 if (e instanceof com.liferay.portal.PortalException) {
218 throw (com.liferay.portal.PortalException)e;
219 }
220
221 if (e instanceof com.liferay.portal.SystemException) {
222 throw (com.liferay.portal.SystemException)e;
223 }
224
225 throw new com.liferay.portal.SystemException(e);
226 }
227
228 return (java.util.List<com.liferay.portlet.tags.model.TagsVocabulary>)returnObj;
229 }
230 catch (com.liferay.portal.SystemException se) {
231 _log.error(se, se);
232
233 throw se;
234 }
235 }
236
237 public static com.liferay.portlet.tags.model.TagsVocabulary getVocabulary(
238 HttpPrincipal httpPrincipal, long vocabularyId)
239 throws com.liferay.portal.PortalException,
240 com.liferay.portal.SystemException {
241 try {
242 Object paramObj0 = new LongWrapper(vocabularyId);
243
244 MethodWrapper methodWrapper = new MethodWrapper(TagsVocabularyServiceUtil.class.getName(),
245 "getVocabulary", new Object[] { paramObj0 });
246
247 Object returnObj = null;
248
249 try {
250 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
251 }
252 catch (Exception e) {
253 if (e instanceof com.liferay.portal.PortalException) {
254 throw (com.liferay.portal.PortalException)e;
255 }
256
257 if (e instanceof com.liferay.portal.SystemException) {
258 throw (com.liferay.portal.SystemException)e;
259 }
260
261 throw new com.liferay.portal.SystemException(e);
262 }
263
264 return (com.liferay.portlet.tags.model.TagsVocabulary)returnObj;
265 }
266 catch (com.liferay.portal.SystemException se) {
267 _log.error(se, se);
268
269 throw se;
270 }
271 }
272
273 public static com.liferay.portlet.tags.model.TagsVocabulary updateVocabulary(
274 HttpPrincipal httpPrincipal, long vocabularyId, java.lang.String name,
275 boolean folksonomy)
276 throws com.liferay.portal.PortalException,
277 com.liferay.portal.SystemException {
278 try {
279 Object paramObj0 = new LongWrapper(vocabularyId);
280
281 Object paramObj1 = name;
282
283 if (name == null) {
284 paramObj1 = new NullWrapper("java.lang.String");
285 }
286
287 Object paramObj2 = new BooleanWrapper(folksonomy);
288
289 MethodWrapper methodWrapper = new MethodWrapper(TagsVocabularyServiceUtil.class.getName(),
290 "updateVocabulary",
291 new Object[] { paramObj0, paramObj1, paramObj2 });
292
293 Object returnObj = null;
294
295 try {
296 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
297 }
298 catch (Exception e) {
299 if (e instanceof com.liferay.portal.PortalException) {
300 throw (com.liferay.portal.PortalException)e;
301 }
302
303 if (e instanceof com.liferay.portal.SystemException) {
304 throw (com.liferay.portal.SystemException)e;
305 }
306
307 throw new com.liferay.portal.SystemException(e);
308 }
309
310 return (com.liferay.portlet.tags.model.TagsVocabulary)returnObj;
311 }
312 catch (com.liferay.portal.SystemException se) {
313 _log.error(se, se);
314
315 throw se;
316 }
317 }
318
319 private static Log _log = LogFactoryUtil.getLog(TagsVocabularyServiceHttp.class);
320 }