001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.dynamicdatamapping.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.dynamicdatamapping.service.DDMStructureServiceUtil;
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.dynamicdatamapping.service.DDMStructureServiceUtil} 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.dynamicdatamapping.model.DDMStructureSoap}.
041     * If the method in the service utility returns a
042     * {@link com.liferay.portlet.dynamicdatamapping.model.DDMStructure}, that is translated to a
043     * {@link com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap}. 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       DDMStructureServiceHttp
066     * @see       com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap
067     * @see       com.liferay.portlet.dynamicdatamapping.service.DDMStructureServiceUtil
068     * @generated
069     */
070    public class DDMStructureServiceSoap {
071            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap addStructure(
072                    long userId, long groupId, java.lang.String parentStructureKey,
073                    long classNameId, java.lang.String structureKey,
074                    java.lang.String[] nameMapLanguageIds,
075                    java.lang.String[] nameMapValues,
076                    java.lang.String[] descriptionMapLanguageIds,
077                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
078                    java.lang.String storageType, int type,
079                    com.liferay.portal.service.ServiceContext serviceContext)
080                    throws RemoteException {
081                    try {
082                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
083                                            nameMapValues);
084                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
085                                            descriptionMapValues);
086    
087                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
088                                    DDMStructureServiceUtil.addStructure(userId, groupId,
089                                            parentStructureKey, classNameId, structureKey, nameMap,
090                                            descriptionMap, xsd, storageType, type, serviceContext);
091    
092                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.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.dynamicdatamapping.model.DDMStructureSoap addStructure(
102                    long userId, long groupId, long classNameId,
103                    java.lang.String[] nameMapLanguageIds,
104                    java.lang.String[] nameMapValues,
105                    java.lang.String[] descriptionMapLanguageIds,
106                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
107                    com.liferay.portal.service.ServiceContext serviceContext)
108                    throws RemoteException {
109                    try {
110                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
111                                            nameMapValues);
112                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
113                                            descriptionMapValues);
114    
115                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
116                                    DDMStructureServiceUtil.addStructure(userId, groupId,
117                                            classNameId, nameMap, descriptionMap, xsd, serviceContext);
118    
119                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
120                    }
121                    catch (Exception e) {
122                            _log.error(e, e);
123    
124                            throw new RemoteException(e.getMessage());
125                    }
126            }
127    
128            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap addStructure(
129                    long groupId, long parentStructureId, long classNameId,
130                    java.lang.String structureKey, java.lang.String[] nameMapLanguageIds,
131                    java.lang.String[] nameMapValues,
132                    java.lang.String[] descriptionMapLanguageIds,
133                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
134                    java.lang.String storageType, int type,
135                    com.liferay.portal.service.ServiceContext serviceContext)
136                    throws RemoteException {
137                    try {
138                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
139                                            nameMapValues);
140                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
141                                            descriptionMapValues);
142    
143                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
144                                    DDMStructureServiceUtil.addStructure(groupId,
145                                            parentStructureId, classNameId, structureKey, nameMap,
146                                            descriptionMap, xsd, storageType, type, serviceContext);
147    
148                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
149                    }
150                    catch (Exception e) {
151                            _log.error(e, e);
152    
153                            throw new RemoteException(e.getMessage());
154                    }
155            }
156    
157            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap copyStructure(
158                    long structureId, java.lang.String[] nameMapLanguageIds,
159                    java.lang.String[] nameMapValues,
160                    java.lang.String[] descriptionMapLanguageIds,
161                    java.lang.String[] descriptionMapValues,
162                    com.liferay.portal.service.ServiceContext serviceContext)
163                    throws RemoteException {
164                    try {
165                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
166                                            nameMapValues);
167                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
168                                            descriptionMapValues);
169    
170                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
171                                    DDMStructureServiceUtil.copyStructure(structureId, nameMap,
172                                            descriptionMap, serviceContext);
173    
174                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
175                    }
176                    catch (Exception e) {
177                            _log.error(e, e);
178    
179                            throw new RemoteException(e.getMessage());
180                    }
181            }
182    
183            public static void deleteStructure(long structureId)
184                    throws RemoteException {
185                    try {
186                            DDMStructureServiceUtil.deleteStructure(structureId);
187                    }
188                    catch (Exception e) {
189                            _log.error(e, e);
190    
191                            throw new RemoteException(e.getMessage());
192                    }
193            }
194    
195            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap fetchStructure(
196                    long groupId, java.lang.String structureKey) throws RemoteException {
197                    try {
198                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
199                                    DDMStructureServiceUtil.fetchStructure(groupId, structureKey);
200    
201                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
202                    }
203                    catch (Exception e) {
204                            _log.error(e, e);
205    
206                            throw new RemoteException(e.getMessage());
207                    }
208            }
209    
210            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap getStructure(
211                    long structureId) throws RemoteException {
212                    try {
213                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
214                                    DDMStructureServiceUtil.getStructure(structureId);
215    
216                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
217                    }
218                    catch (Exception e) {
219                            _log.error(e, e);
220    
221                            throw new RemoteException(e.getMessage());
222                    }
223            }
224    
225            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap getStructure(
226                    long groupId, java.lang.String structureKey) throws RemoteException {
227                    try {
228                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
229                                    DDMStructureServiceUtil.getStructure(groupId, structureKey);
230    
231                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
232                    }
233                    catch (Exception e) {
234                            _log.error(e, e);
235    
236                            throw new RemoteException(e.getMessage());
237                    }
238            }
239    
240            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap getStructure(
241                    long groupId, java.lang.String structureKey,
242                    boolean includeGlobalStructures) throws RemoteException {
243                    try {
244                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
245                                    DDMStructureServiceUtil.getStructure(groupId, structureKey,
246                                            includeGlobalStructures);
247    
248                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
249                    }
250                    catch (Exception e) {
251                            _log.error(e, e);
252    
253                            throw new RemoteException(e.getMessage());
254                    }
255            }
256    
257            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] getStructures(
258                    long groupId) throws RemoteException {
259                    try {
260                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
261                                    DDMStructureServiceUtil.getStructures(groupId);
262    
263                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
264                    }
265                    catch (Exception e) {
266                            _log.error(e, e);
267    
268                            throw new RemoteException(e.getMessage());
269                    }
270            }
271    
272            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] getStructures(
273                    long[] groupIds) throws RemoteException {
274                    try {
275                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
276                                    DDMStructureServiceUtil.getStructures(groupIds);
277    
278                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
279                    }
280                    catch (Exception e) {
281                            _log.error(e, e);
282    
283                            throw new RemoteException(e.getMessage());
284                    }
285            }
286    
287            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] search(
288                    long companyId, long[] groupIds, long[] classNameIds,
289                    java.lang.String keywords, int start, int end,
290                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
291                    throws RemoteException {
292                    try {
293                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
294                                    DDMStructureServiceUtil.search(companyId, groupIds,
295                                            classNameIds, keywords, start, end, orderByComparator);
296    
297                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
298                    }
299                    catch (Exception e) {
300                            _log.error(e, e);
301    
302                            throw new RemoteException(e.getMessage());
303                    }
304            }
305    
306            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] search(
307                    long companyId, long[] groupIds, long[] classNameIds,
308                    java.lang.String name, java.lang.String description,
309                    java.lang.String storageType, int type, boolean andOperator, int start,
310                    int end,
311                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
312                    throws RemoteException {
313                    try {
314                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
315                                    DDMStructureServiceUtil.search(companyId, groupIds,
316                                            classNameIds, name, description, storageType, type,
317                                            andOperator, start, end, orderByComparator);
318    
319                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
320                    }
321                    catch (Exception e) {
322                            _log.error(e, e);
323    
324                            throw new RemoteException(e.getMessage());
325                    }
326            }
327    
328            public static int searchCount(long companyId, long[] groupIds,
329                    long[] classNameIds, java.lang.String keywords)
330                    throws RemoteException {
331                    try {
332                            int returnValue = DDMStructureServiceUtil.searchCount(companyId,
333                                            groupIds, classNameIds, keywords);
334    
335                            return returnValue;
336                    }
337                    catch (Exception e) {
338                            _log.error(e, e);
339    
340                            throw new RemoteException(e.getMessage());
341                    }
342            }
343    
344            public static int searchCount(long companyId, long[] groupIds,
345                    long[] classNameIds, java.lang.String name,
346                    java.lang.String description, java.lang.String storageType, int type,
347                    boolean andOperator) throws RemoteException {
348                    try {
349                            int returnValue = DDMStructureServiceUtil.searchCount(companyId,
350                                            groupIds, classNameIds, name, description, storageType,
351                                            type, andOperator);
352    
353                            return returnValue;
354                    }
355                    catch (Exception e) {
356                            _log.error(e, e);
357    
358                            throw new RemoteException(e.getMessage());
359                    }
360            }
361    
362            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap updateStructure(
363                    long structureId, long parentStructureId,
364                    java.lang.String[] nameMapLanguageIds,
365                    java.lang.String[] nameMapValues,
366                    java.lang.String[] descriptionMapLanguageIds,
367                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
368                    com.liferay.portal.service.ServiceContext serviceContext)
369                    throws RemoteException {
370                    try {
371                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
372                                            nameMapValues);
373                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
374                                            descriptionMapValues);
375    
376                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
377                                    DDMStructureServiceUtil.updateStructure(structureId,
378                                            parentStructureId, nameMap, descriptionMap, xsd,
379                                            serviceContext);
380    
381                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
382                    }
383                    catch (Exception e) {
384                            _log.error(e, e);
385    
386                            throw new RemoteException(e.getMessage());
387                    }
388            }
389    
390            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap updateStructure(
391                    long groupId, long parentStructureId, java.lang.String structureKey,
392                    java.lang.String[] nameMapLanguageIds,
393                    java.lang.String[] nameMapValues,
394                    java.lang.String[] descriptionMapLanguageIds,
395                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
396                    com.liferay.portal.service.ServiceContext serviceContext)
397                    throws RemoteException {
398                    try {
399                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
400                                            nameMapValues);
401                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
402                                            descriptionMapValues);
403    
404                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
405                                    DDMStructureServiceUtil.updateStructure(groupId,
406                                            parentStructureId, structureKey, nameMap, descriptionMap,
407                                            xsd, serviceContext);
408    
409                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
410                    }
411                    catch (Exception e) {
412                            _log.error(e, e);
413    
414                            throw new RemoteException(e.getMessage());
415                    }
416            }
417    
418            private static Log _log = LogFactoryUtil.getLog(DDMStructureServiceSoap.class);
419    }