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