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.AssetVocabularyServiceUtil;
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.AssetVocabularyServiceUtil} 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.AssetVocabularySoap}.
041     * If the method in the service utility returns a
042     * {@link com.liferay.portlet.asset.model.AssetVocabulary}, that is translated to a
043     * {@link com.liferay.portlet.asset.model.AssetVocabularySoap}. 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       AssetVocabularyServiceHttp
066     * @see       com.liferay.portlet.asset.model.AssetVocabularySoap
067     * @see       com.liferay.portlet.asset.service.AssetVocabularyServiceUtil
068     * @generated
069     */
070    public class AssetVocabularyServiceSoap {
071            /**
072            * @deprecated As of 6.1.0
073            */
074            public static com.liferay.portlet.asset.model.AssetVocabularySoap addVocabulary(
075                    java.lang.String[] titleMapLanguageIds,
076                    java.lang.String[] titleMapValues,
077                    java.lang.String[] descriptionMapLanguageIds,
078                    java.lang.String[] descriptionMapValues, java.lang.String settings,
079                    com.liferay.portal.service.ServiceContext serviceContext)
080                    throws RemoteException {
081                    try {
082                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
083                                            titleMapValues);
084                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
085                                            descriptionMapValues);
086    
087                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.addVocabulary(titleMap,
088                                            descriptionMap, settings, serviceContext);
089    
090                            return com.liferay.portlet.asset.model.AssetVocabularySoap.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.AssetVocabularySoap addVocabulary(
100                    java.lang.String title, java.lang.String[] titleMapLanguageIds,
101                    java.lang.String[] titleMapValues,
102                    java.lang.String[] descriptionMapLanguageIds,
103                    java.lang.String[] descriptionMapValues, java.lang.String settings,
104                    com.liferay.portal.service.ServiceContext serviceContext)
105                    throws RemoteException {
106                    try {
107                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
108                                            titleMapValues);
109                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
110                                            descriptionMapValues);
111    
112                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.addVocabulary(title,
113                                            titleMap, descriptionMap, settings, serviceContext);
114    
115                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
116                    }
117                    catch (Exception e) {
118                            _log.error(e, e);
119    
120                            throw new RemoteException(e.getMessage());
121                    }
122            }
123    
124            public static com.liferay.portlet.asset.model.AssetVocabularySoap addVocabulary(
125                    java.lang.String title,
126                    com.liferay.portal.service.ServiceContext serviceContext)
127                    throws RemoteException {
128                    try {
129                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.addVocabulary(title,
130                                            serviceContext);
131    
132                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
133                    }
134                    catch (Exception e) {
135                            _log.error(e, e);
136    
137                            throw new RemoteException(e.getMessage());
138                    }
139            }
140    
141            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] deleteVocabularies(
142                    long[] vocabularyIds,
143                    com.liferay.portal.service.ServiceContext serviceContext)
144                    throws RemoteException {
145                    try {
146                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
147                                    AssetVocabularyServiceUtil.deleteVocabularies(vocabularyIds,
148                                            serviceContext);
149    
150                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            public static void deleteVocabulary(long vocabularyId)
160                    throws RemoteException {
161                    try {
162                            AssetVocabularyServiceUtil.deleteVocabulary(vocabularyId);
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.AssetVocabularySoap[] getCompanyVocabularies(
172                    long companyId) throws RemoteException {
173                    try {
174                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
175                                    AssetVocabularyServiceUtil.getCompanyVocabularies(companyId);
176    
177                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
178                    }
179                    catch (Exception e) {
180                            _log.error(e, e);
181    
182                            throw new RemoteException(e.getMessage());
183                    }
184            }
185    
186            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupsVocabularies(
187                    long[] groupIds) throws RemoteException {
188                    try {
189                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
190                                    AssetVocabularyServiceUtil.getGroupsVocabularies(groupIds);
191    
192                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
193                    }
194                    catch (Exception e) {
195                            _log.error(e, e);
196    
197                            throw new RemoteException(e.getMessage());
198                    }
199            }
200    
201            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupsVocabularies(
202                    long[] groupIds, java.lang.String className) throws RemoteException {
203                    try {
204                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
205                                    AssetVocabularyServiceUtil.getGroupsVocabularies(groupIds,
206                                            className);
207    
208                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
209                    }
210                    catch (Exception e) {
211                            _log.error(e, e);
212    
213                            throw new RemoteException(e.getMessage());
214                    }
215            }
216    
217            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupVocabularies(
218                    long groupId) throws RemoteException {
219                    try {
220                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
221                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId);
222    
223                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
224                    }
225                    catch (Exception e) {
226                            _log.error(e, e);
227    
228                            throw new RemoteException(e.getMessage());
229                    }
230            }
231    
232            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupVocabularies(
233                    long groupId, boolean createDefaultVocabulary)
234                    throws RemoteException {
235                    try {
236                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
237                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId,
238                                            createDefaultVocabulary);
239    
240                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
241                    }
242                    catch (Exception e) {
243                            _log.error(e, e);
244    
245                            throw new RemoteException(e.getMessage());
246                    }
247            }
248    
249            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupVocabularies(
250                    long groupId, int start, int end,
251                    com.liferay.portal.kernel.util.OrderByComparator obc)
252                    throws RemoteException {
253                    try {
254                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
255                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId, start,
256                                            end, obc);
257    
258                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
259                    }
260                    catch (Exception e) {
261                            _log.error(e, e);
262    
263                            throw new RemoteException(e.getMessage());
264                    }
265            }
266    
267            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupVocabularies(
268                    long groupId, java.lang.String name, int start, int end,
269                    com.liferay.portal.kernel.util.OrderByComparator obc)
270                    throws RemoteException {
271                    try {
272                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
273                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId, name,
274                                            start, end, obc);
275    
276                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
277                    }
278                    catch (Exception e) {
279                            _log.error(e, e);
280    
281                            throw new RemoteException(e.getMessage());
282                    }
283            }
284    
285            public static int getGroupVocabulariesCount(long groupId)
286                    throws RemoteException {
287                    try {
288                            int returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesCount(groupId);
289    
290                            return returnValue;
291                    }
292                    catch (Exception e) {
293                            _log.error(e, e);
294    
295                            throw new RemoteException(e.getMessage());
296                    }
297            }
298    
299            public static int getGroupVocabulariesCount(long groupId,
300                    java.lang.String name) throws RemoteException {
301                    try {
302                            int returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesCount(groupId,
303                                            name);
304    
305                            return returnValue;
306                    }
307                    catch (Exception e) {
308                            _log.error(e, e);
309    
310                            throw new RemoteException(e.getMessage());
311                    }
312            }
313    
314            public static com.liferay.portlet.asset.model.AssetVocabularyDisplay getGroupVocabulariesDisplay(
315                    long groupId, java.lang.String name, int start, int end,
316                    com.liferay.portal.kernel.util.OrderByComparator obc)
317                    throws RemoteException {
318                    try {
319                            com.liferay.portlet.asset.model.AssetVocabularyDisplay returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesDisplay(groupId,
320                                            name, start, end, obc);
321    
322                            return returnValue;
323                    }
324                    catch (Exception e) {
325                            _log.error(e, e);
326    
327                            throw new RemoteException(e.getMessage());
328                    }
329            }
330    
331            public static java.lang.String getJSONGroupVocabularies(long groupId,
332                    java.lang.String name, int start, int end,
333                    com.liferay.portal.kernel.util.OrderByComparator obc)
334                    throws RemoteException {
335                    try {
336                            com.liferay.portal.kernel.json.JSONObject returnValue = AssetVocabularyServiceUtil.getJSONGroupVocabularies(groupId,
337                                            name, start, end, obc);
338    
339                            return returnValue.toString();
340                    }
341                    catch (Exception e) {
342                            _log.error(e, e);
343    
344                            throw new RemoteException(e.getMessage());
345                    }
346            }
347    
348            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getVocabularies(
349                    long[] vocabularyIds) throws RemoteException {
350                    try {
351                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
352                                    AssetVocabularyServiceUtil.getVocabularies(vocabularyIds);
353    
354                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
355                    }
356                    catch (Exception e) {
357                            _log.error(e, e);
358    
359                            throw new RemoteException(e.getMessage());
360                    }
361            }
362    
363            public static com.liferay.portlet.asset.model.AssetVocabularySoap getVocabulary(
364                    long vocabularyId) throws RemoteException {
365                    try {
366                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.getVocabulary(vocabularyId);
367    
368                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
369                    }
370                    catch (Exception e) {
371                            _log.error(e, e);
372    
373                            throw new RemoteException(e.getMessage());
374                    }
375            }
376    
377            /**
378            * @deprecated As of 6.1.0
379            */
380            public static com.liferay.portlet.asset.model.AssetVocabularySoap updateVocabulary(
381                    long vocabularyId, java.lang.String[] titleMapLanguageIds,
382                    java.lang.String[] titleMapValues,
383                    java.lang.String[] descriptionMapLanguageIds,
384                    java.lang.String[] descriptionMapValues, java.lang.String settings,
385                    com.liferay.portal.service.ServiceContext serviceContext)
386                    throws RemoteException {
387                    try {
388                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
389                                            titleMapValues);
390                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
391                                            descriptionMapValues);
392    
393                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.updateVocabulary(vocabularyId,
394                                            titleMap, descriptionMap, settings, serviceContext);
395    
396                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
397                    }
398                    catch (Exception e) {
399                            _log.error(e, e);
400    
401                            throw new RemoteException(e.getMessage());
402                    }
403            }
404    
405            public static com.liferay.portlet.asset.model.AssetVocabularySoap updateVocabulary(
406                    long vocabularyId, java.lang.String title,
407                    java.lang.String[] titleMapLanguageIds,
408                    java.lang.String[] titleMapValues,
409                    java.lang.String[] descriptionMapLanguageIds,
410                    java.lang.String[] descriptionMapValues, java.lang.String settings,
411                    com.liferay.portal.service.ServiceContext serviceContext)
412                    throws RemoteException {
413                    try {
414                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
415                                            titleMapValues);
416                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
417                                            descriptionMapValues);
418    
419                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.updateVocabulary(vocabularyId,
420                                            title, titleMap, descriptionMap, settings, serviceContext);
421    
422                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
423                    }
424                    catch (Exception e) {
425                            _log.error(e, e);
426    
427                            throw new RemoteException(e.getMessage());
428                    }
429            }
430    
431            private static Log _log = LogFactoryUtil.getLog(AssetVocabularyServiceSoap.class);
432    }