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 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 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 7.0.0, replaced by {@link #addLayoutPrototype(Map, Map,
098            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, com.liferay.portal.service.ServiceContext serviceContext)
105                    throws RemoteException {
106                    try {
107                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
108                                            nameMapValues);
109    
110                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
111                                            description, active, serviceContext);
112    
113                            return com.liferay.portal.model.LayoutPrototypeSoap.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 void deleteLayoutPrototype(long layoutPrototypeId)
123                    throws RemoteException {
124                    try {
125                            LayoutPrototypeServiceUtil.deleteLayoutPrototype(layoutPrototypeId);
126                    }
127                    catch (Exception e) {
128                            _log.error(e, e);
129    
130                            throw new RemoteException(e.getMessage());
131                    }
132            }
133    
134            public static com.liferay.portal.model.LayoutPrototypeSoap fetchLayoutPrototype(
135                    long layoutPrototypeId) throws RemoteException {
136                    try {
137                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.fetchLayoutPrototype(layoutPrototypeId);
138    
139                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
140                    }
141                    catch (Exception e) {
142                            _log.error(e, e);
143    
144                            throw new RemoteException(e.getMessage());
145                    }
146            }
147    
148            public static com.liferay.portal.model.LayoutPrototypeSoap getLayoutPrototype(
149                    long layoutPrototypeId) throws RemoteException {
150                    try {
151                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.getLayoutPrototype(layoutPrototypeId);
152    
153                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
154                    }
155                    catch (Exception e) {
156                            _log.error(e, e);
157    
158                            throw new RemoteException(e.getMessage());
159                    }
160            }
161    
162            public static com.liferay.portal.model.LayoutPrototypeSoap[] search(
163                    long companyId, java.lang.Boolean active,
164                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.LayoutPrototype> obc)
165                    throws RemoteException {
166                    try {
167                            java.util.List<com.liferay.portal.model.LayoutPrototype> returnValue =
168                                    LayoutPrototypeServiceUtil.search(companyId, active, obc);
169    
170                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModels(returnValue);
171                    }
172                    catch (Exception e) {
173                            _log.error(e, e);
174    
175                            throw new RemoteException(e.getMessage());
176                    }
177            }
178    
179            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
180                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
181                    java.lang.String[] nameMapValues,
182                    java.lang.String[] descriptionMapLanguageIds,
183                    java.lang.String[] descriptionMapValues, boolean active,
184                    com.liferay.portal.service.ServiceContext serviceContext)
185                    throws RemoteException {
186                    try {
187                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
188                                            nameMapValues);
189                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
190                                            descriptionMapValues);
191    
192                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
193                                            nameMap, descriptionMap, active, serviceContext);
194    
195                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
196                    }
197                    catch (Exception e) {
198                            _log.error(e, e);
199    
200                            throw new RemoteException(e.getMessage());
201                    }
202            }
203    
204            /**
205            * @deprecated As of 7.0.0, replaced by {@link #updateLayoutPrototype(long,
206            Map, Map, boolean, ServiceContext)}
207            */
208            @Deprecated
209            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
210                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
211                    java.lang.String[] nameMapValues, java.lang.String description,
212                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
213                    throws RemoteException {
214                    try {
215                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
216                                            nameMapValues);
217    
218                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
219                                            nameMap, description, active, serviceContext);
220    
221                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
222                    }
223                    catch (Exception e) {
224                            _log.error(e, e);
225    
226                            throw new RemoteException(e.getMessage());
227                    }
228            }
229    
230            private static Log _log = LogFactoryUtil.getLog(LayoutPrototypeServiceSoap.class);
231    }