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.MDRRuleGroupServiceUtil;
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.MDRRuleGroupServiceUtil} 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.MDRRuleGroupSoap}.
041     * If the method in the service utility returns a
042     * {@link com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup}, that is translated to a
043     * {@link com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap}. 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       MDRRuleGroupServiceHttp
066     * @see       com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap
067     * @see       com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupServiceUtil
068     * @generated
069     */
070    public class MDRRuleGroupServiceSoap {
071            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap addRuleGroup(
072                    long groupId, java.lang.String[] nameMapLanguageIds,
073                    java.lang.String[] nameMapValues,
074                    java.lang.String[] descriptionMapLanguageIds,
075                    java.lang.String[] descriptionMapValues,
076                    com.liferay.portal.service.ServiceContext serviceContext)
077                    throws RemoteException {
078                    try {
079                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
080                                            nameMapValues);
081                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
082                                            descriptionMapValues);
083    
084                            com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup returnValue =
085                                    MDRRuleGroupServiceUtil.addRuleGroup(groupId, nameMap,
086                                            descriptionMap, serviceContext);
087    
088                            return com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap.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 com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap copyRuleGroup(
098                    long ruleGroupId, long groupId,
099                    com.liferay.portal.service.ServiceContext serviceContext)
100                    throws RemoteException {
101                    try {
102                            com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup returnValue =
103                                    MDRRuleGroupServiceUtil.copyRuleGroup(ruleGroupId, groupId,
104                                            serviceContext);
105    
106                            return com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap.toSoapModel(returnValue);
107                    }
108                    catch (Exception e) {
109                            _log.error(e, e);
110    
111                            throw new RemoteException(e.getMessage());
112                    }
113            }
114    
115            public static void deleteRuleGroup(long ruleGroupId)
116                    throws RemoteException {
117                    try {
118                            MDRRuleGroupServiceUtil.deleteRuleGroup(ruleGroupId);
119                    }
120                    catch (Exception e) {
121                            _log.error(e, e);
122    
123                            throw new RemoteException(e.getMessage());
124                    }
125            }
126    
127            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap fetchRuleGroup(
128                    long ruleGroupId) throws RemoteException {
129                    try {
130                            com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup returnValue =
131                                    MDRRuleGroupServiceUtil.fetchRuleGroup(ruleGroupId);
132    
133                            return com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap.toSoapModel(returnValue);
134                    }
135                    catch (Exception e) {
136                            _log.error(e, e);
137    
138                            throw new RemoteException(e.getMessage());
139                    }
140            }
141    
142            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap getRuleGroup(
143                    long ruleGroupId) throws RemoteException {
144                    try {
145                            com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup returnValue =
146                                    MDRRuleGroupServiceUtil.getRuleGroup(ruleGroupId);
147    
148                            return com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap.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.mobiledevicerules.model.MDRRuleGroupSoap updateRuleGroup(
158                    long ruleGroupId, 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.mobiledevicerules.model.MDRRuleGroup returnValue =
171                                    MDRRuleGroupServiceUtil.updateRuleGroup(ruleGroupId, nameMap,
172                                            descriptionMap, serviceContext);
173    
174                            return com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap.toSoapModel(returnValue);
175                    }
176                    catch (Exception e) {
177                            _log.error(e, e);
178    
179                            throw new RemoteException(e.getMessage());
180                    }
181            }
182    
183            private static Log _log = LogFactoryUtil.getLog(MDRRuleGroupServiceSoap.class);
184    }