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
056     * http://localhost:8080/api/secure/axis. Set the property
057     * <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
058     * security.
059     * </p>
060     *
061     * <p>
062     * The SOAP utility is only generated for remote services.
063     * </p>
064     *
065     * @author    Brian Wing Shun Chan
066     * @see       AssetCategoryServiceHttp
067     * @see       com.liferay.portlet.asset.model.AssetCategorySoap
068     * @see       com.liferay.portlet.asset.service.AssetCategoryServiceUtil
069     * @generated
070     */
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 void deleteCategories(long[] categoryIds)
100                    throws RemoteException {
101                    try {
102                            AssetCategoryServiceUtil.deleteCategories(categoryIds);
103                    }
104                    catch (Exception e) {
105                            _log.error(e, e);
106    
107                            throw new RemoteException(e.getMessage());
108                    }
109            }
110    
111            public static void deleteCategory(long categoryId)
112                    throws RemoteException {
113                    try {
114                            AssetCategoryServiceUtil.deleteCategory(categoryId);
115                    }
116                    catch (Exception e) {
117                            _log.error(e, e);
118    
119                            throw new RemoteException(e.getMessage());
120                    }
121            }
122    
123            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getCategories(
124                    java.lang.String className, long classPK) throws RemoteException {
125                    try {
126                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
127                                    AssetCategoryServiceUtil.getCategories(className, classPK);
128    
129                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
130                    }
131                    catch (Exception e) {
132                            _log.error(e, e);
133    
134                            throw new RemoteException(e.getMessage());
135                    }
136            }
137    
138            public static com.liferay.portlet.asset.model.AssetCategorySoap getCategory(
139                    long categoryId) throws RemoteException {
140                    try {
141                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.getCategory(categoryId);
142    
143                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
144                    }
145                    catch (Exception e) {
146                            _log.error(e, e);
147    
148                            throw new RemoteException(e.getMessage());
149                    }
150            }
151    
152            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getChildCategories(
153                    long parentCategoryId) throws RemoteException {
154                    try {
155                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
156                                    AssetCategoryServiceUtil.getChildCategories(parentCategoryId);
157    
158                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
159                    }
160                    catch (Exception e) {
161                            _log.error(e, e);
162    
163                            throw new RemoteException(e.getMessage());
164                    }
165            }
166    
167            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getChildCategories(
168                    long parentCategoryId, int start, int end,
169                    com.liferay.portal.kernel.util.OrderByComparator obc)
170                    throws RemoteException {
171                    try {
172                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
173                                    AssetCategoryServiceUtil.getChildCategories(parentCategoryId,
174                                            start, end, obc);
175    
176                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
177                    }
178                    catch (Exception e) {
179                            _log.error(e, e);
180    
181                            throw new RemoteException(e.getMessage());
182                    }
183            }
184    
185            public static java.lang.String getJSONSearch(long groupId,
186                    java.lang.String keywords, long vocabularyId, int start, int end,
187                    com.liferay.portal.kernel.util.OrderByComparator obc)
188                    throws RemoteException {
189                    try {
190                            com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.getJSONSearch(groupId,
191                                            keywords, vocabularyId, start, end, obc);
192    
193                            return returnValue.toString();
194                    }
195                    catch (Exception e) {
196                            _log.error(e, e);
197    
198                            throw new RemoteException(e.getMessage());
199                    }
200            }
201    
202            public static java.lang.String getJSONVocabularyCategories(long groupId,
203                    java.lang.String name, long vocabularyId, int start, int end,
204                    com.liferay.portal.kernel.util.OrderByComparator obc)
205                    throws RemoteException {
206                    try {
207                            com.liferay.portal.kernel.json.JSONObject returnValue = AssetCategoryServiceUtil.getJSONVocabularyCategories(groupId,
208                                            name, vocabularyId, start, end, obc);
209    
210                            return returnValue.toString();
211                    }
212                    catch (Exception e) {
213                            _log.error(e, e);
214    
215                            throw new RemoteException(e.getMessage());
216                    }
217            }
218    
219            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
220                    long vocabularyId, int start, int end,
221                    com.liferay.portal.kernel.util.OrderByComparator obc)
222                    throws RemoteException {
223                    try {
224                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
225                                    AssetCategoryServiceUtil.getVocabularyCategories(vocabularyId,
226                                            start, end, obc);
227    
228                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
229                    }
230                    catch (Exception e) {
231                            _log.error(e, e);
232    
233                            throw new RemoteException(e.getMessage());
234                    }
235            }
236    
237            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
238                    long parentCategoryId, long vocabularyId, int start, int end,
239                    com.liferay.portal.kernel.util.OrderByComparator obc)
240                    throws RemoteException {
241                    try {
242                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
243                                    AssetCategoryServiceUtil.getVocabularyCategories(parentCategoryId,
244                                            vocabularyId, start, end, obc);
245    
246                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
247                    }
248                    catch (Exception e) {
249                            _log.error(e, e);
250    
251                            throw new RemoteException(e.getMessage());
252                    }
253            }
254    
255            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
256                    long groupId, java.lang.String name, long vocabularyId, int start,
257                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
258                    throws RemoteException {
259                    try {
260                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
261                                    AssetCategoryServiceUtil.getVocabularyCategories(groupId, name,
262                                            vocabularyId, start, end, obc);
263    
264                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
265                    }
266                    catch (Exception e) {
267                            _log.error(e, e);
268    
269                            throw new RemoteException(e.getMessage());
270                    }
271            }
272    
273            public static int getVocabularyCategoriesCount(long groupId,
274                    long vocabularyId) throws RemoteException {
275                    try {
276                            int returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesCount(groupId,
277                                            vocabularyId);
278    
279                            return returnValue;
280                    }
281                    catch (Exception e) {
282                            _log.error(e, e);
283    
284                            throw new RemoteException(e.getMessage());
285                    }
286            }
287    
288            public static int getVocabularyCategoriesCount(long groupId,
289                    java.lang.String name, long vocabularyId) throws RemoteException {
290                    try {
291                            int returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesCount(groupId,
292                                            name, vocabularyId);
293    
294                            return 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[] getVocabularyRootCategories(
304                    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.getVocabularyRootCategories(vocabularyId,
310                                            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 moveCategory(
322                    long categoryId, long parentCategoryId, long vocabularyId,
323                    com.liferay.portal.service.ServiceContext serviceContext)
324                    throws RemoteException {
325                    try {
326                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.moveCategory(categoryId,
327                                            parentCategoryId, vocabularyId, serviceContext);
328    
329                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(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[] search(
339                    long groupId, java.lang.String keywords, long vocabularyId, int start,
340                    int end, 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.search(groupId, keywords,
345                                            vocabularyId, 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 java.lang.String search(long groupId, java.lang.String name,
357                    java.lang.String[] categoryProperties, int start, int end)
358                    throws RemoteException {
359                    try {
360                            com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.search(groupId,
361                                            name, categoryProperties, start, end);
362    
363                            return returnValue.toString();
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.AssetCategorySoap updateCategory(
373                    long categoryId, long parentCategoryId,
374                    java.lang.String[] titleMapLanguageIds,
375                    java.lang.String[] titleMapValues,
376                    java.lang.String[] descriptionMapLanguageIds,
377                    java.lang.String[] descriptionMapValues, long vocabularyId,
378                    java.lang.String[] categoryProperties,
379                    com.liferay.portal.service.ServiceContext serviceContext)
380                    throws RemoteException {
381                    try {
382                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
383                                            titleMapValues);
384                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
385                                            descriptionMapValues);
386    
387                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.updateCategory(categoryId,
388                                            parentCategoryId, titleMap, descriptionMap, vocabularyId,
389                                            categoryProperties, serviceContext);
390    
391                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
392                    }
393                    catch (Exception e) {
394                            _log.error(e, e);
395    
396                            throw new RemoteException(e.getMessage());
397                    }
398            }
399    
400            private static Log _log = LogFactoryUtil.getLog(AssetCategoryServiceSoap.class);
401    }