001    /**
002     * Copyright (c) 2000-2012 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     * <p>
030     * This class provides a SOAP utility for the
031     * {@link com.liferay.portlet.asset.service.AssetCategoryServiceUtil} service utility. The
032     * static methods of this class calls the same methods of the service utility.
033     * However, the signatures are different because it is difficult for SOAP to
034     * support certain types.
035     * </p>
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    public class AssetCategoryServiceSoap {
071            public static com.liferay.portlet.asset.model.AssetCategorySoap addCategory(
072                    long parentCategoryId, java.lang.String[] titleMapLanguageIds,
073                    java.lang.String[] titleMapValues,
074                    java.lang.String[] descriptionMapLanguageIds,
075                    java.lang.String[] descriptionMapValues, long vocabularyId,
076                    java.lang.String[] categoryProperties,
077                    com.liferay.portal.service.ServiceContext serviceContext)
078                    throws RemoteException {
079                    try {
080                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
081                                            titleMapValues);
082                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
083                                            descriptionMapValues);
084    
085                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.addCategory(parentCategoryId,
086                                            titleMap, descriptionMap, vocabularyId, categoryProperties,
087                                            serviceContext);
088    
089                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
090                    }
091                    catch (Exception e) {
092                            _log.error(e, e);
093    
094                            throw new RemoteException(e.getMessage());
095                    }
096            }
097    
098            public static com.liferay.portlet.asset.model.AssetCategorySoap addCategory(
099                    java.lang.String title, long vocabularyId,
100                    com.liferay.portal.service.ServiceContext serviceContext)
101                    throws RemoteException {
102                    try {
103                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.addCategory(title,
104                                            vocabularyId, serviceContext);
105    
106                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
107                    }
108                    catch (Exception e) {
109                            _log.error(e, e);
110    
111                            throw new RemoteException(e.getMessage());
112                    }
113            }
114    
115            public static void deleteCategories(long[] categoryIds)
116                    throws RemoteException {
117                    try {
118                            AssetCategoryServiceUtil.deleteCategories(categoryIds);
119                    }
120                    catch (Exception e) {
121                            _log.error(e, e);
122    
123                            throw new RemoteException(e.getMessage());
124                    }
125            }
126    
127            public static void deleteCategory(long categoryId)
128                    throws RemoteException {
129                    try {
130                            AssetCategoryServiceUtil.deleteCategory(categoryId);
131                    }
132                    catch (Exception e) {
133                            _log.error(e, e);
134    
135                            throw new RemoteException(e.getMessage());
136                    }
137            }
138    
139            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getCategories(
140                    java.lang.String className, long classPK) throws RemoteException {
141                    try {
142                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
143                                    AssetCategoryServiceUtil.getCategories(className, classPK);
144    
145                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
146                    }
147                    catch (Exception e) {
148                            _log.error(e, e);
149    
150                            throw new RemoteException(e.getMessage());
151                    }
152            }
153    
154            public static com.liferay.portlet.asset.model.AssetCategorySoap getCategory(
155                    long categoryId) throws RemoteException {
156                    try {
157                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.getCategory(categoryId);
158    
159                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
160                    }
161                    catch (Exception e) {
162                            _log.error(e, e);
163    
164                            throw new RemoteException(e.getMessage());
165                    }
166            }
167    
168            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getChildCategories(
169                    long parentCategoryId) throws RemoteException {
170                    try {
171                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
172                                    AssetCategoryServiceUtil.getChildCategories(parentCategoryId);
173    
174                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
175                    }
176                    catch (Exception e) {
177                            _log.error(e, e);
178    
179                            throw new RemoteException(e.getMessage());
180                    }
181            }
182    
183            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getChildCategories(
184                    long parentCategoryId, int start, int end,
185                    com.liferay.portal.kernel.util.OrderByComparator obc)
186                    throws RemoteException {
187                    try {
188                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
189                                    AssetCategoryServiceUtil.getChildCategories(parentCategoryId,
190                                            start, end, obc);
191    
192                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
193                    }
194                    catch (Exception e) {
195                            _log.error(e, e);
196    
197                            throw new RemoteException(e.getMessage());
198                    }
199            }
200    
201            /**
202            * @deprecated {@link #search(long[], String, long[], int, int)}
203            */
204            public static java.lang.String getJSONSearch(long groupId,
205                    java.lang.String name, long[] vocabularyIds, int start, int end)
206                    throws RemoteException {
207                    try {
208                            com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.getJSONSearch(groupId,
209                                            name, vocabularyIds, start, end);
210    
211                            return returnValue.toString();
212                    }
213                    catch (Exception e) {
214                            _log.error(e, e);
215    
216                            throw new RemoteException(e.getMessage());
217                    }
218            }
219    
220            public static java.lang.String getJSONVocabularyCategories(
221                    long vocabularyId, int start, int end,
222                    com.liferay.portal.kernel.util.OrderByComparator obc)
223                    throws RemoteException {
224                    try {
225                            com.liferay.portal.kernel.json.JSONObject returnValue = AssetCategoryServiceUtil.getJSONVocabularyCategories(vocabularyId,
226                                            start, end, obc);
227    
228                            return returnValue.toString();
229                    }
230                    catch (Exception e) {
231                            _log.error(e, e);
232    
233                            throw new RemoteException(e.getMessage());
234                    }
235            }
236    
237            public static java.lang.String getJSONVocabularyCategories(long groupId,
238                    java.lang.String name, long vocabularyId, int start, int end,
239                    com.liferay.portal.kernel.util.OrderByComparator obc)
240                    throws RemoteException {
241                    try {
242                            com.liferay.portal.kernel.json.JSONObject returnValue = AssetCategoryServiceUtil.getJSONVocabularyCategories(groupId,
243                                            name, vocabularyId, start, end, obc);
244    
245                            return returnValue.toString();
246                    }
247                    catch (Exception e) {
248                            _log.error(e, e);
249    
250                            throw new RemoteException(e.getMessage());
251                    }
252            }
253    
254            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
255                    long vocabularyId, int start, int end,
256                    com.liferay.portal.kernel.util.OrderByComparator obc)
257                    throws RemoteException {
258                    try {
259                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
260                                    AssetCategoryServiceUtil.getVocabularyCategories(vocabularyId,
261                                            start, end, obc);
262    
263                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
264                    }
265                    catch (Exception e) {
266                            _log.error(e, e);
267    
268                            throw new RemoteException(e.getMessage());
269                    }
270            }
271    
272            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
273                    long parentCategoryId, long vocabularyId, int start, int end,
274                    com.liferay.portal.kernel.util.OrderByComparator obc)
275                    throws RemoteException {
276                    try {
277                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
278                                    AssetCategoryServiceUtil.getVocabularyCategories(parentCategoryId,
279                                            vocabularyId, start, end, obc);
280    
281                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
282                    }
283                    catch (Exception e) {
284                            _log.error(e, e);
285    
286                            throw new RemoteException(e.getMessage());
287                    }
288            }
289    
290            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
291                    long groupId, java.lang.String name, long vocabularyId, int start,
292                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
293                    throws RemoteException {
294                    try {
295                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
296                                    AssetCategoryServiceUtil.getVocabularyCategories(groupId, name,
297                                            vocabularyId, start, end, obc);
298    
299                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
300                    }
301                    catch (Exception e) {
302                            _log.error(e, e);
303    
304                            throw new RemoteException(e.getMessage());
305                    }
306            }
307    
308            public static int getVocabularyCategoriesCount(long groupId,
309                    long vocabularyId) throws RemoteException {
310                    try {
311                            int returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesCount(groupId,
312                                            vocabularyId);
313    
314                            return returnValue;
315                    }
316                    catch (Exception e) {
317                            _log.error(e, e);
318    
319                            throw new RemoteException(e.getMessage());
320                    }
321            }
322    
323            public static int getVocabularyCategoriesCount(long groupId,
324                    java.lang.String name, long vocabularyId) throws RemoteException {
325                    try {
326                            int returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesCount(groupId,
327                                            name, vocabularyId);
328    
329                            return returnValue;
330                    }
331                    catch (Exception e) {
332                            _log.error(e, e);
333    
334                            throw new RemoteException(e.getMessage());
335                    }
336            }
337    
338            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyRootCategories(
339                    long vocabularyId, int start, int end,
340                    com.liferay.portal.kernel.util.OrderByComparator obc)
341                    throws RemoteException {
342                    try {
343                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
344                                    AssetCategoryServiceUtil.getVocabularyRootCategories(vocabularyId,
345                                            start, end, obc);
346    
347                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
348                    }
349                    catch (Exception e) {
350                            _log.error(e, e);
351    
352                            throw new RemoteException(e.getMessage());
353                    }
354            }
355    
356            public static com.liferay.portlet.asset.model.AssetCategorySoap moveCategory(
357                    long categoryId, long parentCategoryId, long vocabularyId,
358                    com.liferay.portal.service.ServiceContext serviceContext)
359                    throws RemoteException {
360                    try {
361                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.moveCategory(categoryId,
362                                            parentCategoryId, vocabularyId, serviceContext);
363    
364                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
365                    }
366                    catch (Exception e) {
367                            _log.error(e, e);
368    
369                            throw new RemoteException(e.getMessage());
370                    }
371            }
372    
373            public static com.liferay.portlet.asset.model.AssetCategorySoap[] search(
374                    long groupId, java.lang.String keywords, long vocabularyId, int start,
375                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
376                    throws RemoteException {
377                    try {
378                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
379                                    AssetCategoryServiceUtil.search(groupId, keywords,
380                                            vocabularyId, start, end, obc);
381    
382                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
383                    }
384                    catch (Exception e) {
385                            _log.error(e, e);
386    
387                            throw new RemoteException(e.getMessage());
388                    }
389            }
390    
391            public static java.lang.String search(long groupId, java.lang.String name,
392                    java.lang.String[] categoryProperties, int start, int end)
393                    throws RemoteException {
394                    try {
395                            com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.search(groupId,
396                                            name, categoryProperties, start, end);
397    
398                            return returnValue.toString();
399                    }
400                    catch (Exception e) {
401                            _log.error(e, e);
402    
403                            throw new RemoteException(e.getMessage());
404                    }
405            }
406    
407            public static java.lang.String search(long[] groupIds,
408                    java.lang.String name, long[] vocabularyIds, int start, int end)
409                    throws RemoteException {
410                    try {
411                            com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.search(groupIds,
412                                            name, vocabularyIds, start, end);
413    
414                            return returnValue.toString();
415                    }
416                    catch (Exception e) {
417                            _log.error(e, e);
418    
419                            throw new RemoteException(e.getMessage());
420                    }
421            }
422    
423            public static com.liferay.portlet.asset.model.AssetCategorySoap updateCategory(
424                    long categoryId, long parentCategoryId,
425                    java.lang.String[] titleMapLanguageIds,
426                    java.lang.String[] titleMapValues,
427                    java.lang.String[] descriptionMapLanguageIds,
428                    java.lang.String[] descriptionMapValues, long vocabularyId,
429                    java.lang.String[] categoryProperties,
430                    com.liferay.portal.service.ServiceContext serviceContext)
431                    throws RemoteException {
432                    try {
433                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
434                                            titleMapValues);
435                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
436                                            descriptionMapValues);
437    
438                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.updateCategory(categoryId,
439                                            parentCategoryId, titleMap, descriptionMap, vocabularyId,
440                                            categoryProperties, serviceContext);
441    
442                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
443                    }
444                    catch (Exception e) {
445                            _log.error(e, e);
446    
447                            throw new RemoteException(e.getMessage());
448                    }
449            }
450    
451            private static Log _log = LogFactoryUtil.getLog(AssetCategoryServiceSoap.class);
452    }