001    /**
002     * Copyright (c) 2000-2013 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     * Provides the HTTP utility for the
028     * {@link com.liferay.portlet.asset.service.AssetEntryServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it requires an additional
031     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
032     *
033     * <p>
034     * The benefits of using the HTTP utility is that it is fast and allows for
035     * tunneling without the cost of serializing to text. The drawback is that it
036     * only works with Java.
037     * </p>
038     *
039     * <p>
040     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
041     * configure security.
042     * </p>
043     *
044     * <p>
045     * The HTTP utility is only generated for remote services.
046     * </p>
047     *
048     * @author Brian Wing Shun Chan
049     * @see AssetEntryServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portlet.asset.service.AssetEntryServiceUtil
052     * @generated
053     */
054    public class AssetEntryServiceHttp {
055            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getCompanyEntries(
056                    HttpPrincipal httpPrincipal, long companyId, int start, int end)
057                    throws com.liferay.portal.kernel.exception.SystemException {
058                    try {
059                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
060                                            "getCompanyEntries", _getCompanyEntriesParameterTypes0);
061    
062                            MethodHandler methodHandler = new MethodHandler(methodKey,
063                                            companyId, start, end);
064    
065                            Object returnObj = null;
066    
067                            try {
068                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
069                            }
070                            catch (Exception e) {
071                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
072                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
073                                    }
074    
075                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
076                            }
077    
078                            return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
079                    }
080                    catch (com.liferay.portal.kernel.exception.SystemException se) {
081                            _log.error(se, se);
082    
083                            throw se;
084                    }
085            }
086    
087            public static int getCompanyEntriesCount(HttpPrincipal httpPrincipal,
088                    long companyId)
089                    throws com.liferay.portal.kernel.exception.SystemException {
090                    try {
091                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
092                                            "getCompanyEntriesCount",
093                                            _getCompanyEntriesCountParameterTypes1);
094    
095                            MethodHandler methodHandler = new MethodHandler(methodKey, companyId);
096    
097                            Object returnObj = null;
098    
099                            try {
100                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
101                            }
102                            catch (Exception e) {
103                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
104                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
105                                    }
106    
107                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
108                            }
109    
110                            return ((Integer)returnObj).intValue();
111                    }
112                    catch (com.liferay.portal.kernel.exception.SystemException se) {
113                            _log.error(se, se);
114    
115                            throw se;
116                    }
117            }
118    
119            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getEntries(
120                    HttpPrincipal httpPrincipal,
121                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
122                    throws com.liferay.portal.kernel.exception.PortalException,
123                            com.liferay.portal.kernel.exception.SystemException {
124                    try {
125                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
126                                            "getEntries", _getEntriesParameterTypes2);
127    
128                            MethodHandler methodHandler = new MethodHandler(methodKey,
129                                            entryQuery);
130    
131                            Object returnObj = null;
132    
133                            try {
134                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
135                            }
136                            catch (Exception e) {
137                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
138                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
139                                    }
140    
141                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
142                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
143                                    }
144    
145                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
146                            }
147    
148                            return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
149                    }
150                    catch (com.liferay.portal.kernel.exception.SystemException se) {
151                            _log.error(se, se);
152    
153                            throw se;
154                    }
155            }
156    
157            public static int getEntriesCount(HttpPrincipal httpPrincipal,
158                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
159                    throws com.liferay.portal.kernel.exception.PortalException,
160                            com.liferay.portal.kernel.exception.SystemException {
161                    try {
162                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
163                                            "getEntriesCount", _getEntriesCountParameterTypes3);
164    
165                            MethodHandler methodHandler = new MethodHandler(methodKey,
166                                            entryQuery);
167    
168                            Object returnObj = null;
169    
170                            try {
171                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
172                            }
173                            catch (Exception e) {
174                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
175                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
176                                    }
177    
178                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
179                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
180                                    }
181    
182                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
183                            }
184    
185                            return ((Integer)returnObj).intValue();
186                    }
187                    catch (com.liferay.portal.kernel.exception.SystemException se) {
188                            _log.error(se, se);
189    
190                            throw se;
191                    }
192            }
193    
194            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
195                    HttpPrincipal httpPrincipal, long entryId)
196                    throws com.liferay.portal.kernel.exception.PortalException,
197                            com.liferay.portal.kernel.exception.SystemException {
198                    try {
199                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
200                                            "getEntry", _getEntryParameterTypes4);
201    
202                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
203    
204                            Object returnObj = null;
205    
206                            try {
207                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
208                            }
209                            catch (Exception e) {
210                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
211                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
212                                    }
213    
214                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
215                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
216                                    }
217    
218                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
219                            }
220    
221                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
222                    }
223                    catch (com.liferay.portal.kernel.exception.SystemException se) {
224                            _log.error(se, se);
225    
226                            throw se;
227                    }
228            }
229    
230            public static com.liferay.portlet.asset.model.AssetEntry incrementViewCounter(
231                    HttpPrincipal httpPrincipal, java.lang.String className, long classPK)
232                    throws com.liferay.portal.kernel.exception.PortalException,
233                            com.liferay.portal.kernel.exception.SystemException {
234                    try {
235                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
236                                            "incrementViewCounter", _incrementViewCounterParameterTypes5);
237    
238                            MethodHandler methodHandler = new MethodHandler(methodKey,
239                                            className, classPK);
240    
241                            Object returnObj = null;
242    
243                            try {
244                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
245                            }
246                            catch (Exception e) {
247                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
248                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
249                                    }
250    
251                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
252                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
253                                    }
254    
255                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
256                            }
257    
258                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
259                    }
260                    catch (com.liferay.portal.kernel.exception.SystemException se) {
261                            _log.error(se, se);
262    
263                            throw se;
264                    }
265            }
266    
267            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
268                    HttpPrincipal httpPrincipal, long groupId, java.util.Date createDate,
269                    java.util.Date modifiedDate, java.lang.String className, long classPK,
270                    java.lang.String classUuid, long classTypeId, long[] categoryIds,
271                    java.lang.String[] tagNames, boolean visible, java.util.Date startDate,
272                    java.util.Date endDate, java.util.Date expirationDate,
273                    java.lang.String mimeType, java.lang.String title,
274                    java.lang.String description, java.lang.String summary,
275                    java.lang.String url, java.lang.String layoutUuid, int height,
276                    int width, java.lang.Integer priority, boolean sync)
277                    throws com.liferay.portal.kernel.exception.PortalException,
278                            com.liferay.portal.kernel.exception.SystemException {
279                    try {
280                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
281                                            "updateEntry", _updateEntryParameterTypes6);
282    
283                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
284                                            createDate, modifiedDate, className, classPK, classUuid,
285                                            classTypeId, categoryIds, tagNames, visible, startDate,
286                                            endDate, expirationDate, mimeType, title, description,
287                                            summary, url, layoutUuid, height, width, priority, sync);
288    
289                            Object returnObj = null;
290    
291                            try {
292                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
293                            }
294                            catch (Exception e) {
295                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
296                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
297                                    }
298    
299                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
300                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
301                                    }
302    
303                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
304                            }
305    
306                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
307                    }
308                    catch (com.liferay.portal.kernel.exception.SystemException se) {
309                            _log.error(se, se);
310    
311                            throw se;
312                    }
313            }
314    
315            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
316                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
317                    long classPK, java.lang.String classUuid, long classTypeId,
318                    long[] categoryIds, java.lang.String[] tagNames, boolean visible,
319                    java.util.Date startDate, java.util.Date endDate,
320                    java.util.Date publishDate, java.util.Date expirationDate,
321                    java.lang.String mimeType, java.lang.String title,
322                    java.lang.String description, java.lang.String summary,
323                    java.lang.String url, java.lang.String layoutUuid, int height,
324                    int width, java.lang.Integer priority, boolean sync)
325                    throws com.liferay.portal.kernel.exception.PortalException,
326                            com.liferay.portal.kernel.exception.SystemException {
327                    try {
328                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
329                                            "updateEntry", _updateEntryParameterTypes7);
330    
331                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
332                                            className, classPK, classUuid, classTypeId, categoryIds,
333                                            tagNames, visible, startDate, endDate, publishDate,
334                                            expirationDate, mimeType, title, description, summary, url,
335                                            layoutUuid, height, width, priority, sync);
336    
337                            Object returnObj = null;
338    
339                            try {
340                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
341                            }
342                            catch (Exception e) {
343                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
344                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
345                                    }
346    
347                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
348                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
349                                    }
350    
351                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
352                            }
353    
354                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
355                    }
356                    catch (com.liferay.portal.kernel.exception.SystemException se) {
357                            _log.error(se, se);
358    
359                            throw se;
360                    }
361            }
362    
363            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
364                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
365                    long classPK, java.lang.String classUuid, long classTypeId,
366                    long[] categoryIds, java.lang.String[] tagNames, boolean visible,
367                    java.util.Date startDate, java.util.Date endDate,
368                    java.util.Date expirationDate, java.lang.String mimeType,
369                    java.lang.String title, java.lang.String description,
370                    java.lang.String summary, java.lang.String url,
371                    java.lang.String layoutUuid, int height, int width,
372                    java.lang.Integer priority, boolean sync)
373                    throws com.liferay.portal.kernel.exception.PortalException,
374                            com.liferay.portal.kernel.exception.SystemException {
375                    try {
376                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
377                                            "updateEntry", _updateEntryParameterTypes8);
378    
379                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
380                                            className, classPK, classUuid, classTypeId, categoryIds,
381                                            tagNames, visible, startDate, endDate, expirationDate,
382                                            mimeType, title, description, summary, url, layoutUuid,
383                                            height, width, priority, sync);
384    
385                            Object returnObj = null;
386    
387                            try {
388                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
389                            }
390                            catch (Exception e) {
391                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
392                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
393                                    }
394    
395                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
396                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
397                                    }
398    
399                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
400                            }
401    
402                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
403                    }
404                    catch (com.liferay.portal.kernel.exception.SystemException se) {
405                            _log.error(se, se);
406    
407                            throw se;
408                    }
409            }
410    
411            private static Log _log = LogFactoryUtil.getLog(AssetEntryServiceHttp.class);
412            private static final Class<?>[] _getCompanyEntriesParameterTypes0 = new Class[] {
413                            long.class, int.class, int.class
414                    };
415            private static final Class<?>[] _getCompanyEntriesCountParameterTypes1 = new Class[] {
416                            long.class
417                    };
418            private static final Class<?>[] _getEntriesParameterTypes2 = new Class[] {
419                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
420                    };
421            private static final Class<?>[] _getEntriesCountParameterTypes3 = new Class[] {
422                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
423                    };
424            private static final Class<?>[] _getEntryParameterTypes4 = new Class[] {
425                            long.class
426                    };
427            private static final Class<?>[] _incrementViewCounterParameterTypes5 = new Class[] {
428                            java.lang.String.class, long.class
429                    };
430            private static final Class<?>[] _updateEntryParameterTypes6 = new Class[] {
431                            long.class, java.util.Date.class, java.util.Date.class,
432                            java.lang.String.class, long.class, java.lang.String.class,
433                            long.class, long[].class, java.lang.String[].class, boolean.class,
434                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
435                            java.lang.String.class, java.lang.String.class,
436                            java.lang.String.class, java.lang.String.class,
437                            java.lang.String.class, java.lang.String.class, int.class, int.class,
438                            java.lang.Integer.class, boolean.class
439                    };
440            private static final Class<?>[] _updateEntryParameterTypes7 = new Class[] {
441                            long.class, java.lang.String.class, long.class,
442                            java.lang.String.class, long.class, long[].class,
443                            java.lang.String[].class, boolean.class, java.util.Date.class,
444                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
445                            java.lang.String.class, java.lang.String.class,
446                            java.lang.String.class, java.lang.String.class,
447                            java.lang.String.class, java.lang.String.class, int.class, int.class,
448                            java.lang.Integer.class, boolean.class
449                    };
450            private static final Class<?>[] _updateEntryParameterTypes8 = new Class[] {
451                            long.class, java.lang.String.class, long.class,
452                            java.lang.String.class, long.class, long[].class,
453                            java.lang.String[].class, boolean.class, java.util.Date.class,
454                            java.util.Date.class, java.util.Date.class, java.lang.String.class,
455                            java.lang.String.class, java.lang.String.class,
456                            java.lang.String.class, java.lang.String.class,
457                            java.lang.String.class, int.class, int.class,
458                            java.lang.Integer.class, boolean.class
459                    };
460    }