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
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       AssetVocabularyServiceHttp
067     * @see       com.liferay.portlet.asset.model.AssetVocabularySoap
068     * @see       com.liferay.portlet.asset.service.AssetVocabularyServiceUtil
069     * @generated
070     */
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            /**
127            * @deprecated As of 6.2.0, Replaced by {@link #deleteVocabularies(long[],
128            ServiceContext)}
129            */
130            public static void deleteVocabularies(long[] vocabularyIds)
131                    throws RemoteException {
132                    try {
133                            AssetVocabularyServiceUtil.deleteVocabularies(vocabularyIds);
134                    }
135                    catch (Exception e) {
136                            _log.error(e, e);
137    
138                            throw new RemoteException(e.getMessage());
139                    }
140            }
141    
142            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] deleteVocabularies(
143                    long[] vocabularyIds,
144                    com.liferay.portal.service.ServiceContext serviceContext)
145                    throws RemoteException {
146                    try {
147                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
148                                    AssetVocabularyServiceUtil.deleteVocabularies(vocabularyIds,
149                                            serviceContext);
150    
151                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
152                    }
153                    catch (Exception e) {
154                            _log.error(e, e);
155    
156                            throw new RemoteException(e.getMessage());
157                    }
158            }
159    
160            public static void deleteVocabulary(long vocabularyId)
161                    throws RemoteException {
162                    try {
163                            AssetVocabularyServiceUtil.deleteVocabulary(vocabularyId);
164                    }
165                    catch (Exception e) {
166                            _log.error(e, e);
167    
168                            throw new RemoteException(e.getMessage());
169                    }
170            }
171    
172            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getCompanyVocabularies(
173                    long companyId) throws RemoteException {
174                    try {
175                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
176                                    AssetVocabularyServiceUtil.getCompanyVocabularies(companyId);
177    
178                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
179                    }
180                    catch (Exception e) {
181                            _log.error(e, e);
182    
183                            throw new RemoteException(e.getMessage());
184                    }
185            }
186    
187            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupsVocabularies(
188                    long[] groupIds) throws RemoteException {
189                    try {
190                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
191                                    AssetVocabularyServiceUtil.getGroupsVocabularies(groupIds);
192    
193                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
194                    }
195                    catch (Exception e) {
196                            _log.error(e, e);
197    
198                            throw new RemoteException(e.getMessage());
199                    }
200            }
201    
202            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupsVocabularies(
203                    long[] groupIds, java.lang.String className) throws RemoteException {
204                    try {
205                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
206                                    AssetVocabularyServiceUtil.getGroupsVocabularies(groupIds,
207                                            className);
208    
209                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
210                    }
211                    catch (Exception e) {
212                            _log.error(e, e);
213    
214                            throw new RemoteException(e.getMessage());
215                    }
216            }
217    
218            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupVocabularies(
219                    long groupId) throws RemoteException {
220                    try {
221                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
222                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId);
223    
224                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
225                    }
226                    catch (Exception e) {
227                            _log.error(e, e);
228    
229                            throw new RemoteException(e.getMessage());
230                    }
231            }
232    
233            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupVocabularies(
234                    long groupId, boolean createDefaultVocabulary)
235                    throws RemoteException {
236                    try {
237                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
238                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId,
239                                            createDefaultVocabulary);
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, int start, int end,
252                    com.liferay.portal.kernel.util.OrderByComparator obc)
253                    throws RemoteException {
254                    try {
255                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
256                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId, start,
257                                            end, obc);
258    
259                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
260                    }
261                    catch (Exception e) {
262                            _log.error(e, e);
263    
264                            throw new RemoteException(e.getMessage());
265                    }
266            }
267    
268            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getGroupVocabularies(
269                    long groupId, java.lang.String name, int start, int end,
270                    com.liferay.portal.kernel.util.OrderByComparator obc)
271                    throws RemoteException {
272                    try {
273                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
274                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId, name,
275                                            start, end, obc);
276    
277                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
278                    }
279                    catch (Exception e) {
280                            _log.error(e, e);
281    
282                            throw new RemoteException(e.getMessage());
283                    }
284            }
285    
286            public static int getGroupVocabulariesCount(long groupId)
287                    throws RemoteException {
288                    try {
289                            int returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesCount(groupId);
290    
291                            return returnValue;
292                    }
293                    catch (Exception e) {
294                            _log.error(e, e);
295    
296                            throw new RemoteException(e.getMessage());
297                    }
298            }
299    
300            public static int getGroupVocabulariesCount(long groupId,
301                    java.lang.String name) throws RemoteException {
302                    try {
303                            int returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesCount(groupId,
304                                            name);
305    
306                            return returnValue;
307                    }
308                    catch (Exception e) {
309                            _log.error(e, e);
310    
311                            throw new RemoteException(e.getMessage());
312                    }
313            }
314    
315            public static com.liferay.portlet.asset.model.AssetVocabularyDisplay getGroupVocabulariesDisplay(
316                    long groupId, java.lang.String name, int start, int end,
317                    boolean addDefaultVocabulary,
318                    com.liferay.portal.kernel.util.OrderByComparator obc)
319                    throws RemoteException {
320                    try {
321                            com.liferay.portlet.asset.model.AssetVocabularyDisplay returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesDisplay(groupId,
322                                            name, start, end, addDefaultVocabulary, obc);
323    
324                            return returnValue;
325                    }
326                    catch (Exception e) {
327                            _log.error(e, e);
328    
329                            throw new RemoteException(e.getMessage());
330                    }
331            }
332    
333            public static java.lang.String getJSONGroupVocabularies(long groupId,
334                    java.lang.String name, int start, int end,
335                    com.liferay.portal.kernel.util.OrderByComparator obc)
336                    throws RemoteException {
337                    try {
338                            com.liferay.portal.kernel.json.JSONObject returnValue = AssetVocabularyServiceUtil.getJSONGroupVocabularies(groupId,
339                                            name, start, end, obc);
340    
341                            return returnValue.toString();
342                    }
343                    catch (Exception e) {
344                            _log.error(e, e);
345    
346                            throw new RemoteException(e.getMessage());
347                    }
348            }
349    
350            public static java.lang.String getJSONGroupVocabulariesDisplay(
351                    long groupId, java.lang.String name, int start, int end,
352                    boolean addDefaultVocabulary,
353                    com.liferay.portal.kernel.util.OrderByComparator obc)
354                    throws RemoteException {
355                    try {
356                            com.liferay.portal.kernel.json.JSONObject returnValue = AssetVocabularyServiceUtil.getJSONGroupVocabulariesDisplay(groupId,
357                                            name, start, end, addDefaultVocabulary, obc);
358    
359                            return returnValue.toString();
360                    }
361                    catch (Exception e) {
362                            _log.error(e, e);
363    
364                            throw new RemoteException(e.getMessage());
365                    }
366            }
367    
368            public static com.liferay.portlet.asset.model.AssetVocabularySoap[] getVocabularies(
369                    long[] vocabularyIds) throws RemoteException {
370                    try {
371                            java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> returnValue =
372                                    AssetVocabularyServiceUtil.getVocabularies(vocabularyIds);
373    
374                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModels(returnValue);
375                    }
376                    catch (Exception e) {
377                            _log.error(e, e);
378    
379                            throw new RemoteException(e.getMessage());
380                    }
381            }
382    
383            public static com.liferay.portlet.asset.model.AssetVocabularySoap getVocabulary(
384                    long vocabularyId) throws RemoteException {
385                    try {
386                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.getVocabulary(vocabularyId);
387    
388                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
389                    }
390                    catch (Exception e) {
391                            _log.error(e, e);
392    
393                            throw new RemoteException(e.getMessage());
394                    }
395            }
396    
397            /**
398            * @deprecated As of 6.1.0, {@link #updateVocabulary(long, String, Map, Map,
399            String, ServiceContext)}
400            */
401            public static com.liferay.portlet.asset.model.AssetVocabularySoap updateVocabulary(
402                    long vocabularyId, java.lang.String[] titleMapLanguageIds,
403                    java.lang.String[] titleMapValues,
404                    java.lang.String[] descriptionMapLanguageIds,
405                    java.lang.String[] descriptionMapValues, java.lang.String settings,
406                    com.liferay.portal.service.ServiceContext serviceContext)
407                    throws RemoteException {
408                    try {
409                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
410                                            titleMapValues);
411                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
412                                            descriptionMapValues);
413    
414                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.updateVocabulary(vocabularyId,
415                                            titleMap, descriptionMap, settings, serviceContext);
416    
417                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
418                    }
419                    catch (Exception e) {
420                            _log.error(e, e);
421    
422                            throw new RemoteException(e.getMessage());
423                    }
424            }
425    
426            public static com.liferay.portlet.asset.model.AssetVocabularySoap updateVocabulary(
427                    long vocabularyId, java.lang.String title,
428                    java.lang.String[] titleMapLanguageIds,
429                    java.lang.String[] titleMapValues,
430                    java.lang.String[] descriptionMapLanguageIds,
431                    java.lang.String[] descriptionMapValues, java.lang.String settings,
432                    com.liferay.portal.service.ServiceContext serviceContext)
433                    throws RemoteException {
434                    try {
435                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
436                                            titleMapValues);
437                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
438                                            descriptionMapValues);
439    
440                            com.liferay.portlet.asset.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.updateVocabulary(vocabularyId,
441                                            title, titleMap, descriptionMap, settings, serviceContext);
442    
443                            return com.liferay.portlet.asset.model.AssetVocabularySoap.toSoapModel(returnValue);
444                    }
445                    catch (Exception e) {
446                            _log.error(e, e);
447    
448                            throw new RemoteException(e.getMessage());
449                    }
450            }
451    
452            private static Log _log = LogFactoryUtil.getLog(AssetVocabularyServiceSoap.class);
453    }