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.AssetVocabularyServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.asset.service.AssetVocabularyServiceUtil} 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       AssetVocabularyServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.asset.service.AssetVocabularyServiceUtil
054     * @generated
055     */
056    public class AssetVocabularyServiceHttp {
057            public static com.liferay.portlet.asset.model.AssetVocabulary addVocabulary(
058                    HttpPrincipal httpPrincipal,
059                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
060                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
061                    java.lang.String settings,
062                    com.liferay.portal.service.ServiceContext serviceContext)
063                    throws com.liferay.portal.kernel.exception.PortalException,
064                            com.liferay.portal.kernel.exception.SystemException {
065                    try {
066                            MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
067                                            "addVocabulary", _addVocabularyParameterTypes0);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey,
070                                            titleMap, descriptionMap, settings, serviceContext);
071    
072                            Object returnObj = null;
073    
074                            try {
075                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
076                            }
077                            catch (Exception e) {
078                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
079                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
080                                    }
081    
082                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
083                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
084                                    }
085    
086                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
087                            }
088    
089                            return (com.liferay.portlet.asset.model.AssetVocabulary)returnObj;
090                    }
091                    catch (com.liferay.portal.kernel.exception.SystemException se) {
092                            _log.error(se, se);
093    
094                            throw se;
095                    }
096            }
097    
098            public static com.liferay.portlet.asset.model.AssetVocabulary addVocabulary(
099                    HttpPrincipal httpPrincipal, java.lang.String title,
100                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
101                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
102                    java.lang.String settings,
103                    com.liferay.portal.service.ServiceContext serviceContext)
104                    throws com.liferay.portal.kernel.exception.PortalException,
105                            com.liferay.portal.kernel.exception.SystemException {
106                    try {
107                            MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
108                                            "addVocabulary", _addVocabularyParameterTypes1);
109    
110                            MethodHandler methodHandler = new MethodHandler(methodKey, title,
111                                            titleMap, descriptionMap, settings, serviceContext);
112    
113                            Object returnObj = null;
114    
115                            try {
116                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
117                            }
118                            catch (Exception e) {
119                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
120                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
121                                    }
122    
123                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
124                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
125                                    }
126    
127                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
128                            }
129    
130                            return (com.liferay.portlet.asset.model.AssetVocabulary)returnObj;
131                    }
132                    catch (com.liferay.portal.kernel.exception.SystemException se) {
133                            _log.error(se, se);
134    
135                            throw se;
136                    }
137            }
138    
139            public static void deleteVocabulary(HttpPrincipal httpPrincipal,
140                    long vocabularyId)
141                    throws com.liferay.portal.kernel.exception.PortalException,
142                            com.liferay.portal.kernel.exception.SystemException {
143                    try {
144                            MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
145                                            "deleteVocabulary", _deleteVocabularyParameterTypes2);
146    
147                            MethodHandler methodHandler = new MethodHandler(methodKey,
148                                            vocabularyId);
149    
150                            try {
151                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
152                            }
153                            catch (Exception e) {
154                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
155                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
156                                    }
157    
158                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
159                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
160                                    }
161    
162                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
163                            }
164                    }
165                    catch (com.liferay.portal.kernel.exception.SystemException se) {
166                            _log.error(se, se);
167    
168                            throw se;
169                    }
170            }
171    
172            public static java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> getCompanyVocabularies(
173                    HttpPrincipal httpPrincipal, long companyId)
174                    throws com.liferay.portal.kernel.exception.PortalException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    try {
177                            MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
178                                            "getCompanyVocabularies",
179                                            _getCompanyVocabulariesParameterTypes3);
180    
181                            MethodHandler methodHandler = new MethodHandler(methodKey, companyId);
182    
183                            Object returnObj = null;
184    
185                            try {
186                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
187                            }
188                            catch (Exception e) {
189                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
190                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
191                                    }
192    
193                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
194                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
195                                    }
196    
197                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
198                            }
199    
200                            return (java.util.List<com.liferay.portlet.asset.model.AssetVocabulary>)returnObj;
201                    }
202                    catch (com.liferay.portal.kernel.exception.SystemException se) {
203                            _log.error(se, se);
204    
205                            throw se;
206                    }
207            }
208    
209            public static java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> getGroupsVocabularies(
210                    HttpPrincipal httpPrincipal, long[] groupIds)
211                    throws com.liferay.portal.kernel.exception.PortalException,
212                            com.liferay.portal.kernel.exception.SystemException {
213                    try {
214                            MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
215                                            "getGroupsVocabularies",
216                                            _getGroupsVocabulariesParameterTypes4);
217    
218                            MethodHandler methodHandler = new MethodHandler(methodKey, groupIds);
219    
220                            Object returnObj = null;
221    
222                            try {
223                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
224                            }
225                            catch (Exception e) {
226                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
227                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
228                                    }
229    
230                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
231                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
232                                    }
233    
234                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
235                            }
236    
237                            return (java.util.List<com.liferay.portlet.asset.model.AssetVocabulary>)returnObj;
238                    }
239                    catch (com.liferay.portal.kernel.exception.SystemException se) {
240                            _log.error(se, se);
241    
242                            throw se;
243                    }
244            }
245    
246            public static java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> getGroupVocabularies(
247                    HttpPrincipal httpPrincipal, long groupId)
248                    throws com.liferay.portal.kernel.exception.PortalException,
249                            com.liferay.portal.kernel.exception.SystemException {
250                    try {
251                            MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
252                                            "getGroupVocabularies", _getGroupVocabulariesParameterTypes5);
253    
254                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId);
255    
256                            Object returnObj = null;
257    
258                            try {
259                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
260                            }
261                            catch (Exception e) {
262                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
263                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
264                                    }
265    
266                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
267                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
268                                    }
269    
270                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
271                            }
272    
273                            return (java.util.List<com.liferay.portlet.asset.model.AssetVocabulary>)returnObj;
274                    }
275                    catch (com.liferay.portal.kernel.exception.SystemException se) {
276                            _log.error(se, se);
277    
278                            throw se;
279                    }
280            }
281    
282            public static com.liferay.portlet.asset.model.AssetVocabulary getVocabulary(
283                    HttpPrincipal httpPrincipal, long vocabularyId)
284                    throws com.liferay.portal.kernel.exception.PortalException,
285                            com.liferay.portal.kernel.exception.SystemException {
286                    try {
287                            MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
288                                            "getVocabulary", _getVocabularyParameterTypes6);
289    
290                            MethodHandler methodHandler = new MethodHandler(methodKey,
291                                            vocabularyId);
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.AssetVocabulary)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.AssetVocabulary updateVocabulary(
320                    HttpPrincipal httpPrincipal, long vocabularyId,
321                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
322                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
323                    java.lang.String settings,
324                    com.liferay.portal.service.ServiceContext serviceContext)
325                    throws com.liferay.portal.kernel.exception.PortalException,
326                            com.liferay.portal.kernel.exception.SystemException {
327                    try {
328                            MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
329                                            "updateVocabulary", _updateVocabularyParameterTypes7);
330    
331                            MethodHandler methodHandler = new MethodHandler(methodKey,
332                                            vocabularyId, titleMap, descriptionMap, settings,
333                                            serviceContext);
334    
335                            Object returnObj = null;
336    
337                            try {
338                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
339                            }
340                            catch (Exception e) {
341                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
342                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
343                                    }
344    
345                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
346                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
347                                    }
348    
349                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
350                            }
351    
352                            return (com.liferay.portlet.asset.model.AssetVocabulary)returnObj;
353                    }
354                    catch (com.liferay.portal.kernel.exception.SystemException se) {
355                            _log.error(se, se);
356    
357                            throw se;
358                    }
359            }
360    
361            public static com.liferay.portlet.asset.model.AssetVocabulary updateVocabulary(
362                    HttpPrincipal httpPrincipal, long vocabularyId, java.lang.String title,
363                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
364                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
365                    java.lang.String settings,
366                    com.liferay.portal.service.ServiceContext serviceContext)
367                    throws com.liferay.portal.kernel.exception.PortalException,
368                            com.liferay.portal.kernel.exception.SystemException {
369                    try {
370                            MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
371                                            "updateVocabulary", _updateVocabularyParameterTypes8);
372    
373                            MethodHandler methodHandler = new MethodHandler(methodKey,
374                                            vocabularyId, title, titleMap, descriptionMap, settings,
375                                            serviceContext);
376    
377                            Object returnObj = null;
378    
379                            try {
380                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
381                            }
382                            catch (Exception e) {
383                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
384                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
385                                    }
386    
387                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
388                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
389                                    }
390    
391                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
392                            }
393    
394                            return (com.liferay.portlet.asset.model.AssetVocabulary)returnObj;
395                    }
396                    catch (com.liferay.portal.kernel.exception.SystemException se) {
397                            _log.error(se, se);
398    
399                            throw se;
400                    }
401            }
402    
403            private static Log _log = LogFactoryUtil.getLog(AssetVocabularyServiceHttp.class);
404            private static final Class<?>[] _addVocabularyParameterTypes0 = new Class[] {
405                            java.util.Map.class, java.util.Map.class, java.lang.String.class,
406                            com.liferay.portal.service.ServiceContext.class
407                    };
408            private static final Class<?>[] _addVocabularyParameterTypes1 = new Class[] {
409                            java.lang.String.class, java.util.Map.class, java.util.Map.class,
410                            java.lang.String.class,
411                            com.liferay.portal.service.ServiceContext.class
412                    };
413            private static final Class<?>[] _deleteVocabularyParameterTypes2 = new Class[] {
414                            long.class
415                    };
416            private static final Class<?>[] _getCompanyVocabulariesParameterTypes3 = new Class[] {
417                            long.class
418                    };
419            private static final Class<?>[] _getGroupsVocabulariesParameterTypes4 = new Class[] {
420                            long[].class
421                    };
422            private static final Class<?>[] _getGroupVocabulariesParameterTypes5 = new Class[] {
423                            long.class
424                    };
425            private static final Class<?>[] _getVocabularyParameterTypes6 = new Class[] {
426                            long.class
427                    };
428            private static final Class<?>[] _updateVocabularyParameterTypes7 = new Class[] {
429                            long.class, java.util.Map.class, java.util.Map.class,
430                            java.lang.String.class,
431                            com.liferay.portal.service.ServiceContext.class
432                    };
433            private static final Class<?>[] _updateVocabularyParameterTypes8 = new Class[] {
434                            long.class, java.lang.String.class, java.util.Map.class,
435                            java.util.Map.class, java.lang.String.class,
436                            com.liferay.portal.service.ServiceContext.class
437                    };
438    }