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.portal.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    import com.liferay.portal.service.LayoutPrototypeServiceUtil;
021    
022    import java.rmi.RemoteException;
023    
024    import java.util.Locale;
025    import java.util.Map;
026    
027    /**
028     * <p>
029     * This class provides a SOAP utility for the
030     * {@link com.liferay.portal.service.LayoutPrototypeServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it is difficult for SOAP to
033     * support certain types.
034     * </p>
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    public class LayoutPrototypeServiceSoap {
070            /**
071            * @deprecated As of 6.2.0, replaced by {@link #addLayoutPrototype(long,
072            Map, String, boolean, ServiceContext)}
073            */
074            public static com.liferay.portal.model.LayoutPrototypeSoap addLayoutPrototype(
075                    java.lang.String[] nameMapLanguageIds,
076                    java.lang.String[] nameMapValues, java.lang.String description,
077                    boolean active) throws RemoteException {
078                    try {
079                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
080                                            nameMapValues);
081    
082                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
083                                            description, active);
084    
085                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
086                    }
087                    catch (Exception e) {
088                            _log.error(e, e);
089    
090                            throw new RemoteException(e.getMessage());
091                    }
092            }
093    
094            public static com.liferay.portal.model.LayoutPrototypeSoap addLayoutPrototype(
095                    java.lang.String[] nameMapLanguageIds,
096                    java.lang.String[] nameMapValues, java.lang.String description,
097                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
098                    throws RemoteException {
099                    try {
100                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
101                                            nameMapValues);
102    
103                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
104                                            description, active, serviceContext);
105    
106                            return com.liferay.portal.model.LayoutPrototypeSoap.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 deleteLayoutPrototype(long layoutPrototypeId)
116                    throws RemoteException {
117                    try {
118                            LayoutPrototypeServiceUtil.deleteLayoutPrototype(layoutPrototypeId);
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.portal.model.LayoutPrototypeSoap getLayoutPrototype(
128                    long layoutPrototypeId) throws RemoteException {
129                    try {
130                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.getLayoutPrototype(layoutPrototypeId);
131    
132                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
133                    }
134                    catch (Exception e) {
135                            _log.error(e, e);
136    
137                            throw new RemoteException(e.getMessage());
138                    }
139            }
140    
141            public static com.liferay.portal.model.LayoutPrototypeSoap[] search(
142                    long companyId, java.lang.Boolean active,
143                    com.liferay.portal.kernel.util.OrderByComparator obc)
144                    throws RemoteException {
145                    try {
146                            java.util.List<com.liferay.portal.model.LayoutPrototype> returnValue =
147                                    LayoutPrototypeServiceUtil.search(companyId, active, obc);
148    
149                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModels(returnValue);
150                    }
151                    catch (Exception e) {
152                            _log.error(e, e);
153    
154                            throw new RemoteException(e.getMessage());
155                    }
156            }
157    
158            /**
159            * @deprecated As of 6.2.0, replaced by {@link #updateLayoutPrototype(long,
160            Map, String, boolean, ServiceContext)}
161            */
162            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
163                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
164                    java.lang.String[] nameMapValues, java.lang.String description,
165                    boolean active) throws RemoteException {
166                    try {
167                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
168                                            nameMapValues);
169    
170                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
171                                            nameMap, description, active);
172    
173                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
174                    }
175                    catch (Exception e) {
176                            _log.error(e, e);
177    
178                            throw new RemoteException(e.getMessage());
179                    }
180            }
181    
182            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
183                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
184                    java.lang.String[] nameMapValues, java.lang.String description,
185                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
186                    throws RemoteException {
187                    try {
188                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
189                                            nameMapValues);
190    
191                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
192                                            nameMap, description, active, serviceContext);
193    
194                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
195                    }
196                    catch (Exception e) {
197                            _log.error(e, e);
198    
199                            throw new RemoteException(e.getMessage());
200                    }
201            }
202    
203            private static Log _log = LogFactoryUtil.getLog(LayoutPrototypeServiceSoap.class);
204    }