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.LocalizationUtil;
020    
021    import com.liferay.portlet.asset.service.AssetCategoryServiceUtil;
022    
023    import java.rmi.RemoteException;
024    
025    import java.util.Locale;
026    import java.util.Map;
027    
028    /**
029     * Provides the SOAP utility for the
030     * {@link com.liferay.portlet.asset.service.AssetCategoryServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it is difficult for SOAP to
033     * support certain types.
034     *
035     * <p>
036     * ServiceBuilder follows certain rules in translating the methods. For example,
037     * if the method in the service utility returns a {@link java.util.List}, that
038     * is translated to an array of {@link com.liferay.portlet.asset.model.AssetCategorySoap}.
039     * If the method in the service utility returns a
040     * {@link com.liferay.portlet.asset.model.AssetCategory}, that is translated to a
041     * {@link com.liferay.portlet.asset.model.AssetCategorySoap}. Methods that SOAP cannot
042     * safely wire are skipped.
043     * </p>
044     *
045     * <p>
046     * The benefits of using the SOAP utility is that it is cross platform
047     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
048     * even Perl, to call the generated services. One drawback of SOAP is that it is
049     * slow because it needs to serialize all calls into a text format (XML).
050     * </p>
051     *
052     * <p>
053     * You can see a list of services at http://localhost:8080/api/axis. Set the
054     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
055     * security.
056     * </p>
057     *
058     * <p>
059     * The SOAP utility is only generated for remote services.
060     * </p>
061     *
062     * @author Brian Wing Shun Chan
063     * @see AssetCategoryServiceHttp
064     * @see com.liferay.portlet.asset.model.AssetCategorySoap
065     * @see com.liferay.portlet.asset.service.AssetCategoryServiceUtil
066     * @generated
067     */
068    public class AssetCategoryServiceSoap {
069            public static com.liferay.portlet.asset.model.AssetCategorySoap addCategory(
070                    long parentCategoryId, java.lang.String[] titleMapLanguageIds,
071                    java.lang.String[] titleMapValues,
072                    java.lang.String[] descriptionMapLanguageIds,
073                    java.lang.String[] descriptionMapValues, long vocabularyId,
074                    java.lang.String[] categoryProperties,
075                    com.liferay.portal.service.ServiceContext serviceContext)
076                    throws RemoteException {
077                    try {
078                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
079                                            titleMapValues);
080                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
081                                            descriptionMapValues);
082    
083                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.addCategory(parentCategoryId,
084                                            titleMap, descriptionMap, vocabularyId, categoryProperties,
085                                            serviceContext);
086    
087                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
088                    }
089                    catch (Exception e) {
090                            _log.error(e, e);
091    
092                            throw new RemoteException(e.getMessage());
093                    }
094            }
095    
096            public static com.liferay.portlet.asset.model.AssetCategorySoap addCategory(
097                    java.lang.String title, long vocabularyId,
098                    com.liferay.portal.service.ServiceContext serviceContext)
099                    throws RemoteException {
100                    try {
101                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.addCategory(title,
102                                            vocabularyId, serviceContext);
103    
104                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
105                    }
106                    catch (Exception e) {
107                            _log.error(e, e);
108    
109                            throw new RemoteException(e.getMessage());
110                    }
111            }
112    
113            /**
114            * @deprecated As of 6.2.0, Replaced by {@link #deleteCategories(long[],
115            ServiceContext)}
116            */
117            public static void deleteCategories(long[] categoryIds)
118                    throws RemoteException {
119                    try {
120                            AssetCategoryServiceUtil.deleteCategories(categoryIds);
121                    }
122                    catch (Exception e) {
123                            _log.error(e, e);
124    
125                            throw new RemoteException(e.getMessage());
126                    }
127            }
128    
129            public static com.liferay.portlet.asset.model.AssetCategorySoap[] deleteCategories(
130                    long[] categoryIds,
131                    com.liferay.portal.service.ServiceContext serviceContext)
132                    throws RemoteException {
133                    try {
134                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
135                                    AssetCategoryServiceUtil.deleteCategories(categoryIds,
136                                            serviceContext);
137    
138                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
139                    }
140                    catch (Exception e) {
141                            _log.error(e, e);
142    
143                            throw new RemoteException(e.getMessage());
144                    }
145            }
146    
147            public static void deleteCategory(long categoryId)
148                    throws RemoteException {
149                    try {
150                            AssetCategoryServiceUtil.deleteCategory(categoryId);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getCategories(
160                    java.lang.String className, long classPK) throws RemoteException {
161                    try {
162                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
163                                    AssetCategoryServiceUtil.getCategories(className, classPK);
164    
165                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
166                    }
167                    catch (Exception e) {
168                            _log.error(e, e);
169    
170                            throw new RemoteException(e.getMessage());
171                    }
172            }
173    
174            public static com.liferay.portlet.asset.model.AssetCategorySoap getCategory(
175                    long categoryId) throws RemoteException {
176                    try {
177                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.getCategory(categoryId);
178    
179                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
180                    }
181                    catch (Exception e) {
182                            _log.error(e, e);
183    
184                            throw new RemoteException(e.getMessage());
185                    }
186            }
187    
188            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getChildCategories(
189                    long parentCategoryId) throws RemoteException {
190                    try {
191                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
192                                    AssetCategoryServiceUtil.getChildCategories(parentCategoryId);
193    
194                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
195                    }
196                    catch (Exception e) {
197                            _log.error(e, e);
198    
199                            throw new RemoteException(e.getMessage());
200                    }
201            }
202    
203            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getChildCategories(
204                    long parentCategoryId, int start, int end,
205                    com.liferay.portal.kernel.util.OrderByComparator obc)
206                    throws RemoteException {
207                    try {
208                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
209                                    AssetCategoryServiceUtil.getChildCategories(parentCategoryId,
210                                            start, end, obc);
211    
212                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
213                    }
214                    catch (Exception e) {
215                            _log.error(e, e);
216    
217                            throw new RemoteException(e.getMessage());
218                    }
219            }
220    
221            /**
222            * @deprecated As of 6.2.0, replaced by {@link #search(long[], String,
223            long[], int, int)}
224            */
225            public static java.lang.String getJSONSearch(long groupId,
226                    java.lang.String name, long[] vocabularyIds, int start, int end)
227                    throws RemoteException {
228                    try {
229                            com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.getJSONSearch(groupId,
230                                            name, vocabularyIds, start, end);
231    
232                            return returnValue.toString();
233                    }
234                    catch (Exception e) {
235                            _log.error(e, e);
236    
237                            throw new RemoteException(e.getMessage());
238                    }
239            }
240    
241            /**
242            * @deprecated As of 6.2.0, replaced by {@link
243            #getVocabularyCategoriesDisplay(long, int, int,
244            OrderByComparator)}
245            */
246            public static java.lang.String getJSONVocabularyCategories(
247                    long vocabularyId, int start, int end,
248                    com.liferay.portal.kernel.util.OrderByComparator obc)
249                    throws RemoteException {
250                    try {
251                            com.liferay.portal.kernel.json.JSONObject returnValue = AssetCategoryServiceUtil.getJSONVocabularyCategories(vocabularyId,
252                                            start, end, obc);
253    
254                            return returnValue.toString();
255                    }
256                    catch (Exception e) {
257                            _log.error(e, e);
258    
259                            throw new RemoteException(e.getMessage());
260                    }
261            }
262    
263            /**
264            * @deprecated As of 6.2.0, replaced by {@link
265            #getVocabularyCategoriesDisplay(long, String, long, int, int,
266            OrderByComparator)}
267            */
268            public static java.lang.String getJSONVocabularyCategories(long groupId,
269                    java.lang.String name, long vocabularyId, int start, int end,
270                    com.liferay.portal.kernel.util.OrderByComparator obc)
271                    throws RemoteException {
272                    try {
273                            com.liferay.portal.kernel.json.JSONObject returnValue = AssetCategoryServiceUtil.getJSONVocabularyCategories(groupId,
274                                            name, vocabularyId, start, end, obc);
275    
276                            return returnValue.toString();
277                    }
278                    catch (Exception e) {
279                            _log.error(e, e);
280    
281                            throw new RemoteException(e.getMessage());
282                    }
283            }
284    
285            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
286                    long vocabularyId, int start, int end,
287                    com.liferay.portal.kernel.util.OrderByComparator obc)
288                    throws RemoteException {
289                    try {
290                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
291                                    AssetCategoryServiceUtil.getVocabularyCategories(vocabularyId,
292                                            start, end, obc);
293    
294                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
295                    }
296                    catch (Exception e) {
297                            _log.error(e, e);
298    
299                            throw new RemoteException(e.getMessage());
300                    }
301            }
302    
303            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
304                    long parentCategoryId, long vocabularyId, int start, int end,
305                    com.liferay.portal.kernel.util.OrderByComparator obc)
306                    throws RemoteException {
307                    try {
308                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
309                                    AssetCategoryServiceUtil.getVocabularyCategories(parentCategoryId,
310                                            vocabularyId, start, end, obc);
311    
312                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
313                    }
314                    catch (Exception e) {
315                            _log.error(e, e);
316    
317                            throw new RemoteException(e.getMessage());
318                    }
319            }
320    
321            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
322                    long groupId, java.lang.String name, long vocabularyId, int start,
323                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
324                    throws RemoteException {
325                    try {
326                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
327                                    AssetCategoryServiceUtil.getVocabularyCategories(groupId, name,
328                                            vocabularyId, start, end, obc);
329    
330                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
331                    }
332                    catch (Exception e) {
333                            _log.error(e, e);
334    
335                            throw new RemoteException(e.getMessage());
336                    }
337            }
338    
339            public static int getVocabularyCategoriesCount(long groupId,
340                    long vocabularyId) throws RemoteException {
341                    try {
342                            int returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesCount(groupId,
343                                            vocabularyId);
344    
345                            return returnValue;
346                    }
347                    catch (Exception e) {
348                            _log.error(e, e);
349    
350                            throw new RemoteException(e.getMessage());
351                    }
352            }
353    
354            public static int getVocabularyCategoriesCount(long groupId,
355                    java.lang.String name, long vocabularyId) throws RemoteException {
356                    try {
357                            int returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesCount(groupId,
358                                            name, vocabularyId);
359    
360                            return returnValue;
361                    }
362                    catch (Exception e) {
363                            _log.error(e, e);
364    
365                            throw new RemoteException(e.getMessage());
366                    }
367            }
368    
369            public static com.liferay.portlet.asset.model.AssetCategoryDisplay getVocabularyCategoriesDisplay(
370                    long vocabularyId, int start, int end,
371                    com.liferay.portal.kernel.util.OrderByComparator obc)
372                    throws RemoteException {
373                    try {
374                            com.liferay.portlet.asset.model.AssetCategoryDisplay returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesDisplay(vocabularyId,
375                                            start, end, obc);
376    
377                            return returnValue;
378                    }
379                    catch (Exception e) {
380                            _log.error(e, e);
381    
382                            throw new RemoteException(e.getMessage());
383                    }
384            }
385    
386            public static com.liferay.portlet.asset.model.AssetCategoryDisplay getVocabularyCategoriesDisplay(
387                    long groupId, java.lang.String name, long vocabularyId, int start,
388                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
389                    throws RemoteException {
390                    try {
391                            com.liferay.portlet.asset.model.AssetCategoryDisplay returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesDisplay(groupId,
392                                            name, vocabularyId, start, end, obc);
393    
394                            return returnValue;
395                    }
396                    catch (Exception e) {
397                            _log.error(e, e);
398    
399                            throw new RemoteException(e.getMessage());
400                    }
401            }
402    
403            /**
404            * @deprecated As of 6.2.0, replaced by {@link
405            #getVocabularyRootCategories(long, long, int, int,
406            OrderByComparator)}
407            */
408            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyRootCategories(
409                    long vocabularyId, int start, int end,
410                    com.liferay.portal.kernel.util.OrderByComparator obc)
411                    throws RemoteException {
412                    try {
413                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
414                                    AssetCategoryServiceUtil.getVocabularyRootCategories(vocabularyId,
415                                            start, end, obc);
416    
417                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
418                    }
419                    catch (Exception e) {
420                            _log.error(e, e);
421    
422                            throw new RemoteException(e.getMessage());
423                    }
424            }
425    
426            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyRootCategories(
427                    long groupId, long vocabularyId, int start, int end,
428                    com.liferay.portal.kernel.util.OrderByComparator obc)
429                    throws RemoteException {
430                    try {
431                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
432                                    AssetCategoryServiceUtil.getVocabularyRootCategories(groupId,
433                                            vocabularyId, start, end, obc);
434    
435                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
436                    }
437                    catch (Exception e) {
438                            _log.error(e, e);
439    
440                            throw new RemoteException(e.getMessage());
441                    }
442            }
443    
444            public static int getVocabularyRootCategoriesCount(long groupId,
445                    long vocabularyId) throws RemoteException {
446                    try {
447                            int returnValue = AssetCategoryServiceUtil.getVocabularyRootCategoriesCount(groupId,
448                                            vocabularyId);
449    
450                            return returnValue;
451                    }
452                    catch (Exception e) {
453                            _log.error(e, e);
454    
455                            throw new RemoteException(e.getMessage());
456                    }
457            }
458    
459            public static com.liferay.portlet.asset.model.AssetCategorySoap moveCategory(
460                    long categoryId, long parentCategoryId, long vocabularyId,
461                    com.liferay.portal.service.ServiceContext serviceContext)
462                    throws RemoteException {
463                    try {
464                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.moveCategory(categoryId,
465                                            parentCategoryId, vocabularyId, serviceContext);
466    
467                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
468                    }
469                    catch (Exception e) {
470                            _log.error(e, e);
471    
472                            throw new RemoteException(e.getMessage());
473                    }
474            }
475    
476            public static com.liferay.portlet.asset.model.AssetCategorySoap[] search(
477                    long groupId, java.lang.String keywords, long vocabularyId, int start,
478                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
479                    throws RemoteException {
480                    try {
481                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
482                                    AssetCategoryServiceUtil.search(groupId, keywords,
483                                            vocabularyId, start, end, obc);
484    
485                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
486                    }
487                    catch (Exception e) {
488                            _log.error(e, e);
489    
490                            throw new RemoteException(e.getMessage());
491                    }
492            }
493    
494            public static java.lang.String search(long groupId, java.lang.String name,
495                    java.lang.String[] categoryProperties, int start, int end)
496                    throws RemoteException {
497                    try {
498                            com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.search(groupId,
499                                            name, categoryProperties, start, end);
500    
501                            return returnValue.toString();
502                    }
503                    catch (Exception e) {
504                            _log.error(e, e);
505    
506                            throw new RemoteException(e.getMessage());
507                    }
508            }
509    
510            public static java.lang.String search(long[] groupIds,
511                    java.lang.String name, long[] vocabularyIds, int start, int end)
512                    throws RemoteException {
513                    try {
514                            com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.search(groupIds,
515                                            name, vocabularyIds, start, end);
516    
517                            return returnValue.toString();
518                    }
519                    catch (Exception e) {
520                            _log.error(e, e);
521    
522                            throw new RemoteException(e.getMessage());
523                    }
524            }
525    
526            public static com.liferay.portlet.asset.model.AssetCategorySoap updateCategory(
527                    long categoryId, long parentCategoryId,
528                    java.lang.String[] titleMapLanguageIds,
529                    java.lang.String[] titleMapValues,
530                    java.lang.String[] descriptionMapLanguageIds,
531                    java.lang.String[] descriptionMapValues, long vocabularyId,
532                    java.lang.String[] categoryProperties,
533                    com.liferay.portal.service.ServiceContext serviceContext)
534                    throws RemoteException {
535                    try {
536                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
537                                            titleMapValues);
538                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
539                                            descriptionMapValues);
540    
541                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.updateCategory(categoryId,
542                                            parentCategoryId, titleMap, descriptionMap, vocabularyId,
543                                            categoryProperties, serviceContext);
544    
545                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
546                    }
547                    catch (Exception e) {
548                            _log.error(e, e);
549    
550                            throw new RemoteException(e.getMessage());
551                    }
552            }
553    
554            private static Log _log = LogFactoryUtil.getLog(AssetCategoryServiceSoap.class);
555    }