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     * <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 java.util.List<com.liferay.portlet.asset.model.AssetEntry> getCompanyEntries(
058                    HttpPrincipal httpPrincipal, long companyId, int start, int end)
059                    throws com.liferay.portal.kernel.exception.SystemException {
060                    try {
061                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
062                                            "getCompanyEntries", _getCompanyEntriesParameterTypes0);
063    
064                            MethodHandler methodHandler = new MethodHandler(methodKey,
065                                            companyId, start, end);
066    
067                            Object returnObj = null;
068    
069                            try {
070                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
071                            }
072                            catch (Exception e) {
073                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
074                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
075                                    }
076    
077                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
078                            }
079    
080                            return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
081                    }
082                    catch (com.liferay.portal.kernel.exception.SystemException se) {
083                            _log.error(se, se);
084    
085                            throw se;
086                    }
087            }
088    
089            public static int getCompanyEntriesCount(HttpPrincipal httpPrincipal,
090                    long companyId)
091                    throws com.liferay.portal.kernel.exception.SystemException {
092                    try {
093                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
094                                            "getCompanyEntriesCount",
095                                            _getCompanyEntriesCountParameterTypes1);
096    
097                            MethodHandler methodHandler = new MethodHandler(methodKey, companyId);
098    
099                            Object returnObj = null;
100    
101                            try {
102                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
103                            }
104                            catch (Exception e) {
105                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
106                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
107                                    }
108    
109                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
110                            }
111    
112                            return ((Integer)returnObj).intValue();
113                    }
114                    catch (com.liferay.portal.kernel.exception.SystemException se) {
115                            _log.error(se, se);
116    
117                            throw se;
118                    }
119            }
120    
121            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getEntries(
122                    HttpPrincipal httpPrincipal,
123                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
124                    throws com.liferay.portal.kernel.exception.PortalException,
125                            com.liferay.portal.kernel.exception.SystemException {
126                    try {
127                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
128                                            "getEntries", _getEntriesParameterTypes2);
129    
130                            MethodHandler methodHandler = new MethodHandler(methodKey,
131                                            entryQuery);
132    
133                            Object returnObj = null;
134    
135                            try {
136                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
137                            }
138                            catch (Exception e) {
139                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
140                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
141                                    }
142    
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 (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
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 int getEntriesCount(HttpPrincipal httpPrincipal,
160                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
161                    throws com.liferay.portal.kernel.exception.PortalException,
162                            com.liferay.portal.kernel.exception.SystemException {
163                    try {
164                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
165                                            "getEntriesCount", _getEntriesCountParameterTypes3);
166    
167                            MethodHandler methodHandler = new MethodHandler(methodKey,
168                                            entryQuery);
169    
170                            Object returnObj = null;
171    
172                            try {
173                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
174                            }
175                            catch (Exception e) {
176                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
177                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
178                                    }
179    
180                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
181                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
182                                    }
183    
184                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
185                            }
186    
187                            return ((Integer)returnObj).intValue();
188                    }
189                    catch (com.liferay.portal.kernel.exception.SystemException se) {
190                            _log.error(se, se);
191    
192                            throw se;
193                    }
194            }
195    
196            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
197                    HttpPrincipal httpPrincipal, long entryId)
198                    throws com.liferay.portal.kernel.exception.PortalException,
199                            com.liferay.portal.kernel.exception.SystemException {
200                    try {
201                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
202                                            "getEntry", _getEntryParameterTypes4);
203    
204                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
205    
206                            Object returnObj = null;
207    
208                            try {
209                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
210                            }
211                            catch (Exception e) {
212                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
213                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
214                                    }
215    
216                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
217                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
218                                    }
219    
220                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
221                            }
222    
223                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
224                    }
225                    catch (com.liferay.portal.kernel.exception.SystemException se) {
226                            _log.error(se, se);
227    
228                            throw se;
229                    }
230            }
231    
232            public static com.liferay.portlet.asset.model.AssetEntry incrementViewCounter(
233                    HttpPrincipal httpPrincipal, java.lang.String className, long classPK)
234                    throws com.liferay.portal.kernel.exception.PortalException,
235                            com.liferay.portal.kernel.exception.SystemException {
236                    try {
237                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
238                                            "incrementViewCounter", _incrementViewCounterParameterTypes5);
239    
240                            MethodHandler methodHandler = new MethodHandler(methodKey,
241                                            className, classPK);
242    
243                            Object returnObj = null;
244    
245                            try {
246                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
247                            }
248                            catch (Exception e) {
249                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
250                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
251                                    }
252    
253                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
254                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
255                                    }
256    
257                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
258                            }
259    
260                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
261                    }
262                    catch (com.liferay.portal.kernel.exception.SystemException se) {
263                            _log.error(se, se);
264    
265                            throw se;
266                    }
267            }
268    
269            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
270                    HttpPrincipal httpPrincipal, long groupId, java.util.Date createDate,
271                    java.util.Date modifiedDate, java.lang.String className, long classPK,
272                    java.lang.String classUuid, long classTypeId, long[] categoryIds,
273                    java.lang.String[] tagNames, boolean visible, java.util.Date startDate,
274                    java.util.Date endDate, java.util.Date publishDate,
275                    java.util.Date expirationDate, java.lang.String mimeType,
276                    java.lang.String title, java.lang.String description,
277                    java.lang.String summary, java.lang.String url,
278                    java.lang.String layoutUuid, int height, int width,
279                    java.lang.Integer priority, boolean sync)
280                    throws com.liferay.portal.kernel.exception.PortalException,
281                            com.liferay.portal.kernel.exception.SystemException {
282                    try {
283                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
284                                            "updateEntry", _updateEntryParameterTypes6);
285    
286                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
287                                            createDate, modifiedDate, className, classPK, classUuid,
288                                            classTypeId, categoryIds, tagNames, visible, startDate,
289                                            endDate, publishDate, expirationDate, mimeType, title,
290                                            description, summary, url, layoutUuid, height, width,
291                                            priority, sync);
292    
293                            Object returnObj = null;
294    
295                            try {
296                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
297                            }
298                            catch (Exception e) {
299                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
300                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
301                                    }
302    
303                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
304                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
305                                    }
306    
307                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
308                            }
309    
310                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
311                    }
312                    catch (com.liferay.portal.kernel.exception.SystemException se) {
313                            _log.error(se, se);
314    
315                            throw se;
316                    }
317            }
318    
319            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
320                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
321                    long classPK, java.lang.String classUuid, long classTypeId,
322                    long[] categoryIds, java.lang.String[] tagNames, boolean visible,
323                    java.util.Date startDate, java.util.Date endDate,
324                    java.util.Date publishDate, java.util.Date expirationDate,
325                    java.lang.String mimeType, java.lang.String title,
326                    java.lang.String description, java.lang.String summary,
327                    java.lang.String url, java.lang.String layoutUuid, int height,
328                    int width, java.lang.Integer priority, boolean sync)
329                    throws com.liferay.portal.kernel.exception.PortalException,
330                            com.liferay.portal.kernel.exception.SystemException {
331                    try {
332                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class.getName(),
333                                            "updateEntry", _updateEntryParameterTypes7);
334    
335                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
336                                            className, classPK, classUuid, classTypeId, categoryIds,
337                                            tagNames, visible, startDate, endDate, publishDate,
338                                            expirationDate, mimeType, title, description, summary, url,
339                                            layoutUuid, height, width, priority, sync);
340    
341                            Object returnObj = null;
342    
343                            try {
344                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
345                            }
346                            catch (Exception e) {
347                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
348                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
349                                    }
350    
351                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
352                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
353                                    }
354    
355                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
356                            }
357    
358                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
359                    }
360                    catch (com.liferay.portal.kernel.exception.SystemException se) {
361                            _log.error(se, se);
362    
363                            throw se;
364                    }
365            }
366    
367            private static Log _log = LogFactoryUtil.getLog(AssetEntryServiceHttp.class);
368            private static final Class<?>[] _getCompanyEntriesParameterTypes0 = new Class[] {
369                            long.class, int.class, int.class
370                    };
371            private static final Class<?>[] _getCompanyEntriesCountParameterTypes1 = new Class[] {
372                            long.class
373                    };
374            private static final Class<?>[] _getEntriesParameterTypes2 = new Class[] {
375                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
376                    };
377            private static final Class<?>[] _getEntriesCountParameterTypes3 = new Class[] {
378                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
379                    };
380            private static final Class<?>[] _getEntryParameterTypes4 = new Class[] {
381                            long.class
382                    };
383            private static final Class<?>[] _incrementViewCounterParameterTypes5 = new Class[] {
384                            java.lang.String.class, long.class
385                    };
386            private static final Class<?>[] _updateEntryParameterTypes6 = new Class[] {
387                            long.class, java.util.Date.class, java.util.Date.class,
388                            java.lang.String.class, long.class, java.lang.String.class,
389                            long.class, long[].class, java.lang.String[].class, boolean.class,
390                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
391                            java.util.Date.class, java.lang.String.class, java.lang.String.class,
392                            java.lang.String.class, java.lang.String.class,
393                            java.lang.String.class, java.lang.String.class, int.class, int.class,
394                            java.lang.Integer.class, boolean.class
395                    };
396            private static final Class<?>[] _updateEntryParameterTypes7 = new Class[] {
397                            long.class, java.lang.String.class, long.class,
398                            java.lang.String.class, long.class, long[].class,
399                            java.lang.String[].class, boolean.class, java.util.Date.class,
400                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
401                            java.lang.String.class, java.lang.String.class,
402                            java.lang.String.class, java.lang.String.class,
403                            java.lang.String.class, java.lang.String.class, int.class, int.class,
404                            java.lang.Integer.class, boolean.class
405                    };
406    }