001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
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.MethodHandler;
020    import com.liferay.portal.kernel.util.MethodKey;
021    import com.liferay.portal.security.auth.HttpPrincipal;
022    import com.liferay.portal.service.http.TunnelUtil;
023    
024    import com.liferay.portlet.asset.service.AssetEntryServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.asset.service.AssetEntryServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it requires an additional
032     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
033     * </p>
034     *
035     * <p>
036     * The benefits of using the HTTP utility is that it is fast and allows for
037     * tunneling without the cost of serializing to text. The drawback is that it
038     * only works with Java.
039     * </p>
040     *
041     * <p>
042     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
043     * configure security.
044     * </p>
045     *
046     * <p>
047     * The HTTP utility is only generated for remote services.
048     * </p>
049     *
050     * @author    Brian Wing Shun Chan
051     * @see       AssetEntryServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.asset.service.AssetEntryServiceUtil
054     * @generated
055     */
056    public class AssetEntryServiceHttp {
057            public static void deleteEntry(HttpPrincipal httpPrincipal, long entryId)
058                    throws com.liferay.portal.kernel.exception.PortalException,
059                            com.liferay.portal.kernel.exception.SystemException {
060                    try {
061                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
062                                            "deleteEntry", _deleteEntryParameterTypes0);
063    
064                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
065    
066                            try {
067                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
068                            }
069                            catch (Exception e) {
070                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
071                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
072                                    }
073    
074                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
075                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
076                                    }
077    
078                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
079                            }
080                    }
081                    catch (com.liferay.portal.kernel.exception.SystemException se) {
082                            _log.error(se, se);
083    
084                            throw se;
085                    }
086            }
087    
088            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getCompanyEntries(
089                    HttpPrincipal httpPrincipal, long companyId, int start, int end)
090                    throws com.liferay.portal.kernel.exception.SystemException {
091                    try {
092                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
093                                            "getCompanyEntries", _getCompanyEntriesParameterTypes1);
094    
095                            MethodHandler methodHandler = new MethodHandler(methodKey,
096                                            companyId, start, end);
097    
098                            Object returnObj = null;
099    
100                            try {
101                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
102                            }
103                            catch (Exception e) {
104                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
105                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
106                                    }
107    
108                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
109                            }
110    
111                            return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
112                    }
113                    catch (com.liferay.portal.kernel.exception.SystemException se) {
114                            _log.error(se, se);
115    
116                            throw se;
117                    }
118            }
119    
120            public static int getCompanyEntriesCount(HttpPrincipal httpPrincipal,
121                    long companyId)
122                    throws com.liferay.portal.kernel.exception.SystemException {
123                    try {
124                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
125                                            "getCompanyEntriesCount",
126                                            _getCompanyEntriesCountParameterTypes2);
127    
128                            MethodHandler methodHandler = new MethodHandler(methodKey, companyId);
129    
130                            Object returnObj = null;
131    
132                            try {
133                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
134                            }
135                            catch (Exception e) {
136                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
137                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
138                                    }
139    
140                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
141                            }
142    
143                            return ((Integer)returnObj).intValue();
144                    }
145                    catch (com.liferay.portal.kernel.exception.SystemException se) {
146                            _log.error(se, se);
147    
148                            throw se;
149                    }
150            }
151    
152            public static java.lang.String getCompanyEntriesRSS(
153                    HttpPrincipal httpPrincipal, long companyId, int max,
154                    java.lang.String type, double version, java.lang.String displayStyle,
155                    java.lang.String feedURL, java.lang.String tagURL)
156                    throws com.liferay.portal.kernel.exception.PortalException,
157                            com.liferay.portal.kernel.exception.SystemException {
158                    try {
159                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
160                                            "getCompanyEntriesRSS", _getCompanyEntriesRSSParameterTypes3);
161    
162                            MethodHandler methodHandler = new MethodHandler(methodKey,
163                                            companyId, max, type, version, displayStyle, feedURL, tagURL);
164    
165                            Object returnObj = null;
166    
167                            try {
168                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
169                            }
170                            catch (Exception e) {
171                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
172                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
173                                    }
174    
175                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
176                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
177                                    }
178    
179                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
180                            }
181    
182                            return (java.lang.String)returnObj;
183                    }
184                    catch (com.liferay.portal.kernel.exception.SystemException se) {
185                            _log.error(se, se);
186    
187                            throw se;
188                    }
189            }
190    
191            public static com.liferay.portlet.asset.model.AssetEntryDisplay[] getCompanyEntryDisplays(
192                    HttpPrincipal httpPrincipal, long companyId, int start, int end,
193                    java.lang.String languageId)
194                    throws com.liferay.portal.kernel.exception.SystemException {
195                    try {
196                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
197                                            "getCompanyEntryDisplays",
198                                            _getCompanyEntryDisplaysParameterTypes4);
199    
200                            MethodHandler methodHandler = new MethodHandler(methodKey,
201                                            companyId, start, end, languageId);
202    
203                            Object returnObj = null;
204    
205                            try {
206                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
207                            }
208                            catch (Exception e) {
209                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
210                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
211                                    }
212    
213                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
214                            }
215    
216                            return (com.liferay.portlet.asset.model.AssetEntryDisplay[])returnObj;
217                    }
218                    catch (com.liferay.portal.kernel.exception.SystemException se) {
219                            _log.error(se, se);
220    
221                            throw se;
222                    }
223            }
224    
225            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getEntries(
226                    HttpPrincipal httpPrincipal,
227                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
228                    throws com.liferay.portal.kernel.exception.PortalException,
229                            com.liferay.portal.kernel.exception.SystemException {
230                    try {
231                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
232                                            "getEntries", _getEntriesParameterTypes5);
233    
234                            MethodHandler methodHandler = new MethodHandler(methodKey,
235                                            entryQuery);
236    
237                            Object returnObj = null;
238    
239                            try {
240                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
241                            }
242                            catch (Exception e) {
243                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
244                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
245                                    }
246    
247                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
248                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
249                                    }
250    
251                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
252                            }
253    
254                            return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
255                    }
256                    catch (com.liferay.portal.kernel.exception.SystemException se) {
257                            _log.error(se, se);
258    
259                            throw se;
260                    }
261            }
262    
263            public static int getEntriesCount(HttpPrincipal httpPrincipal,
264                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
265                    throws com.liferay.portal.kernel.exception.PortalException,
266                            com.liferay.portal.kernel.exception.SystemException {
267                    try {
268                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
269                                            "getEntriesCount", _getEntriesCountParameterTypes6);
270    
271                            MethodHandler methodHandler = new MethodHandler(methodKey,
272                                            entryQuery);
273    
274                            Object returnObj = null;
275    
276                            try {
277                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
278                            }
279                            catch (Exception e) {
280                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
281                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
282                                    }
283    
284                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
285                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
286                                    }
287    
288                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
289                            }
290    
291                            return ((Integer)returnObj).intValue();
292                    }
293                    catch (com.liferay.portal.kernel.exception.SystemException se) {
294                            _log.error(se, se);
295    
296                            throw se;
297                    }
298            }
299    
300            public static java.lang.String getEntriesRSS(HttpPrincipal httpPrincipal,
301                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery,
302                    java.lang.String name, java.lang.String type, double version,
303                    java.lang.String displayStyle, java.lang.String feedURL,
304                    java.lang.String tagURL)
305                    throws com.liferay.portal.kernel.exception.PortalException,
306                            com.liferay.portal.kernel.exception.SystemException {
307                    try {
308                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
309                                            "getEntriesRSS", _getEntriesRSSParameterTypes7);
310    
311                            MethodHandler methodHandler = new MethodHandler(methodKey,
312                                            entryQuery, name, type, version, displayStyle, feedURL,
313                                            tagURL);
314    
315                            Object returnObj = null;
316    
317                            try {
318                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
319                            }
320                            catch (Exception e) {
321                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
322                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
323                                    }
324    
325                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
326                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
327                                    }
328    
329                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
330                            }
331    
332                            return (java.lang.String)returnObj;
333                    }
334                    catch (com.liferay.portal.kernel.exception.SystemException se) {
335                            _log.error(se, se);
336    
337                            throw se;
338                    }
339            }
340    
341            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
342                    HttpPrincipal httpPrincipal, long entryId)
343                    throws com.liferay.portal.kernel.exception.PortalException,
344                            com.liferay.portal.kernel.exception.SystemException {
345                    try {
346                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
347                                            "getEntry", _getEntryParameterTypes8);
348    
349                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
350    
351                            Object returnObj = null;
352    
353                            try {
354                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
355                            }
356                            catch (Exception e) {
357                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
358                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
359                                    }
360    
361                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
362                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
363                                    }
364    
365                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
366                            }
367    
368                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
369                    }
370                    catch (com.liferay.portal.kernel.exception.SystemException se) {
371                            _log.error(se, se);
372    
373                            throw se;
374                    }
375            }
376    
377            public static void incrementViewCounter(HttpPrincipal httpPrincipal,
378                    java.lang.String className, long classPK)
379                    throws com.liferay.portal.kernel.exception.PortalException,
380                            com.liferay.portal.kernel.exception.SystemException {
381                    try {
382                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
383                                            "incrementViewCounter", _incrementViewCounterParameterTypes9);
384    
385                            MethodHandler methodHandler = new MethodHandler(methodKey,
386                                            className, classPK);
387    
388                            try {
389                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
390                            }
391                            catch (Exception e) {
392                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
393                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
394                                    }
395    
396                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
397                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
398                                    }
399    
400                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
401                            }
402                    }
403                    catch (com.liferay.portal.kernel.exception.SystemException se) {
404                            _log.error(se, se);
405    
406                            throw se;
407                    }
408            }
409    
410            public static com.liferay.portlet.asset.model.AssetEntryDisplay[] searchEntryDisplays(
411                    HttpPrincipal httpPrincipal, long companyId,
412                    java.lang.String portletId, java.lang.String keywords,
413                    java.lang.String languageId, int start, int end)
414                    throws com.liferay.portal.kernel.exception.SystemException {
415                    try {
416                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
417                                            "searchEntryDisplays", _searchEntryDisplaysParameterTypes10);
418    
419                            MethodHandler methodHandler = new MethodHandler(methodKey,
420                                            companyId, portletId, keywords, languageId, start, end);
421    
422                            Object returnObj = null;
423    
424                            try {
425                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
426                            }
427                            catch (Exception e) {
428                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
429                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
430                                    }
431    
432                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
433                            }
434    
435                            return (com.liferay.portlet.asset.model.AssetEntryDisplay[])returnObj;
436                    }
437                    catch (com.liferay.portal.kernel.exception.SystemException se) {
438                            _log.error(se, se);
439    
440                            throw se;
441                    }
442            }
443    
444            public static int searchEntryDisplaysCount(HttpPrincipal httpPrincipal,
445                    long companyId, java.lang.String portletId, java.lang.String keywords,
446                    java.lang.String languageId)
447                    throws com.liferay.portal.kernel.exception.SystemException {
448                    try {
449                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
450                                            "searchEntryDisplaysCount",
451                                            _searchEntryDisplaysCountParameterTypes11);
452    
453                            MethodHandler methodHandler = new MethodHandler(methodKey,
454                                            companyId, portletId, keywords, languageId);
455    
456                            Object returnObj = null;
457    
458                            try {
459                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
460                            }
461                            catch (Exception e) {
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 ((Integer)returnObj).intValue();
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 com.liferay.portlet.asset.model.AssetEntry updateEntry(
479                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
480                    long classPK, java.lang.String classUuid, long[] categoryIds,
481                    java.lang.String[] tagNames, boolean visible, java.util.Date startDate,
482                    java.util.Date endDate, java.util.Date publishDate,
483                    java.util.Date expirationDate, java.lang.String mimeType,
484                    java.lang.String title, java.lang.String description,
485                    java.lang.String summary, java.lang.String url, int height, int width,
486                    java.lang.Integer priority, boolean sync)
487                    throws com.liferay.portal.kernel.exception.PortalException,
488                            com.liferay.portal.kernel.exception.SystemException {
489                    try {
490                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
491                                            "updateEntry", _updateEntryParameterTypes12);
492    
493                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
494                                            className, classPK, classUuid, categoryIds, tagNames,
495                                            visible, startDate, endDate, publishDate, expirationDate,
496                                            mimeType, title, description, summary, url, height, width,
497                                            priority, sync);
498    
499                            Object returnObj = null;
500    
501                            try {
502                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
503                            }
504                            catch (Exception e) {
505                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
506                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
507                                    }
508    
509                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
510                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
511                                    }
512    
513                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
514                            }
515    
516                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
517                    }
518                    catch (com.liferay.portal.kernel.exception.SystemException se) {
519                            _log.error(se, se);
520    
521                            throw se;
522                    }
523            }
524    
525            private static Log _log = LogFactoryUtil.getLog(AssetEntryServiceHttp.class);
526            private static final Class<?>[] _deleteEntryParameterTypes0 = new Class[] {
527                            long.class
528                    };
529            private static final Class<?>[] _getCompanyEntriesParameterTypes1 = new Class[] {
530                            long.class, int.class, int.class
531                    };
532            private static final Class<?>[] _getCompanyEntriesCountParameterTypes2 = new Class[] {
533                            long.class
534                    };
535            private static final Class<?>[] _getCompanyEntriesRSSParameterTypes3 = new Class[] {
536                            long.class, int.class, java.lang.String.class, double.class,
537                            java.lang.String.class, java.lang.String.class,
538                            java.lang.String.class
539                    };
540            private static final Class<?>[] _getCompanyEntryDisplaysParameterTypes4 = new Class[] {
541                            long.class, int.class, int.class, java.lang.String.class
542                    };
543            private static final Class<?>[] _getEntriesParameterTypes5 = new Class[] {
544                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
545                    };
546            private static final Class<?>[] _getEntriesCountParameterTypes6 = new Class[] {
547                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
548                    };
549            private static final Class<?>[] _getEntriesRSSParameterTypes7 = new Class[] {
550                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class,
551                            java.lang.String.class, java.lang.String.class, double.class,
552                            java.lang.String.class, java.lang.String.class,
553                            java.lang.String.class
554                    };
555            private static final Class<?>[] _getEntryParameterTypes8 = new Class[] {
556                            long.class
557                    };
558            private static final Class<?>[] _incrementViewCounterParameterTypes9 = new Class[] {
559                            java.lang.String.class, long.class
560                    };
561            private static final Class<?>[] _searchEntryDisplaysParameterTypes10 = new Class[] {
562                            long.class, java.lang.String.class, java.lang.String.class,
563                            java.lang.String.class, int.class, int.class
564                    };
565            private static final Class<?>[] _searchEntryDisplaysCountParameterTypes11 = new Class[] {
566                            long.class, java.lang.String.class, java.lang.String.class,
567                            java.lang.String.class
568                    };
569            private static final Class<?>[] _updateEntryParameterTypes12 = new Class[] {
570                            long.class, java.lang.String.class, long.class,
571                            java.lang.String.class, long[].class, java.lang.String[].class,
572                            boolean.class, java.util.Date.class, java.util.Date.class,
573                            java.util.Date.class, java.util.Date.class, java.lang.String.class,
574                            java.lang.String.class, java.lang.String.class,
575                            java.lang.String.class, java.lang.String.class, int.class, int.class,
576                            java.lang.Integer.class, boolean.class
577                    };
578    }