001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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", long.class);
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", long.class, int.class, int.class);
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", long.class);
126    
127                            MethodHandler methodHandler = new MethodHandler(methodKey, companyId);
128    
129                            Object returnObj = null;
130    
131                            try {
132                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
133                            }
134                            catch (Exception e) {
135                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
136                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
137                                    }
138    
139                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
140                            }
141    
142                            return ((Integer)returnObj).intValue();
143                    }
144                    catch (com.liferay.portal.kernel.exception.SystemException se) {
145                            _log.error(se, se);
146    
147                            throw se;
148                    }
149            }
150    
151            public static java.lang.String getCompanyEntriesRSS(
152                    HttpPrincipal httpPrincipal, long companyId, int max,
153                    java.lang.String type, double version, java.lang.String displayStyle,
154                    java.lang.String feedURL, java.lang.String tagURL)
155                    throws com.liferay.portal.kernel.exception.PortalException,
156                            com.liferay.portal.kernel.exception.SystemException {
157                    try {
158                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
159                                            "getCompanyEntriesRSS", long.class, int.class,
160                                            java.lang.String.class, double.class,
161                                            java.lang.String.class, java.lang.String.class,
162                                            java.lang.String.class);
163    
164                            MethodHandler methodHandler = new MethodHandler(methodKey,
165                                            companyId, max, type, version, displayStyle, feedURL, tagURL);
166    
167                            Object returnObj = null;
168    
169                            try {
170                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
171                            }
172                            catch (Exception e) {
173                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
174                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
175                                    }
176    
177                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
178                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
179                                    }
180    
181                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
182                            }
183    
184                            return (java.lang.String)returnObj;
185                    }
186                    catch (com.liferay.portal.kernel.exception.SystemException se) {
187                            _log.error(se, se);
188    
189                            throw se;
190                    }
191            }
192    
193            public static com.liferay.portlet.asset.model.AssetEntryDisplay[] getCompanyEntryDisplays(
194                    HttpPrincipal httpPrincipal, long companyId, int start, int end,
195                    java.lang.String languageId)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    try {
198                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
199                                            "getCompanyEntryDisplays", long.class, int.class,
200                                            int.class, java.lang.String.class);
201    
202                            MethodHandler methodHandler = new MethodHandler(methodKey,
203                                            companyId, start, end, languageId);
204    
205                            Object returnObj = null;
206    
207                            try {
208                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
209                            }
210                            catch (Exception e) {
211                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
212                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
213                                    }
214    
215                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
216                            }
217    
218                            return (com.liferay.portlet.asset.model.AssetEntryDisplay[])returnObj;
219                    }
220                    catch (com.liferay.portal.kernel.exception.SystemException se) {
221                            _log.error(se, se);
222    
223                            throw se;
224                    }
225            }
226    
227            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getEntries(
228                    HttpPrincipal httpPrincipal,
229                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
230                    throws com.liferay.portal.kernel.exception.PortalException,
231                            com.liferay.portal.kernel.exception.SystemException {
232                    try {
233                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
234                                            "getEntries",
235                                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class);
236    
237                            MethodHandler methodHandler = new MethodHandler(methodKey,
238                                            entryQuery);
239    
240                            Object returnObj = null;
241    
242                            try {
243                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
244                            }
245                            catch (Exception e) {
246                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
247                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
248                                    }
249    
250                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
251                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
252                                    }
253    
254                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
255                            }
256    
257                            return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
258                    }
259                    catch (com.liferay.portal.kernel.exception.SystemException se) {
260                            _log.error(se, se);
261    
262                            throw se;
263                    }
264            }
265    
266            public static int getEntriesCount(HttpPrincipal httpPrincipal,
267                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
268                    throws com.liferay.portal.kernel.exception.PortalException,
269                            com.liferay.portal.kernel.exception.SystemException {
270                    try {
271                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
272                                            "getEntriesCount",
273                                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class);
274    
275                            MethodHandler methodHandler = new MethodHandler(methodKey,
276                                            entryQuery);
277    
278                            Object returnObj = null;
279    
280                            try {
281                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
282                            }
283                            catch (Exception e) {
284                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
285                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
286                                    }
287    
288                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
289                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
290                                    }
291    
292                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
293                            }
294    
295                            return ((Integer)returnObj).intValue();
296                    }
297                    catch (com.liferay.portal.kernel.exception.SystemException se) {
298                            _log.error(se, se);
299    
300                            throw se;
301                    }
302            }
303    
304            public static java.lang.String getEntriesRSS(HttpPrincipal httpPrincipal,
305                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery,
306                    java.lang.String name, java.lang.String type, double version,
307                    java.lang.String displayStyle, java.lang.String feedURL,
308                    java.lang.String tagURL)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException {
311                    try {
312                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
313                                            "getEntriesRSS",
314                                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class,
315                                            java.lang.String.class, java.lang.String.class,
316                                            double.class, java.lang.String.class,
317                                            java.lang.String.class, java.lang.String.class);
318    
319                            MethodHandler methodHandler = new MethodHandler(methodKey,
320                                            entryQuery, name, type, version, displayStyle, feedURL,
321                                            tagURL);
322    
323                            Object returnObj = null;
324    
325                            try {
326                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
327                            }
328                            catch (Exception e) {
329                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
330                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
331                                    }
332    
333                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
334                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
335                                    }
336    
337                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
338                            }
339    
340                            return (java.lang.String)returnObj;
341                    }
342                    catch (com.liferay.portal.kernel.exception.SystemException se) {
343                            _log.error(se, se);
344    
345                            throw se;
346                    }
347            }
348    
349            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
350                    HttpPrincipal httpPrincipal, long entryId)
351                    throws com.liferay.portal.kernel.exception.PortalException,
352                            com.liferay.portal.kernel.exception.SystemException {
353                    try {
354                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
355                                            "getEntry", long.class);
356    
357                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
358    
359                            Object returnObj = null;
360    
361                            try {
362                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
363                            }
364                            catch (Exception e) {
365                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
366                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
367                                    }
368    
369                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
370                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
371                                    }
372    
373                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
374                            }
375    
376                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
377                    }
378                    catch (com.liferay.portal.kernel.exception.SystemException se) {
379                            _log.error(se, se);
380    
381                            throw se;
382                    }
383            }
384    
385            public static void incrementViewCounter(HttpPrincipal httpPrincipal,
386                    java.lang.String className, long classPK)
387                    throws com.liferay.portal.kernel.exception.PortalException,
388                            com.liferay.portal.kernel.exception.SystemException {
389                    try {
390                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
391                                            "incrementViewCounter", java.lang.String.class, long.class);
392    
393                            MethodHandler methodHandler = new MethodHandler(methodKey,
394                                            className, classPK);
395    
396                            try {
397                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
398                            }
399                            catch (Exception e) {
400                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
401                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
402                                    }
403    
404                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
405                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
406                                    }
407    
408                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
409                            }
410                    }
411                    catch (com.liferay.portal.kernel.exception.SystemException se) {
412                            _log.error(se, se);
413    
414                            throw se;
415                    }
416            }
417    
418            public static com.liferay.portlet.asset.model.AssetEntryDisplay[] searchEntryDisplays(
419                    HttpPrincipal httpPrincipal, long companyId,
420                    java.lang.String portletId, java.lang.String keywords,
421                    java.lang.String languageId, int start, int end)
422                    throws com.liferay.portal.kernel.exception.SystemException {
423                    try {
424                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
425                                            "searchEntryDisplays", long.class, java.lang.String.class,
426                                            java.lang.String.class, java.lang.String.class, int.class,
427                                            int.class);
428    
429                            MethodHandler methodHandler = new MethodHandler(methodKey,
430                                            companyId, portletId, keywords, languageId, start, end);
431    
432                            Object returnObj = null;
433    
434                            try {
435                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
436                            }
437                            catch (Exception e) {
438                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
439                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
440                                    }
441    
442                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
443                            }
444    
445                            return (com.liferay.portlet.asset.model.AssetEntryDisplay[])returnObj;
446                    }
447                    catch (com.liferay.portal.kernel.exception.SystemException se) {
448                            _log.error(se, se);
449    
450                            throw se;
451                    }
452            }
453    
454            public static int searchEntryDisplaysCount(HttpPrincipal httpPrincipal,
455                    long companyId, java.lang.String portletId, java.lang.String keywords,
456                    java.lang.String languageId)
457                    throws com.liferay.portal.kernel.exception.SystemException {
458                    try {
459                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
460                                            "searchEntryDisplaysCount", long.class,
461                                            java.lang.String.class, java.lang.String.class,
462                                            java.lang.String.class);
463    
464                            MethodHandler methodHandler = new MethodHandler(methodKey,
465                                            companyId, portletId, keywords, languageId);
466    
467                            Object returnObj = null;
468    
469                            try {
470                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
471                            }
472                            catch (Exception e) {
473                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
474                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
475                                    }
476    
477                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
478                            }
479    
480                            return ((Integer)returnObj).intValue();
481                    }
482                    catch (com.liferay.portal.kernel.exception.SystemException se) {
483                            _log.error(se, se);
484    
485                            throw se;
486                    }
487            }
488    
489            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
490                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
491                    long classPK, java.lang.String classUuid, long[] categoryIds,
492                    java.lang.String[] tagNames, boolean visible, java.util.Date startDate,
493                    java.util.Date endDate, java.util.Date publishDate,
494                    java.util.Date expirationDate, java.lang.String mimeType,
495                    java.lang.String title, java.lang.String description,
496                    java.lang.String summary, java.lang.String url, int height, int width,
497                    java.lang.Integer priority, boolean sync)
498                    throws com.liferay.portal.kernel.exception.PortalException,
499                            com.liferay.portal.kernel.exception.SystemException {
500                    try {
501                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
502                                            "updateEntry", long.class, java.lang.String.class,
503                                            long.class, java.lang.String.class, long[].class,
504                                            java.lang.String[].class, boolean.class,
505                                            java.util.Date.class, java.util.Date.class,
506                                            java.util.Date.class, java.util.Date.class,
507                                            java.lang.String.class, java.lang.String.class,
508                                            java.lang.String.class, java.lang.String.class,
509                                            java.lang.String.class, int.class, int.class,
510                                            java.lang.Integer.class, boolean.class);
511    
512                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
513                                            className, classPK, classUuid, categoryIds, tagNames,
514                                            visible, startDate, endDate, publishDate, expirationDate,
515                                            mimeType, title, description, summary, url, height, width,
516                                            priority, sync);
517    
518                            Object returnObj = null;
519    
520                            try {
521                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
522                            }
523                            catch (Exception e) {
524                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
525                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
526                                    }
527    
528                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
529                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
530                                    }
531    
532                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
533                            }
534    
535                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
536                    }
537                    catch (com.liferay.portal.kernel.exception.SystemException se) {
538                            _log.error(se, se);
539    
540                            throw se;
541                    }
542            }
543    
544            private static Log _log = LogFactoryUtil.getLog(AssetEntryServiceHttp.class);
545    }