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