1
14
15 package com.liferay.portlet.asset.service.http;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.BooleanWrapper;
20 import com.liferay.portal.kernel.util.DoubleWrapper;
21 import com.liferay.portal.kernel.util.IntegerWrapper;
22 import com.liferay.portal.kernel.util.LongWrapper;
23 import com.liferay.portal.kernel.util.MethodWrapper;
24 import com.liferay.portal.kernel.util.NullWrapper;
25 import com.liferay.portal.security.auth.HttpPrincipal;
26 import com.liferay.portal.service.http.TunnelUtil;
27
28 import com.liferay.portlet.asset.service.AssetEntryServiceUtil;
29
30
67 public class AssetEntryServiceHttp {
68 public static void deleteEntry(HttpPrincipal httpPrincipal, long entryId)
69 throws com.liferay.portal.kernel.exception.PortalException,
70 com.liferay.portal.kernel.exception.SystemException {
71 try {
72 Object paramObj0 = new LongWrapper(entryId);
73
74 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
75 "deleteEntry", new Object[] { paramObj0 });
76
77 try {
78 TunnelUtil.invoke(httpPrincipal, methodWrapper);
79 }
80 catch (Exception e) {
81 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
82 throw (com.liferay.portal.kernel.exception.PortalException)e;
83 }
84
85 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
86 throw (com.liferay.portal.kernel.exception.SystemException)e;
87 }
88
89 throw new com.liferay.portal.kernel.exception.SystemException(e);
90 }
91 }
92 catch (com.liferay.portal.kernel.exception.SystemException se) {
93 _log.error(se, se);
94
95 throw se;
96 }
97 }
98
99 public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getCompanyEntries(
100 HttpPrincipal httpPrincipal, long companyId, int start, int end)
101 throws com.liferay.portal.kernel.exception.SystemException {
102 try {
103 Object paramObj0 = new LongWrapper(companyId);
104
105 Object paramObj1 = new IntegerWrapper(start);
106
107 Object paramObj2 = new IntegerWrapper(end);
108
109 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
110 "getCompanyEntries",
111 new Object[] { paramObj0, paramObj1, paramObj2 });
112
113 Object returnObj = null;
114
115 try {
116 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
117 }
118 catch (Exception e) {
119 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
120 throw (com.liferay.portal.kernel.exception.SystemException)e;
121 }
122
123 throw new com.liferay.portal.kernel.exception.SystemException(e);
124 }
125
126 return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
127 }
128 catch (com.liferay.portal.kernel.exception.SystemException se) {
129 _log.error(se, se);
130
131 throw se;
132 }
133 }
134
135 public static int getCompanyEntriesCount(HttpPrincipal httpPrincipal,
136 long companyId)
137 throws com.liferay.portal.kernel.exception.SystemException {
138 try {
139 Object paramObj0 = new LongWrapper(companyId);
140
141 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
142 "getCompanyEntriesCount", new Object[] { paramObj0 });
143
144 Object returnObj = null;
145
146 try {
147 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
148 }
149 catch (Exception e) {
150 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
151 throw (com.liferay.portal.kernel.exception.SystemException)e;
152 }
153
154 throw new com.liferay.portal.kernel.exception.SystemException(e);
155 }
156
157 return ((Integer)returnObj).intValue();
158 }
159 catch (com.liferay.portal.kernel.exception.SystemException se) {
160 _log.error(se, se);
161
162 throw se;
163 }
164 }
165
166 public static java.lang.String getCompanyEntriesRSS(
167 HttpPrincipal httpPrincipal, long companyId, int max,
168 java.lang.String type, double version, java.lang.String displayStyle,
169 java.lang.String feedURL, java.lang.String tagURL)
170 throws com.liferay.portal.kernel.exception.PortalException,
171 com.liferay.portal.kernel.exception.SystemException {
172 try {
173 Object paramObj0 = new LongWrapper(companyId);
174
175 Object paramObj1 = new IntegerWrapper(max);
176
177 Object paramObj2 = type;
178
179 if (type == null) {
180 paramObj2 = new NullWrapper("java.lang.String");
181 }
182
183 Object paramObj3 = new DoubleWrapper(version);
184
185 Object paramObj4 = displayStyle;
186
187 if (displayStyle == null) {
188 paramObj4 = new NullWrapper("java.lang.String");
189 }
190
191 Object paramObj5 = feedURL;
192
193 if (feedURL == null) {
194 paramObj5 = new NullWrapper("java.lang.String");
195 }
196
197 Object paramObj6 = tagURL;
198
199 if (tagURL == null) {
200 paramObj6 = new NullWrapper("java.lang.String");
201 }
202
203 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
204 "getCompanyEntriesRSS",
205 new Object[] {
206 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
207 paramObj5, paramObj6
208 });
209
210 Object returnObj = null;
211
212 try {
213 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
214 }
215 catch (Exception e) {
216 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
217 throw (com.liferay.portal.kernel.exception.PortalException)e;
218 }
219
220 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
221 throw (com.liferay.portal.kernel.exception.SystemException)e;
222 }
223
224 throw new com.liferay.portal.kernel.exception.SystemException(e);
225 }
226
227 return (java.lang.String)returnObj;
228 }
229 catch (com.liferay.portal.kernel.exception.SystemException se) {
230 _log.error(se, se);
231
232 throw se;
233 }
234 }
235
236 public static com.liferay.portlet.asset.model.AssetEntryDisplay[] getCompanyEntryDisplays(
237 HttpPrincipal httpPrincipal, long companyId, int start, int end,
238 java.lang.String languageId)
239 throws com.liferay.portal.kernel.exception.SystemException {
240 try {
241 Object paramObj0 = new LongWrapper(companyId);
242
243 Object paramObj1 = new IntegerWrapper(start);
244
245 Object paramObj2 = new IntegerWrapper(end);
246
247 Object paramObj3 = languageId;
248
249 if (languageId == null) {
250 paramObj3 = new NullWrapper("java.lang.String");
251 }
252
253 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
254 "getCompanyEntryDisplays",
255 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
256
257 Object returnObj = null;
258
259 try {
260 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
261 }
262 catch (Exception e) {
263 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
264 throw (com.liferay.portal.kernel.exception.SystemException)e;
265 }
266
267 throw new com.liferay.portal.kernel.exception.SystemException(e);
268 }
269
270 return (com.liferay.portlet.asset.model.AssetEntryDisplay[])returnObj;
271 }
272 catch (com.liferay.portal.kernel.exception.SystemException se) {
273 _log.error(se, se);
274
275 throw se;
276 }
277 }
278
279 public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getEntries(
280 HttpPrincipal httpPrincipal,
281 com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
282 throws com.liferay.portal.kernel.exception.PortalException,
283 com.liferay.portal.kernel.exception.SystemException {
284 try {
285 Object paramObj0 = entryQuery;
286
287 if (entryQuery == null) {
288 paramObj0 = new NullWrapper(
289 "com.liferay.portlet.asset.service.persistence.AssetEntryQuery");
290 }
291
292 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
293 "getEntries", new Object[] { paramObj0 });
294
295 Object returnObj = null;
296
297 try {
298 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
299 }
300 catch (Exception e) {
301 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
302 throw (com.liferay.portal.kernel.exception.PortalException)e;
303 }
304
305 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
306 throw (com.liferay.portal.kernel.exception.SystemException)e;
307 }
308
309 throw new com.liferay.portal.kernel.exception.SystemException(e);
310 }
311
312 return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
313 }
314 catch (com.liferay.portal.kernel.exception.SystemException se) {
315 _log.error(se, se);
316
317 throw se;
318 }
319 }
320
321 public static int getEntriesCount(HttpPrincipal httpPrincipal,
322 com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
323 throws com.liferay.portal.kernel.exception.PortalException,
324 com.liferay.portal.kernel.exception.SystemException {
325 try {
326 Object paramObj0 = entryQuery;
327
328 if (entryQuery == null) {
329 paramObj0 = new NullWrapper(
330 "com.liferay.portlet.asset.service.persistence.AssetEntryQuery");
331 }
332
333 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
334 "getEntriesCount", new Object[] { paramObj0 });
335
336 Object returnObj = null;
337
338 try {
339 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
340 }
341 catch (Exception e) {
342 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
343 throw (com.liferay.portal.kernel.exception.PortalException)e;
344 }
345
346 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
347 throw (com.liferay.portal.kernel.exception.SystemException)e;
348 }
349
350 throw new com.liferay.portal.kernel.exception.SystemException(e);
351 }
352
353 return ((Integer)returnObj).intValue();
354 }
355 catch (com.liferay.portal.kernel.exception.SystemException se) {
356 _log.error(se, se);
357
358 throw se;
359 }
360 }
361
362 public static java.lang.String getEntriesRSS(HttpPrincipal httpPrincipal,
363 com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery,
364 java.lang.String name, java.lang.String type, double version,
365 java.lang.String displayStyle, java.lang.String feedURL,
366 java.lang.String tagURL)
367 throws com.liferay.portal.kernel.exception.PortalException,
368 com.liferay.portal.kernel.exception.SystemException {
369 try {
370 Object paramObj0 = entryQuery;
371
372 if (entryQuery == null) {
373 paramObj0 = new NullWrapper(
374 "com.liferay.portlet.asset.service.persistence.AssetEntryQuery");
375 }
376
377 Object paramObj1 = name;
378
379 if (name == null) {
380 paramObj1 = new NullWrapper("java.lang.String");
381 }
382
383 Object paramObj2 = type;
384
385 if (type == null) {
386 paramObj2 = new NullWrapper("java.lang.String");
387 }
388
389 Object paramObj3 = new DoubleWrapper(version);
390
391 Object paramObj4 = displayStyle;
392
393 if (displayStyle == null) {
394 paramObj4 = new NullWrapper("java.lang.String");
395 }
396
397 Object paramObj5 = feedURL;
398
399 if (feedURL == null) {
400 paramObj5 = new NullWrapper("java.lang.String");
401 }
402
403 Object paramObj6 = tagURL;
404
405 if (tagURL == null) {
406 paramObj6 = new NullWrapper("java.lang.String");
407 }
408
409 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
410 "getEntriesRSS",
411 new Object[] {
412 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
413 paramObj5, paramObj6
414 });
415
416 Object returnObj = null;
417
418 try {
419 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
420 }
421 catch (Exception e) {
422 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
423 throw (com.liferay.portal.kernel.exception.PortalException)e;
424 }
425
426 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
427 throw (com.liferay.portal.kernel.exception.SystemException)e;
428 }
429
430 throw new com.liferay.portal.kernel.exception.SystemException(e);
431 }
432
433 return (java.lang.String)returnObj;
434 }
435 catch (com.liferay.portal.kernel.exception.SystemException se) {
436 _log.error(se, se);
437
438 throw se;
439 }
440 }
441
442 public static com.liferay.portlet.asset.model.AssetEntry getEntry(
443 HttpPrincipal httpPrincipal, long entryId)
444 throws com.liferay.portal.kernel.exception.PortalException,
445 com.liferay.portal.kernel.exception.SystemException {
446 try {
447 Object paramObj0 = new LongWrapper(entryId);
448
449 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
450 "getEntry", new Object[] { paramObj0 });
451
452 Object returnObj = null;
453
454 try {
455 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
456 }
457 catch (Exception e) {
458 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
459 throw (com.liferay.portal.kernel.exception.PortalException)e;
460 }
461
462 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
463 throw (com.liferay.portal.kernel.exception.SystemException)e;
464 }
465
466 throw new com.liferay.portal.kernel.exception.SystemException(e);
467 }
468
469 return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
470 }
471 catch (com.liferay.portal.kernel.exception.SystemException se) {
472 _log.error(se, se);
473
474 throw se;
475 }
476 }
477
478 public static void incrementViewCounter(HttpPrincipal httpPrincipal,
479 java.lang.String className, long classPK)
480 throws com.liferay.portal.kernel.exception.PortalException,
481 com.liferay.portal.kernel.exception.SystemException {
482 try {
483 Object paramObj0 = className;
484
485 if (className == null) {
486 paramObj0 = new NullWrapper("java.lang.String");
487 }
488
489 Object paramObj1 = new LongWrapper(classPK);
490
491 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
492 "incrementViewCounter",
493 new Object[] { paramObj0, paramObj1 });
494
495 try {
496 TunnelUtil.invoke(httpPrincipal, methodWrapper);
497 }
498 catch (Exception e) {
499 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
500 throw (com.liferay.portal.kernel.exception.PortalException)e;
501 }
502
503 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
504 throw (com.liferay.portal.kernel.exception.SystemException)e;
505 }
506
507 throw new com.liferay.portal.kernel.exception.SystemException(e);
508 }
509 }
510 catch (com.liferay.portal.kernel.exception.SystemException se) {
511 _log.error(se, se);
512
513 throw se;
514 }
515 }
516
517 public static com.liferay.portlet.asset.model.AssetEntryDisplay[] searchEntryDisplays(
518 HttpPrincipal httpPrincipal, long companyId,
519 java.lang.String portletId, java.lang.String keywords,
520 java.lang.String languageId, int start, int end)
521 throws com.liferay.portal.kernel.exception.SystemException {
522 try {
523 Object paramObj0 = new LongWrapper(companyId);
524
525 Object paramObj1 = portletId;
526
527 if (portletId == null) {
528 paramObj1 = new NullWrapper("java.lang.String");
529 }
530
531 Object paramObj2 = keywords;
532
533 if (keywords == null) {
534 paramObj2 = new NullWrapper("java.lang.String");
535 }
536
537 Object paramObj3 = languageId;
538
539 if (languageId == null) {
540 paramObj3 = new NullWrapper("java.lang.String");
541 }
542
543 Object paramObj4 = new IntegerWrapper(start);
544
545 Object paramObj5 = new IntegerWrapper(end);
546
547 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
548 "searchEntryDisplays",
549 new Object[] {
550 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
551 paramObj5
552 });
553
554 Object returnObj = null;
555
556 try {
557 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
558 }
559 catch (Exception e) {
560 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
561 throw (com.liferay.portal.kernel.exception.SystemException)e;
562 }
563
564 throw new com.liferay.portal.kernel.exception.SystemException(e);
565 }
566
567 return (com.liferay.portlet.asset.model.AssetEntryDisplay[])returnObj;
568 }
569 catch (com.liferay.portal.kernel.exception.SystemException se) {
570 _log.error(se, se);
571
572 throw se;
573 }
574 }
575
576 public static int searchEntryDisplaysCount(HttpPrincipal httpPrincipal,
577 long companyId, java.lang.String portletId, java.lang.String keywords,
578 java.lang.String languageId)
579 throws com.liferay.portal.kernel.exception.SystemException {
580 try {
581 Object paramObj0 = new LongWrapper(companyId);
582
583 Object paramObj1 = portletId;
584
585 if (portletId == null) {
586 paramObj1 = new NullWrapper("java.lang.String");
587 }
588
589 Object paramObj2 = keywords;
590
591 if (keywords == null) {
592 paramObj2 = new NullWrapper("java.lang.String");
593 }
594
595 Object paramObj3 = languageId;
596
597 if (languageId == null) {
598 paramObj3 = new NullWrapper("java.lang.String");
599 }
600
601 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
602 "searchEntryDisplaysCount",
603 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
604
605 Object returnObj = null;
606
607 try {
608 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
609 }
610 catch (Exception e) {
611 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
612 throw (com.liferay.portal.kernel.exception.SystemException)e;
613 }
614
615 throw new com.liferay.portal.kernel.exception.SystemException(e);
616 }
617
618 return ((Integer)returnObj).intValue();
619 }
620 catch (com.liferay.portal.kernel.exception.SystemException se) {
621 _log.error(se, se);
622
623 throw se;
624 }
625 }
626
627 public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
628 HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
629 long classPK, long[] categoryIds, java.lang.String[] tagNames,
630 boolean visible, java.util.Date startDate, java.util.Date endDate,
631 java.util.Date publishDate, java.util.Date expirationDate,
632 java.lang.String mimeType, java.lang.String title,
633 java.lang.String description, java.lang.String summary,
634 java.lang.String url, int height, int width,
635 java.lang.Integer priority, boolean sync)
636 throws com.liferay.portal.kernel.exception.PortalException,
637 com.liferay.portal.kernel.exception.SystemException {
638 try {
639 Object paramObj0 = new LongWrapper(groupId);
640
641 Object paramObj1 = className;
642
643 if (className == null) {
644 paramObj1 = new NullWrapper("java.lang.String");
645 }
646
647 Object paramObj2 = new LongWrapper(classPK);
648
649 Object paramObj3 = categoryIds;
650
651 if (categoryIds == null) {
652 paramObj3 = new NullWrapper("[J");
653 }
654
655 Object paramObj4 = tagNames;
656
657 if (tagNames == null) {
658 paramObj4 = new NullWrapper("[Ljava.lang.String;");
659 }
660
661 Object paramObj5 = new BooleanWrapper(visible);
662
663 Object paramObj6 = startDate;
664
665 if (startDate == null) {
666 paramObj6 = new NullWrapper("java.util.Date");
667 }
668
669 Object paramObj7 = endDate;
670
671 if (endDate == null) {
672 paramObj7 = new NullWrapper("java.util.Date");
673 }
674
675 Object paramObj8 = publishDate;
676
677 if (publishDate == null) {
678 paramObj8 = new NullWrapper("java.util.Date");
679 }
680
681 Object paramObj9 = expirationDate;
682
683 if (expirationDate == null) {
684 paramObj9 = new NullWrapper("java.util.Date");
685 }
686
687 Object paramObj10 = mimeType;
688
689 if (mimeType == null) {
690 paramObj10 = new NullWrapper("java.lang.String");
691 }
692
693 Object paramObj11 = title;
694
695 if (title == null) {
696 paramObj11 = new NullWrapper("java.lang.String");
697 }
698
699 Object paramObj12 = description;
700
701 if (description == null) {
702 paramObj12 = new NullWrapper("java.lang.String");
703 }
704
705 Object paramObj13 = summary;
706
707 if (summary == null) {
708 paramObj13 = new NullWrapper("java.lang.String");
709 }
710
711 Object paramObj14 = url;
712
713 if (url == null) {
714 paramObj14 = new NullWrapper("java.lang.String");
715 }
716
717 Object paramObj15 = new IntegerWrapper(height);
718
719 Object paramObj16 = new IntegerWrapper(width);
720
721 Object paramObj17 = priority;
722
723 if (priority == null) {
724 paramObj17 = new NullWrapper("java.lang.Integer");
725 }
726
727 Object paramObj18 = new BooleanWrapper(sync);
728
729 MethodWrapper methodWrapper = new MethodWrapper(AssetEntryServiceUtil.class.getName(),
730 "updateEntry",
731 new Object[] {
732 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
733 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
734 paramObj10, paramObj11, paramObj12, paramObj13,
735 paramObj14, paramObj15, paramObj16, paramObj17,
736 paramObj18
737 });
738
739 Object returnObj = null;
740
741 try {
742 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
743 }
744 catch (Exception e) {
745 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
746 throw (com.liferay.portal.kernel.exception.PortalException)e;
747 }
748
749 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
750 throw (com.liferay.portal.kernel.exception.SystemException)e;
751 }
752
753 throw new com.liferay.portal.kernel.exception.SystemException(e);
754 }
755
756 return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
757 }
758 catch (com.liferay.portal.kernel.exception.SystemException se) {
759 _log.error(se, se);
760
761 throw se;
762 }
763 }
764
765 private static Log _log = LogFactoryUtil.getLog(AssetEntryServiceHttp.class);
766 }