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