001    /**
002     * Copyright (c) 2000-present 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.portal.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    import com.liferay.portal.service.LayoutPrototypeServiceUtil;
023    
024    import java.rmi.RemoteException;
025    
026    import java.util.Locale;
027    import java.util.Map;
028    
029    /**
030     * Provides the SOAP utility for the
031     * {@link com.liferay.portal.service.LayoutPrototypeServiceUtil} 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     *
036     * <p>
037     * ServiceBuilder follows certain rules in translating the methods. For example,
038     * if the method in the service utility returns a {@link java.util.List}, that
039     * is translated to an array of {@link com.liferay.portal.model.LayoutPrototypeSoap}.
040     * If the method in the service utility returns a
041     * {@link com.liferay.portal.model.LayoutPrototype}, that is translated to a
042     * {@link com.liferay.portal.model.LayoutPrototypeSoap}. Methods that SOAP cannot
043     * safely wire are skipped.
044     * </p>
045     *
046     * <p>
047     * The benefits of using the SOAP utility is that it is cross platform
048     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
049     * even Perl, to call the generated services. One drawback of SOAP is that it is
050     * slow because it needs to serialize all calls into a text format (XML).
051     * </p>
052     *
053     * <p>
054     * You can see a list of services at http://localhost:8080/api/axis. Set the
055     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
056     * security.
057     * </p>
058     *
059     * <p>
060     * The SOAP utility is only generated for remote services.
061     * </p>
062     *
063     * @author Brian Wing Shun Chan
064     * @see LayoutPrototypeServiceHttp
065     * @see com.liferay.portal.model.LayoutPrototypeSoap
066     * @see com.liferay.portal.service.LayoutPrototypeServiceUtil
067     * @generated
068     */
069    @ProviderType
070    public class LayoutPrototypeServiceSoap {
071            public static com.liferay.portal.model.LayoutPrototypeSoap addLayoutPrototype(
072                    java.lang.String[] nameMapLanguageIds,
073                    java.lang.String[] nameMapValues,
074                    java.lang.String[] descriptionMapLanguageIds,
075                    java.lang.String[] descriptionMapValues, boolean active,
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.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
085                                            descriptionMap, active, serviceContext);
086    
087                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
088                    }
089                    catch (Exception e) {
090                            _log.error(e, e);
091    
092                            throw new RemoteException(e.getMessage());
093                    }
094            }
095    
096            /**
097            * @deprecated As of 6.2.0, replaced by {@link #addLayoutPrototype(Map,
098            String, boolean, ServiceContext)}
099            */
100            @Deprecated
101            public static com.liferay.portal.model.LayoutPrototypeSoap addLayoutPrototype(
102                    java.lang.String[] nameMapLanguageIds,
103                    java.lang.String[] nameMapValues, java.lang.String description,
104                    boolean active) throws RemoteException {
105                    try {
106                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
107                                            nameMapValues);
108    
109                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
110                                            description, active);
111    
112                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
113                    }
114                    catch (Exception e) {
115                            _log.error(e, e);
116    
117                            throw new RemoteException(e.getMessage());
118                    }
119            }
120    
121            /**
122            * @deprecated As of 7.0.0, replaced by {@link #addLayoutPrototype(Map, Map,
123            boolean, ServiceContext)}
124            */
125            @Deprecated
126            public static com.liferay.portal.model.LayoutPrototypeSoap addLayoutPrototype(
127                    java.lang.String[] nameMapLanguageIds,
128                    java.lang.String[] nameMapValues, java.lang.String description,
129                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
130                    throws RemoteException {
131                    try {
132                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
133                                            nameMapValues);
134    
135                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
136                                            description, active, serviceContext);
137    
138                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
139                    }
140                    catch (Exception e) {
141                            _log.error(e, e);
142    
143                            throw new RemoteException(e.getMessage());
144                    }
145            }
146    
147            public static void deleteLayoutPrototype(long layoutPrototypeId)
148                    throws RemoteException {
149                    try {
150                            LayoutPrototypeServiceUtil.deleteLayoutPrototype(layoutPrototypeId);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            public static com.liferay.portal.model.LayoutPrototypeSoap getLayoutPrototype(
160                    long layoutPrototypeId) throws RemoteException {
161                    try {
162                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.getLayoutPrototype(layoutPrototypeId);
163    
164                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
165                    }
166                    catch (Exception e) {
167                            _log.error(e, e);
168    
169                            throw new RemoteException(e.getMessage());
170                    }
171            }
172    
173            public static com.liferay.portal.model.LayoutPrototypeSoap[] search(
174                    long companyId, java.lang.Boolean active,
175                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.LayoutPrototype> obc)
176                    throws RemoteException {
177                    try {
178                            java.util.List<com.liferay.portal.model.LayoutPrototype> returnValue =
179                                    LayoutPrototypeServiceUtil.search(companyId, active, obc);
180    
181                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModels(returnValue);
182                    }
183                    catch (Exception e) {
184                            _log.error(e, e);
185    
186                            throw new RemoteException(e.getMessage());
187                    }
188            }
189    
190            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
191                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
192                    java.lang.String[] nameMapValues,
193                    java.lang.String[] descriptionMapLanguageIds,
194                    java.lang.String[] descriptionMapValues, boolean active,
195                    com.liferay.portal.service.ServiceContext serviceContext)
196                    throws RemoteException {
197                    try {
198                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
199                                            nameMapValues);
200                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
201                                            descriptionMapValues);
202    
203                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
204                                            nameMap, descriptionMap, active, serviceContext);
205    
206                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
207                    }
208                    catch (Exception e) {
209                            _log.error(e, e);
210    
211                            throw new RemoteException(e.getMessage());
212                    }
213            }
214    
215            /**
216            * @deprecated As of 6.2.0, replaced by {@link #updateLayoutPrototype(long,
217            Map, String, boolean, ServiceContext)}
218            */
219            @Deprecated
220            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
221                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
222                    java.lang.String[] nameMapValues, java.lang.String description,
223                    boolean active) throws RemoteException {
224                    try {
225                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
226                                            nameMapValues);
227    
228                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
229                                            nameMap, description, active);
230    
231                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
232                    }
233                    catch (Exception e) {
234                            _log.error(e, e);
235    
236                            throw new RemoteException(e.getMessage());
237                    }
238            }
239    
240            /**
241            * @deprecated As of 7.0.0, replaced by {@link #updateLayoutPrototype(long,
242            Map, Map, boolean, ServiceContext)}
243            */
244            @Deprecated
245            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
246                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
247                    java.lang.String[] nameMapValues, java.lang.String description,
248                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
249                    throws RemoteException {
250                    try {
251                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
252                                            nameMapValues);
253    
254                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
255                                            nameMap, description, active, serviceContext);
256    
257                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
258                    }
259                    catch (Exception e) {
260                            _log.error(e, e);
261    
262                            throw new RemoteException(e.getMessage());
263                    }
264            }
265    
266            private static Log _log = LogFactoryUtil.getLog(LayoutPrototypeServiceSoap.class);
267    }