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.IntegerWrapper;
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.TagsAssetServiceUtil;
35
36
73 public class TagsAssetServiceHttp {
74 public static void deleteAsset(HttpPrincipal httpPrincipal, long assetId)
75 throws com.liferay.portal.SystemException,
76 com.liferay.portal.PortalException {
77 try {
78 Object paramObj0 = new LongWrapper(assetId);
79 MethodWrapper methodWrapper = new MethodWrapper(TagsAssetServiceUtil.class.getName(),
80 "deleteAsset", new Object[] { paramObj0 });
81
82 try {
83 TunnelUtil.invoke(httpPrincipal, methodWrapper);
84 }
85 catch (Exception e) {
86 if (e instanceof com.liferay.portal.SystemException) {
87 throw (com.liferay.portal.SystemException)e;
88 }
89
90 if (e instanceof com.liferay.portal.PortalException) {
91 throw (com.liferay.portal.PortalException)e;
92 }
93
94 throw new com.liferay.portal.SystemException(e);
95 }
96 }
97 catch (com.liferay.portal.SystemException se) {
98 _log.error(se, se);
99 throw se;
100 }
101 }
102
103 public static com.liferay.portlet.tags.model.TagsAsset getAsset(
104 HttpPrincipal httpPrincipal, long assetId)
105 throws com.liferay.portal.SystemException,
106 com.liferay.portal.PortalException {
107 try {
108 Object paramObj0 = new LongWrapper(assetId);
109 MethodWrapper methodWrapper = new MethodWrapper(TagsAssetServiceUtil.class.getName(),
110 "getAsset", new Object[] { paramObj0 });
111 Object returnObj = null;
112
113 try {
114 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
115 }
116 catch (Exception e) {
117 if (e instanceof com.liferay.portal.SystemException) {
118 throw (com.liferay.portal.SystemException)e;
119 }
120
121 if (e instanceof com.liferay.portal.PortalException) {
122 throw (com.liferay.portal.PortalException)e;
123 }
124
125 throw new com.liferay.portal.SystemException(e);
126 }
127
128 return (com.liferay.portlet.tags.model.TagsAsset)returnObj;
129 }
130 catch (com.liferay.portal.SystemException se) {
131 _log.error(se, se);
132 throw se;
133 }
134 }
135
136 public static com.liferay.portlet.tags.model.TagsAssetType[] getAssetTypes(
137 HttpPrincipal httpPrincipal, java.lang.String languageId)
138 throws com.liferay.portal.SystemException {
139 try {
140 Object paramObj0 = languageId;
141
142 if (languageId == null) {
143 paramObj0 = new NullWrapper("java.lang.String");
144 }
145
146 MethodWrapper methodWrapper = new MethodWrapper(TagsAssetServiceUtil.class.getName(),
147 "getAssetTypes", new Object[] { paramObj0 });
148 Object returnObj = null;
149
150 try {
151 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
152 }
153 catch (Exception e) {
154 if (e instanceof com.liferay.portal.SystemException) {
155 throw (com.liferay.portal.SystemException)e;
156 }
157
158 throw new com.liferay.portal.SystemException(e);
159 }
160
161 return (com.liferay.portlet.tags.model.TagsAssetType[])returnObj;
162 }
163 catch (com.liferay.portal.SystemException se) {
164 _log.error(se, se);
165 throw se;
166 }
167 }
168
169 public static com.liferay.portlet.tags.model.TagsAssetDisplay[] getCompanyAssetDisplays(
170 HttpPrincipal httpPrincipal, long companyId, int begin, int end,
171 java.lang.String languageId)
172 throws com.liferay.portal.SystemException,
173 com.liferay.portal.PortalException {
174 try {
175 Object paramObj0 = new LongWrapper(companyId);
176 Object paramObj1 = new IntegerWrapper(begin);
177 Object paramObj2 = new IntegerWrapper(end);
178 Object paramObj3 = languageId;
179
180 if (languageId == null) {
181 paramObj3 = new NullWrapper("java.lang.String");
182 }
183
184 MethodWrapper methodWrapper = new MethodWrapper(TagsAssetServiceUtil.class.getName(),
185 "getCompanyAssetDisplays",
186 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
187 Object returnObj = null;
188
189 try {
190 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
191 }
192 catch (Exception e) {
193 if (e instanceof com.liferay.portal.SystemException) {
194 throw (com.liferay.portal.SystemException)e;
195 }
196
197 if (e instanceof com.liferay.portal.PortalException) {
198 throw (com.liferay.portal.PortalException)e;
199 }
200
201 throw new com.liferay.portal.SystemException(e);
202 }
203
204 return (com.liferay.portlet.tags.model.TagsAssetDisplay[])returnObj;
205 }
206 catch (com.liferay.portal.SystemException se) {
207 _log.error(se, se);
208 throw se;
209 }
210 }
211
212 public static java.util.List getCompanyAssets(HttpPrincipal httpPrincipal,
213 long companyId, int begin, int end)
214 throws com.liferay.portal.SystemException {
215 try {
216 Object paramObj0 = new LongWrapper(companyId);
217 Object paramObj1 = new IntegerWrapper(begin);
218 Object paramObj2 = new IntegerWrapper(end);
219 MethodWrapper methodWrapper = new MethodWrapper(TagsAssetServiceUtil.class.getName(),
220 "getCompanyAssets",
221 new Object[] { paramObj0, paramObj1, paramObj2 });
222 Object returnObj = null;
223
224 try {
225 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
226 }
227 catch (Exception e) {
228 if (e instanceof com.liferay.portal.SystemException) {
229 throw (com.liferay.portal.SystemException)e;
230 }
231
232 throw new com.liferay.portal.SystemException(e);
233 }
234
235 return (java.util.List)returnObj;
236 }
237 catch (com.liferay.portal.SystemException se) {
238 _log.error(se, se);
239 throw se;
240 }
241 }
242
243 public static int getCompanyAssetsCount(HttpPrincipal httpPrincipal,
244 long companyId) throws com.liferay.portal.SystemException {
245 try {
246 Object paramObj0 = new LongWrapper(companyId);
247 MethodWrapper methodWrapper = new MethodWrapper(TagsAssetServiceUtil.class.getName(),
248 "getCompanyAssetsCount", new Object[] { paramObj0 });
249 Object returnObj = null;
250
251 try {
252 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
253 }
254 catch (Exception e) {
255 if (e instanceof com.liferay.portal.SystemException) {
256 throw (com.liferay.portal.SystemException)e;
257 }
258
259 throw new com.liferay.portal.SystemException(e);
260 }
261
262 return ((Integer)returnObj).intValue();
263 }
264 catch (com.liferay.portal.SystemException se) {
265 _log.error(se, se);
266 throw se;
267 }
268 }
269
270 public static com.liferay.portlet.tags.model.TagsAssetDisplay[] searchAssetDisplays(
271 HttpPrincipal httpPrincipal, long companyId,
272 java.lang.String portletId, java.lang.String keywords,
273 java.lang.String languageId, int begin, int end)
274 throws com.liferay.portal.SystemException,
275 com.liferay.portal.PortalException {
276 try {
277 Object paramObj0 = new LongWrapper(companyId);
278 Object paramObj1 = portletId;
279
280 if (portletId == null) {
281 paramObj1 = new NullWrapper("java.lang.String");
282 }
283
284 Object paramObj2 = keywords;
285
286 if (keywords == null) {
287 paramObj2 = new NullWrapper("java.lang.String");
288 }
289
290 Object paramObj3 = languageId;
291
292 if (languageId == null) {
293 paramObj3 = new NullWrapper("java.lang.String");
294 }
295
296 Object paramObj4 = new IntegerWrapper(begin);
297 Object paramObj5 = new IntegerWrapper(end);
298 MethodWrapper methodWrapper = new MethodWrapper(TagsAssetServiceUtil.class.getName(),
299 "searchAssetDisplays",
300 new Object[] {
301 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
302 paramObj5
303 });
304 Object returnObj = null;
305
306 try {
307 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
308 }
309 catch (Exception e) {
310 if (e instanceof com.liferay.portal.SystemException) {
311 throw (com.liferay.portal.SystemException)e;
312 }
313
314 if (e instanceof com.liferay.portal.PortalException) {
315 throw (com.liferay.portal.PortalException)e;
316 }
317
318 throw new com.liferay.portal.SystemException(e);
319 }
320
321 return (com.liferay.portlet.tags.model.TagsAssetDisplay[])returnObj;
322 }
323 catch (com.liferay.portal.SystemException se) {
324 _log.error(se, se);
325 throw se;
326 }
327 }
328
329 public static int searchAssetDisplaysCount(HttpPrincipal httpPrincipal,
330 long companyId, java.lang.String portletId, java.lang.String keywords,
331 java.lang.String languageId) throws com.liferay.portal.SystemException {
332 try {
333 Object paramObj0 = new LongWrapper(companyId);
334 Object paramObj1 = portletId;
335
336 if (portletId == null) {
337 paramObj1 = new NullWrapper("java.lang.String");
338 }
339
340 Object paramObj2 = keywords;
341
342 if (keywords == null) {
343 paramObj2 = new NullWrapper("java.lang.String");
344 }
345
346 Object paramObj3 = languageId;
347
348 if (languageId == null) {
349 paramObj3 = new NullWrapper("java.lang.String");
350 }
351
352 MethodWrapper methodWrapper = new MethodWrapper(TagsAssetServiceUtil.class.getName(),
353 "searchAssetDisplaysCount",
354 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
355 Object returnObj = null;
356
357 try {
358 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
359 }
360 catch (Exception e) {
361 if (e instanceof com.liferay.portal.SystemException) {
362 throw (com.liferay.portal.SystemException)e;
363 }
364
365 throw new com.liferay.portal.SystemException(e);
366 }
367
368 return ((Integer)returnObj).intValue();
369 }
370 catch (com.liferay.portal.SystemException se) {
371 _log.error(se, se);
372 throw se;
373 }
374 }
375
376 public static com.liferay.portlet.tags.model.TagsAsset updateAsset(
377 HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
378 java.lang.String[] entryNames, java.util.Date startDate,
379 java.util.Date endDate, java.util.Date publishDate,
380 java.util.Date expirationDate, java.lang.String mimeType,
381 java.lang.String title, java.lang.String description,
382 java.lang.String summary, java.lang.String url, int height, int width)
383 throws com.liferay.portal.SystemException,
384 com.liferay.portal.PortalException {
385 try {
386 Object paramObj0 = className;
387
388 if (className == null) {
389 paramObj0 = new NullWrapper("java.lang.String");
390 }
391
392 Object paramObj1 = new LongWrapper(classPK);
393 Object paramObj2 = entryNames;
394
395 if (entryNames == null) {
396 paramObj2 = new NullWrapper("[Ljava.lang.String;");
397 }
398
399 Object paramObj3 = startDate;
400
401 if (startDate == null) {
402 paramObj3 = new NullWrapper("java.util.Date");
403 }
404
405 Object paramObj4 = endDate;
406
407 if (endDate == null) {
408 paramObj4 = new NullWrapper("java.util.Date");
409 }
410
411 Object paramObj5 = publishDate;
412
413 if (publishDate == null) {
414 paramObj5 = new NullWrapper("java.util.Date");
415 }
416
417 Object paramObj6 = expirationDate;
418
419 if (expirationDate == null) {
420 paramObj6 = new NullWrapper("java.util.Date");
421 }
422
423 Object paramObj7 = mimeType;
424
425 if (mimeType == null) {
426 paramObj7 = new NullWrapper("java.lang.String");
427 }
428
429 Object paramObj8 = title;
430
431 if (title == null) {
432 paramObj8 = new NullWrapper("java.lang.String");
433 }
434
435 Object paramObj9 = description;
436
437 if (description == null) {
438 paramObj9 = new NullWrapper("java.lang.String");
439 }
440
441 Object paramObj10 = summary;
442
443 if (summary == null) {
444 paramObj10 = new NullWrapper("java.lang.String");
445 }
446
447 Object paramObj11 = url;
448
449 if (url == null) {
450 paramObj11 = new NullWrapper("java.lang.String");
451 }
452
453 Object paramObj12 = new IntegerWrapper(height);
454 Object paramObj13 = new IntegerWrapper(width);
455 MethodWrapper methodWrapper = new MethodWrapper(TagsAssetServiceUtil.class.getName(),
456 "updateAsset",
457 new Object[] {
458 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
459 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
460 paramObj10, paramObj11, paramObj12, paramObj13
461 });
462 Object returnObj = null;
463
464 try {
465 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
466 }
467 catch (Exception e) {
468 if (e instanceof com.liferay.portal.SystemException) {
469 throw (com.liferay.portal.SystemException)e;
470 }
471
472 if (e instanceof com.liferay.portal.PortalException) {
473 throw (com.liferay.portal.PortalException)e;
474 }
475
476 throw new com.liferay.portal.SystemException(e);
477 }
478
479 return (com.liferay.portlet.tags.model.TagsAsset)returnObj;
480 }
481 catch (com.liferay.portal.SystemException se) {
482 _log.error(se, se);
483 throw se;
484 }
485 }
486
487 private static Log _log = LogFactoryUtil.getLog(TagsAssetServiceHttp.class);
488 }