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.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
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       DDMStructureServiceHttp
067     * @see       com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap
068     * @see       com.liferay.portlet.dynamicdatamapping.service.DDMStructureServiceUtil
069     * @generated
070     */
071    public class DDMStructureServiceSoap {
072            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap addStructure(
073                    long groupId, 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(groupId, classNameId,
089                                            structureKey, nameMap, descriptionMap, xsd, storageType,
090                                            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 copyStructure(
102                    long structureId, java.lang.String[] nameMapLanguageIds,
103                    java.lang.String[] nameMapValues,
104                    java.lang.String[] descriptionMapLanguageIds,
105                    java.lang.String[] descriptionMapValues,
106                    com.liferay.portal.service.ServiceContext serviceContext)
107                    throws RemoteException {
108                    try {
109                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
110                                            nameMapValues);
111                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
112                                            descriptionMapValues);
113    
114                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
115                                    DDMStructureServiceUtil.copyStructure(structureId, nameMap,
116                                            descriptionMap, serviceContext);
117    
118                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
119                    }
120                    catch (Exception e) {
121                            _log.error(e, e);
122    
123                            throw new RemoteException(e.getMessage());
124                    }
125            }
126    
127            public static void deleteStructure(long structureId)
128                    throws RemoteException {
129                    try {
130                            DDMStructureServiceUtil.deleteStructure(structureId);
131                    }
132                    catch (Exception e) {
133                            _log.error(e, e);
134    
135                            throw new RemoteException(e.getMessage());
136                    }
137            }
138    
139            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap fetchStructure(
140                    long groupId, java.lang.String structureKey) throws RemoteException {
141                    try {
142                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
143                                    DDMStructureServiceUtil.fetchStructure(groupId, structureKey);
144    
145                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
146                    }
147                    catch (Exception e) {
148                            _log.error(e, e);
149    
150                            throw new RemoteException(e.getMessage());
151                    }
152            }
153    
154            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap getStructure(
155                    long structureId) throws RemoteException {
156                    try {
157                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
158                                    DDMStructureServiceUtil.getStructure(structureId);
159    
160                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
161                    }
162                    catch (Exception e) {
163                            _log.error(e, e);
164    
165                            throw new RemoteException(e.getMessage());
166                    }
167            }
168    
169            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] search(
170                    long companyId, long[] groupIds, long[] classNameIds,
171                    java.lang.String keywords, int start, int end,
172                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
173                    throws RemoteException {
174                    try {
175                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
176                                    DDMStructureServiceUtil.search(companyId, groupIds,
177                                            classNameIds, keywords, start, end, orderByComparator);
178    
179                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
180                    }
181                    catch (Exception e) {
182                            _log.error(e, e);
183    
184                            throw new RemoteException(e.getMessage());
185                    }
186            }
187    
188            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] search(
189                    long companyId, long[] groupIds, long[] classNameIds,
190                    java.lang.String name, java.lang.String description,
191                    java.lang.String storageType, int type, boolean andOperator, int start,
192                    int end,
193                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
194                    throws RemoteException {
195                    try {
196                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
197                                    DDMStructureServiceUtil.search(companyId, groupIds,
198                                            classNameIds, name, description, storageType, type,
199                                            andOperator, start, end, orderByComparator);
200    
201                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
202                    }
203                    catch (Exception e) {
204                            _log.error(e, e);
205    
206                            throw new RemoteException(e.getMessage());
207                    }
208            }
209    
210            public static int searchCount(long companyId, long[] groupIds,
211                    long[] classNameIds, java.lang.String keywords)
212                    throws RemoteException {
213                    try {
214                            int returnValue = DDMStructureServiceUtil.searchCount(companyId,
215                                            groupIds, classNameIds, keywords);
216    
217                            return returnValue;
218                    }
219                    catch (Exception e) {
220                            _log.error(e, e);
221    
222                            throw new RemoteException(e.getMessage());
223                    }
224            }
225    
226            public static int searchCount(long companyId, long[] groupIds,
227                    long[] classNameIds, java.lang.String name,
228                    java.lang.String description, java.lang.String storageType, int type,
229                    boolean andOperator) throws RemoteException {
230                    try {
231                            int returnValue = DDMStructureServiceUtil.searchCount(companyId,
232                                            groupIds, classNameIds, name, description, storageType,
233                                            type, andOperator);
234    
235                            return returnValue;
236                    }
237                    catch (Exception e) {
238                            _log.error(e, e);
239    
240                            throw new RemoteException(e.getMessage());
241                    }
242            }
243    
244            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap updateStructure(
245                    long structureId, java.lang.String[] nameMapLanguageIds,
246                    java.lang.String[] nameMapValues,
247                    java.lang.String[] descriptionMapLanguageIds,
248                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
249                    com.liferay.portal.service.ServiceContext serviceContext)
250                    throws RemoteException {
251                    try {
252                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
253                                            nameMapValues);
254                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
255                                            descriptionMapValues);
256    
257                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
258                                    DDMStructureServiceUtil.updateStructure(structureId, nameMap,
259                                            descriptionMap, xsd, serviceContext);
260    
261                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
262                    }
263                    catch (Exception e) {
264                            _log.error(e, e);
265    
266                            throw new RemoteException(e.getMessage());
267                    }
268            }
269    
270            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap updateStructure(
271                    long groupId, java.lang.String structureKey,
272                    java.lang.String[] nameMapLanguageIds,
273                    java.lang.String[] nameMapValues,
274                    java.lang.String[] descriptionMapLanguageIds,
275                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
276                    com.liferay.portal.service.ServiceContext serviceContext)
277                    throws RemoteException {
278                    try {
279                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
280                                            nameMapValues);
281                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
282                                            descriptionMapValues);
283    
284                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
285                                    DDMStructureServiceUtil.updateStructure(groupId, structureKey,
286                                            nameMap, descriptionMap, xsd, serviceContext);
287    
288                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
289                    }
290                    catch (Exception e) {
291                            _log.error(e, e);
292    
293                            throw new RemoteException(e.getMessage());
294                    }
295            }
296    
297            private static Log _log = LogFactoryUtil.getLog(DDMStructureServiceSoap.class);
298    }