001    /**
002     * Copyright (c) 2000-present 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.asset.kernel.service.AssetVocabularyServiceUtil;
020    
021    import com.liferay.portal.kernel.log.Log;
022    import com.liferay.portal.kernel.log.LogFactoryUtil;
023    import com.liferay.portal.kernel.util.LocalizationUtil;
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 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.asset.kernel.model.AssetVocabularySoap}.
041     * If the method in the service utility returns a
042     * {@link com.liferay.asset.kernel.model.AssetVocabulary}, that is translated to a
043     * {@link com.liferay.asset.kernel.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.asset.kernel.model.AssetVocabularySoap
067     * @see AssetVocabularyServiceUtil
068     * @generated
069     */
070    @ProviderType
071    public class AssetVocabularyServiceSoap {
072            public static com.liferay.asset.kernel.model.AssetVocabularySoap addVocabulary(
073                    long groupId, java.lang.String title,
074                    java.lang.String[] titleMapLanguageIds,
075                    java.lang.String[] titleMapValues,
076                    java.lang.String[] descriptionMapLanguageIds,
077                    java.lang.String[] descriptionMapValues, java.lang.String settings,
078                    com.liferay.portal.kernel.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.asset.kernel.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.addVocabulary(groupId,
087                                            title, titleMap, descriptionMap, settings, serviceContext);
088    
089                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModel(returnValue);
090                    }
091                    catch (Exception e) {
092                            _log.error(e, e);
093    
094                            throw new RemoteException(e.getMessage());
095                    }
096            }
097    
098            public static com.liferay.asset.kernel.model.AssetVocabularySoap addVocabulary(
099                    long groupId, java.lang.String title,
100                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
101                    throws RemoteException {
102                    try {
103                            com.liferay.asset.kernel.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.addVocabulary(groupId,
104                                            title, serviceContext);
105    
106                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModel(returnValue);
107                    }
108                    catch (Exception e) {
109                            _log.error(e, e);
110    
111                            throw new RemoteException(e.getMessage());
112                    }
113            }
114    
115            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] deleteVocabularies(
116                    long[] vocabularyIds,
117                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
118                    throws RemoteException {
119                    try {
120                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
121                                    AssetVocabularyServiceUtil.deleteVocabularies(vocabularyIds,
122                                            serviceContext);
123    
124                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
125                    }
126                    catch (Exception e) {
127                            _log.error(e, e);
128    
129                            throw new RemoteException(e.getMessage());
130                    }
131            }
132    
133            public static void deleteVocabulary(long vocabularyId)
134                    throws RemoteException {
135                    try {
136                            AssetVocabularyServiceUtil.deleteVocabulary(vocabularyId);
137                    }
138                    catch (Exception e) {
139                            _log.error(e, e);
140    
141                            throw new RemoteException(e.getMessage());
142                    }
143            }
144    
145            public static com.liferay.asset.kernel.model.AssetVocabularySoap fetchVocabulary(
146                    long vocabularyId) throws RemoteException {
147                    try {
148                            com.liferay.asset.kernel.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.fetchVocabulary(vocabularyId);
149    
150                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModel(returnValue);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            /**
160            * @deprecated As of 7.0.0, with no direct replacement
161            */
162            @Deprecated
163            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getCompanyVocabularies(
164                    long companyId) throws RemoteException {
165                    try {
166                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
167                                    AssetVocabularyServiceUtil.getCompanyVocabularies(companyId);
168    
169                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
170                    }
171                    catch (Exception e) {
172                            _log.error(e, e);
173    
174                            throw new RemoteException(e.getMessage());
175                    }
176            }
177    
178            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getGroupsVocabularies(
179                    long[] groupIds) throws RemoteException {
180                    try {
181                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
182                                    AssetVocabularyServiceUtil.getGroupsVocabularies(groupIds);
183    
184                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
185                    }
186                    catch (Exception e) {
187                            _log.error(e, e);
188    
189                            throw new RemoteException(e.getMessage());
190                    }
191            }
192    
193            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getGroupsVocabularies(
194                    long[] groupIds, java.lang.String className) throws RemoteException {
195                    try {
196                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
197                                    AssetVocabularyServiceUtil.getGroupsVocabularies(groupIds,
198                                            className);
199    
200                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
201                    }
202                    catch (Exception e) {
203                            _log.error(e, e);
204    
205                            throw new RemoteException(e.getMessage());
206                    }
207            }
208    
209            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getGroupsVocabularies(
210                    long[] groupIds, java.lang.String className, long classTypePK)
211                    throws RemoteException {
212                    try {
213                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
214                                    AssetVocabularyServiceUtil.getGroupsVocabularies(groupIds,
215                                            className, classTypePK);
216    
217                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
218                    }
219                    catch (Exception e) {
220                            _log.error(e, e);
221    
222                            throw new RemoteException(e.getMessage());
223                    }
224            }
225    
226            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getGroupVocabularies(
227                    long groupId) throws RemoteException {
228                    try {
229                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
230                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId);
231    
232                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
233                    }
234                    catch (Exception e) {
235                            _log.error(e, e);
236    
237                            throw new RemoteException(e.getMessage());
238                    }
239            }
240    
241            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getGroupVocabularies(
242                    long groupId, boolean createDefaultVocabulary)
243                    throws RemoteException {
244                    try {
245                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
246                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId,
247                                            createDefaultVocabulary);
248    
249                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
250                    }
251                    catch (Exception e) {
252                            _log.error(e, e);
253    
254                            throw new RemoteException(e.getMessage());
255                    }
256            }
257    
258            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getGroupVocabularies(
259                    long groupId, boolean createDefaultVocabulary, int start, int end,
260                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.asset.kernel.model.AssetVocabulary> obc)
261                    throws RemoteException {
262                    try {
263                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
264                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId,
265                                            createDefaultVocabulary, start, end, obc);
266    
267                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
268                    }
269                    catch (Exception e) {
270                            _log.error(e, e);
271    
272                            throw new RemoteException(e.getMessage());
273                    }
274            }
275    
276            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getGroupVocabularies(
277                    long groupId, int start, int end,
278                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.asset.kernel.model.AssetVocabulary> obc)
279                    throws RemoteException {
280                    try {
281                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
282                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId, start,
283                                            end, obc);
284    
285                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
286                    }
287                    catch (Exception e) {
288                            _log.error(e, e);
289    
290                            throw new RemoteException(e.getMessage());
291                    }
292            }
293    
294            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getGroupVocabularies(
295                    long groupId, java.lang.String name, int start, int end,
296                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.asset.kernel.model.AssetVocabulary> obc)
297                    throws RemoteException {
298                    try {
299                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
300                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupId, name,
301                                            start, end, obc);
302    
303                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
304                    }
305                    catch (Exception e) {
306                            _log.error(e, e);
307    
308                            throw new RemoteException(e.getMessage());
309                    }
310            }
311    
312            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getGroupVocabularies(
313                    long[] groupIds) throws RemoteException {
314                    try {
315                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
316                                    AssetVocabularyServiceUtil.getGroupVocabularies(groupIds);
317    
318                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
319                    }
320                    catch (Exception e) {
321                            _log.error(e, e);
322    
323                            throw new RemoteException(e.getMessage());
324                    }
325            }
326    
327            public static int getGroupVocabulariesCount(long groupId)
328                    throws RemoteException {
329                    try {
330                            int returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesCount(groupId);
331    
332                            return returnValue;
333                    }
334                    catch (Exception e) {
335                            _log.error(e, e);
336    
337                            throw new RemoteException(e.getMessage());
338                    }
339            }
340    
341            public static int getGroupVocabulariesCount(long groupId,
342                    java.lang.String name) throws RemoteException {
343                    try {
344                            int returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesCount(groupId,
345                                            name);
346    
347                            return returnValue;
348                    }
349                    catch (Exception e) {
350                            _log.error(e, e);
351    
352                            throw new RemoteException(e.getMessage());
353                    }
354            }
355    
356            public static int getGroupVocabulariesCount(long[] groupIds)
357                    throws RemoteException {
358                    try {
359                            int returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesCount(groupIds);
360    
361                            return returnValue;
362                    }
363                    catch (Exception e) {
364                            _log.error(e, e);
365    
366                            throw new RemoteException(e.getMessage());
367                    }
368            }
369    
370            public static com.liferay.asset.kernel.model.AssetVocabularyDisplay getGroupVocabulariesDisplay(
371                    long groupId, java.lang.String name, int start, int end,
372                    boolean addDefaultVocabulary,
373                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.asset.kernel.model.AssetVocabulary> obc)
374                    throws RemoteException {
375                    try {
376                            com.liferay.asset.kernel.model.AssetVocabularyDisplay returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesDisplay(groupId,
377                                            name, start, end, addDefaultVocabulary, obc);
378    
379                            return returnValue;
380                    }
381                    catch (Exception e) {
382                            _log.error(e, e);
383    
384                            throw new RemoteException(e.getMessage());
385                    }
386            }
387    
388            public static com.liferay.asset.kernel.model.AssetVocabularyDisplay getGroupVocabulariesDisplay(
389                    long groupId, java.lang.String name, int start, int end,
390                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.asset.kernel.model.AssetVocabulary> obc)
391                    throws RemoteException {
392                    try {
393                            com.liferay.asset.kernel.model.AssetVocabularyDisplay returnValue = AssetVocabularyServiceUtil.getGroupVocabulariesDisplay(groupId,
394                                            name, start, end, obc);
395    
396                            return returnValue;
397                    }
398                    catch (Exception e) {
399                            _log.error(e, e);
400    
401                            throw new RemoteException(e.getMessage());
402                    }
403            }
404    
405            /**
406            * @deprecated As of 7.0.0, replaced by {@link
407            AssetUtil#filterVocabularyIds(PermissionChecker, long[])}
408            */
409            @Deprecated
410            public static com.liferay.asset.kernel.model.AssetVocabularySoap[] getVocabularies(
411                    long[] vocabularyIds) throws RemoteException {
412                    try {
413                            java.util.List<com.liferay.asset.kernel.model.AssetVocabulary> returnValue =
414                                    AssetVocabularyServiceUtil.getVocabularies(vocabularyIds);
415    
416                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModels(returnValue);
417                    }
418                    catch (Exception e) {
419                            _log.error(e, e);
420    
421                            throw new RemoteException(e.getMessage());
422                    }
423            }
424    
425            public static com.liferay.asset.kernel.model.AssetVocabularySoap getVocabulary(
426                    long vocabularyId) throws RemoteException {
427                    try {
428                            com.liferay.asset.kernel.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.getVocabulary(vocabularyId);
429    
430                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModel(returnValue);
431                    }
432                    catch (Exception e) {
433                            _log.error(e, e);
434    
435                            throw new RemoteException(e.getMessage());
436                    }
437            }
438    
439            public static com.liferay.asset.kernel.model.AssetVocabularyDisplay searchVocabulariesDisplay(
440                    long groupId, java.lang.String title, boolean addDefaultVocabulary,
441                    int start, int end) throws RemoteException {
442                    try {
443                            com.liferay.asset.kernel.model.AssetVocabularyDisplay returnValue = AssetVocabularyServiceUtil.searchVocabulariesDisplay(groupId,
444                                            title, addDefaultVocabulary, start, end);
445    
446                            return returnValue;
447                    }
448                    catch (Exception e) {
449                            _log.error(e, e);
450    
451                            throw new RemoteException(e.getMessage());
452                    }
453            }
454    
455            public static com.liferay.asset.kernel.model.AssetVocabularyDisplay searchVocabulariesDisplay(
456                    long groupId, java.lang.String title, boolean addDefaultVocabulary,
457                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
458                    throws RemoteException {
459                    try {
460                            com.liferay.asset.kernel.model.AssetVocabularyDisplay returnValue = AssetVocabularyServiceUtil.searchVocabulariesDisplay(groupId,
461                                            title, addDefaultVocabulary, start, end, sort);
462    
463                            return returnValue;
464                    }
465                    catch (Exception e) {
466                            _log.error(e, e);
467    
468                            throw new RemoteException(e.getMessage());
469                    }
470            }
471    
472            public static com.liferay.asset.kernel.model.AssetVocabularySoap updateVocabulary(
473                    long vocabularyId, java.lang.String title,
474                    java.lang.String[] titleMapLanguageIds,
475                    java.lang.String[] titleMapValues,
476                    java.lang.String[] descriptionMapLanguageIds,
477                    java.lang.String[] descriptionMapValues, java.lang.String settings,
478                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
479                    throws RemoteException {
480                    try {
481                            Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
482                                            titleMapValues);
483                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
484                                            descriptionMapValues);
485    
486                            com.liferay.asset.kernel.model.AssetVocabulary returnValue = AssetVocabularyServiceUtil.updateVocabulary(vocabularyId,
487                                            title, titleMap, descriptionMap, settings, serviceContext);
488    
489                            return com.liferay.asset.kernel.model.AssetVocabularySoap.toSoapModel(returnValue);
490                    }
491                    catch (Exception e) {
492                            _log.error(e, e);
493    
494                            throw new RemoteException(e.getMessage());
495                    }
496            }
497    
498            private static Log _log = LogFactoryUtil.getLog(AssetVocabularyServiceSoap.class);
499    }