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.AssetVocabularyServiceUtil;
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.AssetVocabularyServiceUtil} 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.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    @ProviderType
071    public class AssetVocabularyServiceSoap {
072            /**
073            * @deprecated As of 6.1.0 {@link #addVocabulary(String, Map, Map, String,
074            ServiceContext)}
075            */
076            public static com.liferay.portlet.asset.model.AssetVocabularySoap addVocabulary(
077                    java.lang.String[] titleMapLanguageIds,
078                    java.lang.String[] titleMapValues,
079                    java.lang.String[] descriptionMapLanguageIds,
080                    java.lang.String[] descriptionMapValues, java.lang.String settings,
081                    com.liferay.portal.service.ServiceContext serviceContext)
082                    throws RemoteException {
083                    try {
084                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
085                                            titleMapValues);
086                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
087                                            descriptionMapValues);
088    
089                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.addVocabulary(titleMap,
090                                            descriptionMap, settings, serviceContext);
091    
092                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
093                    }
094                    catch (Exception e) {
095                            _log.error(e, e);
096    
097                            throw new RemoteException(e.getMessage());
098                    }
099            }
100    
101            public static com.liferay.portlet.asset.model.AssetVocabularySoap addVocabulary(
102                    java.lang.String title, java.lang.String[] titleMapLanguageIds,
103                    java.lang.String[] titleMapValues,
104                    java.lang.String[] descriptionMapLanguageIds,
105                    java.lang.String[] descriptionMapValues, java.lang.String settings,
106                    com.liferay.portal.service.ServiceContext serviceContext)
107                    throws RemoteException {
108                    try {
109                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
110                                            titleMapValues);
111                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
112                                            descriptionMapValues);
113    
114                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.addVocabulary(title,
115                                            titleMap, descriptionMap, settings, serviceContext);
116    
117                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
118                    }
119                    catch (Exception e) {
120                            _log.error(e, e);
121    
122                            throw new RemoteException(e.getMessage());
123                    }
124            }
125    
126            public static com.liferay.portlet.asset.model.AssetVocabularySoap addVocabulary(
127                    java.lang.String title,
128                    com.liferay.portal.service.ServiceContext serviceContext)
129                    throws RemoteException {
130                    try {
131                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.addVocabulary(title,
132                                            serviceContext);
133    
134                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
135                    }
136                    catch (Exception e) {
137                            _log.error(e, e);
138    
139                            throw new RemoteException(e.getMessage());
140                    }
141            }
142    
143            /**
144            * @deprecated As of 6.2.0, Replaced by {@link #deleteVocabularies(long[],
145            ServiceContext)}
146            */
147            public static void deleteVocabularies(long[] vocabularyIds)
148                    throws RemoteException {
149                    try {
150                            AssetVocabularyServiceUtil.deleteVocabularies(vocabularyIds);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] deleteVocabularies(
160                    long[] vocabularyIds,
161                    com.liferay.portal.service.ServiceContext serviceContext)
162                    throws RemoteException {
163                    try {
164                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
165                                    AssetVocabularyServiceUtil.deleteVocabularies(vocabularyIds,
166                                            serviceContext);
167    
168                            return com.liferay.portlet.asset.model.AssetVocabularySoap.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 void deleteVocabulary(long vocabularyId)
178                    throws RemoteException {
179                    try {
180                            AssetVocabularyServiceUtil.deleteVocabulary(vocabularyId);
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.AssetVocabularySoap[] getCompanyVocabularies(
190                    long companyId) throws RemoteException {
191                    try {
192                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
193                                    AssetVocabularyServiceUtil.getCompanyVocabularies(companyId);
194    
195                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
196                    }
197                    catch (Exception e) {
198                            _log.error(e, e);
199    
200                            throw new RemoteException(e.getMessage());
201                    }
202            }
203    
204            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupsVocabularies(
205                    long[] groupIds) throws RemoteException {
206                    try {
207                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
208                                    AssetVocabularyServiceUtil.getGroupsVocabularies(groupIds);
209    
210                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
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.AssetVocabularySoap[] getGroupsVocabularies(
220                    long[] groupIds, java.lang.String className) throws RemoteException {
221                    try {
222                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
223                                    AssetVocabularyServiceUtil.getGroupsVocabularies(groupIds,
224                                            className);
225    
226                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
227                    }
228                    catch (Exception e) {
229                            _log.error(e, e);
230    
231                            throw new RemoteException(e.getMessage());
232                    }
233            }
234    
235            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupVocabularies(
236                    long groupId) throws RemoteException {
237                    try {
238                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
239                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId);
240    
241                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
242                    }
243                    catch (Exception e) {
244                            _log.error(e, e);
245    
246                            throw new RemoteException(e.getMessage());
247                    }
248            }
249    
250            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupVocabularies(
251                    long groupId, boolean createDefaultVocabulary)
252                    throws RemoteException {
253                    try {
254                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
255                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId,
256                                            createDefaultVocabulary);
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, 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, start,
274                                            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 com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupVocabularies(
286                    long groupId, java.lang.String name, int start, int end,
287                    com.liferay.portal.kernel.util.OrderByComparator obc)
288                    throws RemoteException {
289                    try {
290                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
291                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId, name,
292                                            start, end, obc);
293    
294                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
295                    }
296                    catch (Exception e) {
297                            _log.error(e, e);
298    
299                            throw new RemoteException(e.getMessage());
300                    }
301            }
302    
303            public static int getGroupVocabulariesCount(long groupId)
304                    throws RemoteException {
305                    try {
306                            int returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesCount(groupId);
307    
308                            return returnValue;
309                    }
310                    catch (Exception e) {
311                            _log.error(e, e);
312    
313                            throw new RemoteException(e.getMessage());
314                    }
315            }
316    
317            public static int getGroupVocabulariesCount(long groupId,
318                    java.lang.String name) throws RemoteException {
319                    try {
320                            int returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesCount(groupId,
321                                            name);
322    
323                            return returnValue;
324                    }
325                    catch (Exception e) {
326                            _log.error(e, e);
327    
328                            throw new RemoteException(e.getMessage());
329                    }
330            }
331    
332            public static com.liferay.portlet.asset.model.AssetVocabularyDisplay getGroupVocabulariesDisplay(
333                    long groupId, java.lang.String title, int start, int end,
334                    boolean addDefaultVocabulary,
335                    com.liferay.portal.kernel.util.OrderByComparator obc)
336                    throws RemoteException {
337                    try {
338                            com.liferay.portlet.asset.model.AssetVocabularyDisplay returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesDisplay(groupId,
339                                            title, start, end, addDefaultVocabulary, obc);
340    
341                            return returnValue;
342                    }
343                    catch (Exception e) {
344                            _log.error(e, e);
345    
346                            throw new RemoteException(e.getMessage());
347                    }
348            }
349    
350            public static com.liferay.portlet.asset.model.AssetVocabularyDisplay getGroupVocabulariesDisplay(
351                    long groupId, java.lang.String name, int start, int end,
352                    com.liferay.portal.kernel.util.OrderByComparator obc)
353                    throws RemoteException {
354                    try {
355                            com.liferay.portlet.asset.model.AssetVocabularyDisplay returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesDisplay(groupId,
356                                            name, start, end, obc);
357    
358                            return returnValue;
359                    }
360                    catch (Exception e) {
361                            _log.error(e, e);
362    
363                            throw new RemoteException(e.getMessage());
364                    }
365            }
366    
367            /**
368            * @deprecated As of 6.2.0, with no direct replacement
369            */
370            public static java.lang.String getJSONGroupVocabularies(long groupId,
371                    java.lang.String name, int start, int end,
372                    com.liferay.portal.kernel.util.OrderByComparator obc)
373                    throws RemoteException {
374                    try {
375                            com.liferay.portal.kernel.json.JSONObject returnValue = AssetVocabularyServiceUtil.getJSONGroupVocabularies(groupId,
376                                            name, start, end, obc);
377    
378                            return returnValue.toString();
379                    }
380                    catch (Exception e) {
381                            _log.error(e, e);
382    
383                            throw new RemoteException(e.getMessage());
384                    }
385            }
386    
387            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getVocabularies(
388                    long[] vocabularyIds) throws RemoteException {
389                    try {
390                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
391                                    AssetVocabularyServiceUtil.getVocabularies(vocabularyIds);
392    
393                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
394                    }
395                    catch (Exception e) {
396                            _log.error(e, e);
397    
398                            throw new RemoteException(e.getMessage());
399                    }
400            }
401    
402            public static com.liferay.portlet.asset.model.AssetVocabularySoap getVocabulary(
403                    long vocabularyId) throws RemoteException {
404                    try {
405                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.getVocabulary(vocabularyId);
406    
407                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
408                    }
409                    catch (Exception e) {
410                            _log.error(e, e);
411    
412                            throw new RemoteException(e.getMessage());
413                    }
414            }
415    
416            /**
417            * @deprecated As of 6.1.0, {@link #updateVocabulary(long, String, Map, Map,
418            String, ServiceContext)}
419            */
420            public static com.liferay.portlet.asset.model.AssetVocabularySoap updateVocabulary(
421                    long vocabularyId, java.lang.String[] titleMapLanguageIds,
422                    java.lang.String[] titleMapValues,
423                    java.lang.String[] descriptionMapLanguageIds,
424                    java.lang.String[] descriptionMapValues, java.lang.String settings,
425                    com.liferay.portal.service.ServiceContext serviceContext)
426                    throws RemoteException {
427                    try {
428                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
429                                            titleMapValues);
430                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
431                                            descriptionMapValues);
432    
433                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.updateVocabulary(vocabularyId,
434                                            titleMap, descriptionMap, settings, serviceContext);
435    
436                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
437                    }
438                    catch (Exception e) {
439                            _log.error(e, e);
440    
441                            throw new RemoteException(e.getMessage());
442                    }
443            }
444    
445            public static com.liferay.portlet.asset.model.AssetVocabularySoap updateVocabulary(
446                    long vocabularyId, java.lang.String title,
447                    java.lang.String[] titleMapLanguageIds,
448                    java.lang.String[] titleMapValues,
449                    java.lang.String[] descriptionMapLanguageIds,
450                    java.lang.String[] descriptionMapValues, java.lang.String settings,
451                    com.liferay.portal.service.ServiceContext serviceContext)
452                    throws RemoteException {
453                    try {
454                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
455                                            titleMapValues);
456                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
457                                            descriptionMapValues);
458    
459                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.updateVocabulary(vocabularyId,
460                                            title, titleMap, descriptionMap, settings, serviceContext);
461    
462                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
463                    }
464                    catch (Exception e) {
465                            _log.error(e, e);
466    
467                            throw new RemoteException(e.getMessage());
468                    }
469            }
470    
471            private static Log _log = LogFactoryUtil.getLog(AssetVocabularyServiceSoap.class);
472    }