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.mobiledevicerules.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.mobiledevicerules.service.MDRActionServiceUtil;
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.mobiledevicerules.service.MDRActionServiceUtil} 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.mobiledevicerules.model.MDRActionSoap}.
041     * If the method in the service utility returns a
042     * {@link com.liferay.portlet.mobiledevicerules.model.MDRAction}, that is translated to a
043     * {@link com.liferay.portlet.mobiledevicerules.model.MDRActionSoap}. 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    Edward C. Han
065     * @see       MDRActionServiceHttp
066     * @see       com.liferay.portlet.mobiledevicerules.model.MDRActionSoap
067     * @see       com.liferay.portlet.mobiledevicerules.service.MDRActionServiceUtil
068     * @generated
069     */
070    public class MDRActionServiceSoap {
071            public static com.liferay.portlet.mobiledevicerules.model.MDRActionSoap addAction(
072                    long ruleGroupInstanceId, java.lang.String[] nameMapLanguageIds,
073                    java.lang.String[] nameMapValues,
074                    java.lang.String[] descriptionMapLanguageIds,
075                    java.lang.String[] descriptionMapValues, java.lang.String type,
076                    java.lang.String typeSettings,
077                    com.liferay.portal.service.ServiceContext serviceContext)
078                    throws RemoteException {
079                    try {
080                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
081                                            nameMapValues);
082                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
083                                            descriptionMapValues);
084    
085                            com.liferay.portlet.mobiledevicerules.model.MDRAction returnValue = MDRActionServiceUtil.addAction(ruleGroupInstanceId,
086                                            nameMap, descriptionMap, type, typeSettings, serviceContext);
087    
088                            return com.liferay.portlet.mobiledevicerules.model.MDRActionSoap.toSoapModel(returnValue);
089                    }
090                    catch (Exception e) {
091                            _log.error(e, e);
092    
093                            throw new RemoteException(e.getMessage());
094                    }
095            }
096    
097            public static void deleteAction(long actionId) throws RemoteException {
098                    try {
099                            MDRActionServiceUtil.deleteAction(actionId);
100                    }
101                    catch (Exception e) {
102                            _log.error(e, e);
103    
104                            throw new RemoteException(e.getMessage());
105                    }
106            }
107    
108            public static com.liferay.portlet.mobiledevicerules.model.MDRActionSoap fetchAction(
109                    long actionId) throws RemoteException {
110                    try {
111                            com.liferay.portlet.mobiledevicerules.model.MDRAction returnValue = MDRActionServiceUtil.fetchAction(actionId);
112    
113                            return com.liferay.portlet.mobiledevicerules.model.MDRActionSoap.toSoapModel(returnValue);
114                    }
115                    catch (Exception e) {
116                            _log.error(e, e);
117    
118                            throw new RemoteException(e.getMessage());
119                    }
120            }
121    
122            public static com.liferay.portlet.mobiledevicerules.model.MDRActionSoap getAction(
123                    long actionId) throws RemoteException {
124                    try {
125                            com.liferay.portlet.mobiledevicerules.model.MDRAction returnValue = MDRActionServiceUtil.getAction(actionId);
126    
127                            return com.liferay.portlet.mobiledevicerules.model.MDRActionSoap.toSoapModel(returnValue);
128                    }
129                    catch (Exception e) {
130                            _log.error(e, e);
131    
132                            throw new RemoteException(e.getMessage());
133                    }
134            }
135    
136            public static com.liferay.portlet.mobiledevicerules.model.MDRActionSoap updateAction(
137                    long actionId, java.lang.String[] nameMapLanguageIds,
138                    java.lang.String[] nameMapValues,
139                    java.lang.String[] descriptionMapLanguageIds,
140                    java.lang.String[] descriptionMapValues, java.lang.String type,
141                    java.lang.String typeSettings,
142                    com.liferay.portal.service.ServiceContext serviceContext)
143                    throws RemoteException {
144                    try {
145                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
146                                            nameMapValues);
147                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
148                                            descriptionMapValues);
149    
150                            com.liferay.portlet.mobiledevicerules.model.MDRAction returnValue = MDRActionServiceUtil.updateAction(actionId,
151                                            nameMap, descriptionMap, type, typeSettings, serviceContext);
152    
153                            return com.liferay.portlet.mobiledevicerules.model.MDRActionSoap.toSoapModel(returnValue);
154                    }
155                    catch (Exception e) {
156                            _log.error(e, e);
157    
158                            throw new RemoteException(e.getMessage());
159                    }
160            }
161    
162            private static Log _log = LogFactoryUtil.getLog(MDRActionServiceSoap.class);
163    }