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.DDMTemplateServiceUtil;
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.DDMTemplateServiceUtil} 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.DDMTemplateSoap}.
041     * If the method in the service utility returns a
042     * {@link com.liferay.portlet.dynamicdatamapping.model.DDMTemplate}, that is translated to a
043     * {@link com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap}. 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       DDMTemplateServiceHttp
066     * @see       com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap
067     * @see       com.liferay.portlet.dynamicdatamapping.service.DDMTemplateServiceUtil
068     * @generated
069     */
070    public class DDMTemplateServiceSoap {
071            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap addTemplate(
072                    long groupId, long classNameId, long classPK,
073                    java.lang.String templateKey, java.lang.String[] nameMapLanguageIds,
074                    java.lang.String[] nameMapValues,
075                    java.lang.String[] descriptionMapLanguageIds,
076                    java.lang.String[] descriptionMapValues, java.lang.String type,
077                    java.lang.String mode, java.lang.String language,
078                    java.lang.String script, boolean cacheable,
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.DDMTemplate returnValue =
088                                    DDMTemplateServiceUtil.addTemplate(groupId, classNameId,
089                                            classPK, templateKey, nameMap, descriptionMap, type, mode,
090                                            language, script, cacheable, serviceContext);
091    
092                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.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.DDMTemplateSoap[] copyTemplates(
102                    long classNameId, long classPK, long newClassPK, java.lang.String type,
103                    com.liferay.portal.service.ServiceContext serviceContext)
104                    throws RemoteException {
105                    try {
106                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
107                                    DDMTemplateServiceUtil.copyTemplates(classNameId, classPK,
108                                            newClassPK, type, serviceContext);
109    
110                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue);
111                    }
112                    catch (Exception e) {
113                            _log.error(e, e);
114    
115                            throw new RemoteException(e.getMessage());
116                    }
117            }
118    
119            public static void deleteTemplate(long templateId)
120                    throws RemoteException {
121                    try {
122                            DDMTemplateServiceUtil.deleteTemplate(templateId);
123                    }
124                    catch (Exception e) {
125                            _log.error(e, e);
126    
127                            throw new RemoteException(e.getMessage());
128                    }
129            }
130    
131            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap fetchTemplate(
132                    long groupId, java.lang.String templateKey) throws RemoteException {
133                    try {
134                            com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue =
135                                    DDMTemplateServiceUtil.fetchTemplate(groupId, templateKey);
136    
137                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue);
138                    }
139                    catch (Exception e) {
140                            _log.error(e, e);
141    
142                            throw new RemoteException(e.getMessage());
143                    }
144            }
145    
146            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap getTemplate(
147                    long templateId) throws RemoteException {
148                    try {
149                            com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue =
150                                    DDMTemplateServiceUtil.getTemplate(templateId);
151    
152                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue);
153                    }
154                    catch (Exception e) {
155                            _log.error(e, e);
156    
157                            throw new RemoteException(e.getMessage());
158                    }
159            }
160    
161            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap getTemplate(
162                    long groupId, java.lang.String templateKey) throws RemoteException {
163                    try {
164                            com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue =
165                                    DDMTemplateServiceUtil.getTemplate(groupId, templateKey);
166    
167                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue);
168                    }
169                    catch (Exception e) {
170                            _log.error(e, e);
171    
172                            throw new RemoteException(e.getMessage());
173                    }
174            }
175    
176            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] getTemplates(
177                    long groupId, long classNameId) throws RemoteException {
178                    try {
179                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
180                                    DDMTemplateServiceUtil.getTemplates(groupId, classNameId);
181    
182                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue);
183                    }
184                    catch (Exception e) {
185                            _log.error(e, e);
186    
187                            throw new RemoteException(e.getMessage());
188                    }
189            }
190    
191            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] getTemplates(
192                    long groupId, long classNameId, long classPK) throws RemoteException {
193                    try {
194                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
195                                    DDMTemplateServiceUtil.getTemplates(groupId, classNameId,
196                                            classPK);
197    
198                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue);
199                    }
200                    catch (Exception e) {
201                            _log.error(e, e);
202    
203                            throw new RemoteException(e.getMessage());
204                    }
205            }
206    
207            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] getTemplates(
208                    long classNameId, long classPK, java.lang.String type,
209                    java.lang.String mode) throws RemoteException {
210                    try {
211                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
212                                    DDMTemplateServiceUtil.getTemplates(classNameId, classPK, type,
213                                            mode);
214    
215                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue);
216                    }
217                    catch (Exception e) {
218                            _log.error(e, e);
219    
220                            throw new RemoteException(e.getMessage());
221                    }
222            }
223    
224            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] search(
225                    long companyId, long groupId, long classNameId, long classPK,
226                    java.lang.String keywords, java.lang.String type,
227                    java.lang.String mode, int start, int end,
228                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
229                    throws RemoteException {
230                    try {
231                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
232                                    DDMTemplateServiceUtil.search(companyId, groupId, classNameId,
233                                            classPK, keywords, type, mode, start, end, orderByComparator);
234    
235                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(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.DDMTemplateSoap[] search(
245                    long companyId, long groupId, long classNameId, long classPK,
246                    java.lang.String name, java.lang.String description,
247                    java.lang.String type, java.lang.String mode,
248                    java.lang.String language, boolean andOperator, int start, int end,
249                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
250                    throws RemoteException {
251                    try {
252                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
253                                    DDMTemplateServiceUtil.search(companyId, groupId, classNameId,
254                                            classPK, name, description, type, mode, language,
255                                            andOperator, start, end, orderByComparator);
256    
257                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue);
258                    }
259                    catch (Exception e) {
260                            _log.error(e, e);
261    
262                            throw new RemoteException(e.getMessage());
263                    }
264            }
265    
266            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] search(
267                    long companyId, long[] groupIds, long[] classNameIds, long classPK,
268                    java.lang.String keywords, java.lang.String type,
269                    java.lang.String mode, int start, int end,
270                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
271                    throws RemoteException {
272                    try {
273                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
274                                    DDMTemplateServiceUtil.search(companyId, groupIds,
275                                            classNameIds, classPK, keywords, type, mode, start, end,
276                                            orderByComparator);
277    
278                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.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.DDMTemplateSoap[] search(
288                    long companyId, long[] groupIds, long[] classNameIds, long classPK,
289                    java.lang.String name, java.lang.String description,
290                    java.lang.String type, java.lang.String mode,
291                    java.lang.String language, boolean andOperator, int start, int end,
292                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
293                    throws RemoteException {
294                    try {
295                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
296                                    DDMTemplateServiceUtil.search(companyId, groupIds,
297                                            classNameIds, classPK, name, description, type, mode,
298                                            language, andOperator, start, end, orderByComparator);
299    
300                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue);
301                    }
302                    catch (Exception e) {
303                            _log.error(e, e);
304    
305                            throw new RemoteException(e.getMessage());
306                    }
307            }
308    
309            public static int searchCount(long companyId, long groupId,
310                    long classNameId, long classPK, java.lang.String keywords,
311                    java.lang.String type, java.lang.String mode) throws RemoteException {
312                    try {
313                            int returnValue = DDMTemplateServiceUtil.searchCount(companyId,
314                                            groupId, classNameId, classPK, keywords, type, mode);
315    
316                            return returnValue;
317                    }
318                    catch (Exception e) {
319                            _log.error(e, e);
320    
321                            throw new RemoteException(e.getMessage());
322                    }
323            }
324    
325            public static int searchCount(long companyId, long groupId,
326                    long classNameId, long classPK, java.lang.String name,
327                    java.lang.String description, java.lang.String type,
328                    java.lang.String mode, java.lang.String language, boolean andOperator)
329                    throws RemoteException {
330                    try {
331                            int returnValue = DDMTemplateServiceUtil.searchCount(companyId,
332                                            groupId, classNameId, classPK, name, description, type,
333                                            mode, language, andOperator);
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, long classPK, java.lang.String keywords,
346                    java.lang.String type, java.lang.String mode) throws RemoteException {
347                    try {
348                            int returnValue = DDMTemplateServiceUtil.searchCount(companyId,
349                                            groupIds, classNameIds, classPK, keywords, type, mode);
350    
351                            return returnValue;
352                    }
353                    catch (Exception e) {
354                            _log.error(e, e);
355    
356                            throw new RemoteException(e.getMessage());
357                    }
358            }
359    
360            public static int searchCount(long companyId, long[] groupIds,
361                    long[] classNameIds, long classPK, java.lang.String name,
362                    java.lang.String description, java.lang.String type,
363                    java.lang.String mode, java.lang.String language, boolean andOperator)
364                    throws RemoteException {
365                    try {
366                            int returnValue = DDMTemplateServiceUtil.searchCount(companyId,
367                                            groupIds, classNameIds, classPK, name, description, type,
368                                            mode, language, andOperator);
369    
370                            return returnValue;
371                    }
372                    catch (Exception e) {
373                            _log.error(e, e);
374    
375                            throw new RemoteException(e.getMessage());
376                    }
377            }
378    
379            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap updateTemplate(
380                    long templateId, java.lang.String[] nameMapLanguageIds,
381                    java.lang.String[] nameMapValues,
382                    java.lang.String[] descriptionMapLanguageIds,
383                    java.lang.String[] descriptionMapValues, java.lang.String type,
384                    java.lang.String mode, java.lang.String language,
385                    java.lang.String script, boolean cacheable,
386                    com.liferay.portal.service.ServiceContext serviceContext)
387                    throws RemoteException {
388                    try {
389                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
390                                            nameMapValues);
391                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
392                                            descriptionMapValues);
393    
394                            com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue =
395                                    DDMTemplateServiceUtil.updateTemplate(templateId, nameMap,
396                                            descriptionMap, type, mode, language, script, cacheable,
397                                            serviceContext);
398    
399                            return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue);
400                    }
401                    catch (Exception e) {
402                            _log.error(e, e);
403    
404                            throw new RemoteException(e.getMessage());
405                    }
406            }
407    
408            private static Log _log = LogFactoryUtil.getLog(DDMTemplateServiceSoap.class);
409    }