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    
020    import com.liferay.portlet.asset.service.AssetCategoryServiceUtil;
021    
022    import java.rmi.RemoteException;
023    
024    /**
025     * <p>
026     * This class provides a SOAP utility for the
027     * {@link com.liferay.portlet.asset.service.AssetCategoryServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it is difficult for SOAP to
030     * support certain types.
031     * </p>
032     *
033     * <p>
034     * ServiceBuilder follows certain rules in translating the methods. For example,
035     * if the method in the service utility returns a {@link java.util.List}, that
036     * is translated to an array of {@link com.liferay.portlet.asset.model.AssetCategorySoap}.
037     * If the method in the service utility returns a
038     * {@link com.liferay.portlet.asset.model.AssetCategory}, that is translated to a
039     * {@link com.liferay.portlet.asset.model.AssetCategorySoap}. Methods that SOAP cannot
040     * safely wire are skipped.
041     * </p>
042     *
043     * <p>
044     * The benefits of using the SOAP utility is that it is cross platform
045     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
046     * even Perl, to call the generated services. One drawback of SOAP is that it is
047     * slow because it needs to serialize all calls into a text format (XML).
048     * </p>
049     *
050     * <p>
051     * You can see a list of services at
052     * http://localhost:8080/api/secure/axis. Set the property
053     * <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
054     * security.
055     * </p>
056     *
057     * <p>
058     * The SOAP utility is only generated for remote services.
059     * </p>
060     *
061     * @author    Brian Wing Shun Chan
062     * @see       AssetCategoryServiceHttp
063     * @see       com.liferay.portlet.asset.model.AssetCategorySoap
064     * @see       com.liferay.portlet.asset.service.AssetCategoryServiceUtil
065     * @generated
066     */
067    public class AssetCategoryServiceSoap {
068            public static void deleteCategories(long[] categoryIds)
069                    throws RemoteException {
070                    try {
071                            AssetCategoryServiceUtil.deleteCategories(categoryIds);
072                    }
073                    catch (Exception e) {
074                            _log.error(e, e);
075    
076                            throw new RemoteException(e.getMessage());
077                    }
078            }
079    
080            public static void deleteCategory(long categoryId)
081                    throws RemoteException {
082                    try {
083                            AssetCategoryServiceUtil.deleteCategory(categoryId);
084                    }
085                    catch (Exception e) {
086                            _log.error(e, e);
087    
088                            throw new RemoteException(e.getMessage());
089                    }
090            }
091    
092            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getCategories(
093                    java.lang.String className, long classPK) throws RemoteException {
094                    try {
095                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
096                                    AssetCategoryServiceUtil.getCategories(className, classPK);
097    
098                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
099                    }
100                    catch (Exception e) {
101                            _log.error(e, e);
102    
103                            throw new RemoteException(e.getMessage());
104                    }
105            }
106    
107            public static com.liferay.portlet.asset.model.AssetCategorySoap getCategory(
108                    long categoryId) throws RemoteException {
109                    try {
110                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.getCategory(categoryId);
111    
112                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
113                    }
114                    catch (Exception e) {
115                            _log.error(e, e);
116    
117                            throw new RemoteException(e.getMessage());
118                    }
119            }
120    
121            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getChildCategories(
122                    long parentCategoryId) throws RemoteException {
123                    try {
124                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
125                                    AssetCategoryServiceUtil.getChildCategories(parentCategoryId);
126    
127                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
128                    }
129                    catch (Exception e) {
130                            _log.error(e, e);
131    
132                            throw new RemoteException(e.getMessage());
133                    }
134            }
135    
136            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getChildCategories(
137                    long parentCategoryId, int start, int end,
138                    com.liferay.portal.kernel.util.OrderByComparator obc)
139                    throws RemoteException {
140                    try {
141                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
142                                    AssetCategoryServiceUtil.getChildCategories(parentCategoryId,
143                                            start, end, obc);
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 java.lang.String getJSONVocabularyCategories(long groupId,
155                    java.lang.String name, long vocabularyId, int start, int end,
156                    com.liferay.portal.kernel.util.OrderByComparator obc)
157                    throws RemoteException {
158                    try {
159                            com.liferay.portal.kernel.json.JSONObject returnValue = AssetCategoryServiceUtil.getJSONVocabularyCategories(groupId,
160                                            name, vocabularyId, start, end, obc);
161    
162                            return returnValue.toString();
163                    }
164                    catch (Exception e) {
165                            _log.error(e, e);
166    
167                            throw new RemoteException(e.getMessage());
168                    }
169            }
170    
171            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
172                    long vocabularyId, int start, int end,
173                    com.liferay.portal.kernel.util.OrderByComparator obc)
174                    throws RemoteException {
175                    try {
176                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
177                                    AssetCategoryServiceUtil.getVocabularyCategories(vocabularyId,
178                                            start, end, obc);
179    
180                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
181                    }
182                    catch (Exception e) {
183                            _log.error(e, e);
184    
185                            throw new RemoteException(e.getMessage());
186                    }
187            }
188    
189            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
190                    long parentCategoryId, long vocabularyId, int start, int end,
191                    com.liferay.portal.kernel.util.OrderByComparator obc)
192                    throws RemoteException {
193                    try {
194                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
195                                    AssetCategoryServiceUtil.getVocabularyCategories(parentCategoryId,
196                                            vocabularyId, start, end, obc);
197    
198                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
199                    }
200                    catch (Exception e) {
201                            _log.error(e, e);
202    
203                            throw new RemoteException(e.getMessage());
204                    }
205            }
206    
207            public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
208                    long groupId, java.lang.String name, long vocabularyId, int start,
209                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
210                    throws RemoteException {
211                    try {
212                            java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
213                                    AssetCategoryServiceUtil.getVocabularyCategories(groupId, name,
214                                            vocabularyId, start, end, obc);
215    
216                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
217                    }
218                    catch (Exception e) {
219                            _log.error(e, e);
220    
221                            throw new RemoteException(e.getMessage());
222                    }
223            }
224    
225            public static int getVocabularyCategoriesCount(long groupId,
226                    long vocabularyId) throws RemoteException {
227                    try {
228                            int returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesCount(groupId,
229                                            vocabularyId);
230    
231                            return returnValue;
232                    }
233                    catch (Exception e) {
234                            _log.error(e, e);
235    
236                            throw new RemoteException(e.getMessage());
237                    }
238            }
239    
240            public static int getVocabularyCategoriesCount(long groupId,
241                    java.lang.String name, long vocabularyId) throws RemoteException {
242                    try {
243                            int returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesCount(groupId,
244                                            name, vocabularyId);
245    
246                            return 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[] getVocabularyRootCategories(
256                    long vocabularyId, int start, int end,
257                    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.getVocabularyRootCategories(vocabularyId,
262                                            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 com.liferay.portlet.asset.model.AssetCategorySoap moveCategory(
274                    long categoryId, long parentCategoryId, long vocabularyId,
275                    com.liferay.portal.service.ServiceContext serviceContext)
276                    throws RemoteException {
277                    try {
278                            com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.moveCategory(categoryId,
279                                            parentCategoryId, vocabularyId, serviceContext);
280    
281                            return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(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[] search(
291                    long groupId, java.lang.String keywords, 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.search(groupId, keywords,
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 java.lang.String search(long groupId, java.lang.String name,
309                    java.lang.String[] categoryProperties, int start, int end)
310                    throws RemoteException {
311                    try {
312                            com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.search(groupId,
313                                            name, categoryProperties, start, end);
314    
315                            return returnValue.toString();
316                    }
317                    catch (Exception e) {
318                            _log.error(e, e);
319    
320                            throw new RemoteException(e.getMessage());
321                    }
322            }
323    
324            private static Log _log = LogFactoryUtil.getLog(AssetCategoryServiceSoap.class);
325    }