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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.LocalizationUtil;
022    
023    import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupServiceUtil;
024    
025    import java.rmi.RemoteException;
026    
027    import java.util.Locale;
028    import java.util.Map;
029    
030    /**
031     * Provides the SOAP utility for the
032     * {@link com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupServiceUtil} service utility. The
033     * static methods of this class calls the same methods of the service utility.
034     * However, the signatures are different because it is difficult for SOAP to
035     * support certain types.
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    @ProviderType
071    public class MDRRuleGroupServiceSoap {
072            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap addRuleGroup(
073                    long groupId, java.lang.String[] nameMapLanguageIds,
074                    java.lang.String[] nameMapValues,
075                    java.lang.String[] descriptionMapLanguageIds,
076                    java.lang.String[] descriptionMapValues,
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.MDRRuleGroup returnValue =
086                                    MDRRuleGroupServiceUtil.addRuleGroup(groupId, nameMap,
087                                            descriptionMap, serviceContext);
088    
089                            return com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap.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 com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap copyRuleGroup(
099                    long ruleGroupId, long groupId,
100                    com.liferay.portal.service.ServiceContext serviceContext)
101                    throws RemoteException {
102                    try {
103                            com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup returnValue =
104                                    MDRRuleGroupServiceUtil.copyRuleGroup(ruleGroupId, groupId,
105                                            serviceContext);
106    
107                            return com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap.toSoapModel(returnValue);
108                    }
109                    catch (Exception e) {
110                            _log.error(e, e);
111    
112                            throw new RemoteException(e.getMessage());
113                    }
114            }
115    
116            public static void deleteRuleGroup(long ruleGroupId)
117                    throws RemoteException {
118                    try {
119                            MDRRuleGroupServiceUtil.deleteRuleGroup(ruleGroupId);
120                    }
121                    catch (Exception e) {
122                            _log.error(e, e);
123    
124                            throw new RemoteException(e.getMessage());
125                    }
126            }
127    
128            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap fetchRuleGroup(
129                    long ruleGroupId) throws RemoteException {
130                    try {
131                            com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup returnValue =
132                                    MDRRuleGroupServiceUtil.fetchRuleGroup(ruleGroupId);
133    
134                            return com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap.toSoapModel(returnValue);
135                    }
136                    catch (Exception e) {
137                            _log.error(e, e);
138    
139                            throw new RemoteException(e.getMessage());
140                    }
141            }
142    
143            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap getRuleGroup(
144                    long ruleGroupId) throws RemoteException {
145                    try {
146                            com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup returnValue =
147                                    MDRRuleGroupServiceUtil.getRuleGroup(ruleGroupId);
148    
149                            return com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap.toSoapModel(returnValue);
150                    }
151                    catch (Exception e) {
152                            _log.error(e, e);
153    
154                            throw new RemoteException(e.getMessage());
155                    }
156            }
157    
158            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap updateRuleGroup(
159                    long ruleGroupId, java.lang.String[] nameMapLanguageIds,
160                    java.lang.String[] nameMapValues,
161                    java.lang.String[] descriptionMapLanguageIds,
162                    java.lang.String[] descriptionMapValues,
163                    com.liferay.portal.service.ServiceContext serviceContext)
164                    throws RemoteException {
165                    try {
166                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
167                                            nameMapValues);
168                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
169                                            descriptionMapValues);
170    
171                            com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup returnValue =
172                                    MDRRuleGroupServiceUtil.updateRuleGroup(ruleGroupId, nameMap,
173                                            descriptionMap, serviceContext);
174    
175                            return com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap.toSoapModel(returnValue);
176                    }
177                    catch (Exception e) {
178                            _log.error(e, e);
179    
180                            throw new RemoteException(e.getMessage());
181                    }
182            }
183    
184            private static Log _log = LogFactoryUtil.getLog(MDRRuleGroupServiceSoap.class);
185    }