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 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            /**
072            * @deprecated As of 6.2.0, replaced by {@link #addLayoutPrototype(Map,
073            String, boolean, ServiceContext)}
074            */
075            public static com.liferay.portal.model.LayoutPrototypeSoap addLayoutPrototype(
076                    java.lang.String[] nameMapLanguageIds,
077                    java.lang.String[] nameMapValues, java.lang.String description,
078                    boolean active) throws RemoteException {
079                    try {
080                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
081                                            nameMapValues);
082    
083                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
084                                            description, active);
085    
086                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
087                    }
088                    catch (Exception e) {
089                            _log.error(e, e);
090    
091                            throw new RemoteException(e.getMessage());
092                    }
093            }
094    
095            public static com.liferay.portal.model.LayoutPrototypeSoap addLayoutPrototype(
096                    java.lang.String[] nameMapLanguageIds,
097                    java.lang.String[] nameMapValues, java.lang.String description,
098                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
099                    throws RemoteException {
100                    try {
101                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
102                                            nameMapValues);
103    
104                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
105                                            description, active, serviceContext);
106    
107                            return com.liferay.portal.model.LayoutPrototypeSoap.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 deleteLayoutPrototype(long layoutPrototypeId)
117                    throws RemoteException {
118                    try {
119                            LayoutPrototypeServiceUtil.deleteLayoutPrototype(layoutPrototypeId);
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.portal.model.LayoutPrototypeSoap getLayoutPrototype(
129                    long layoutPrototypeId) throws RemoteException {
130                    try {
131                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.getLayoutPrototype(layoutPrototypeId);
132    
133                            return com.liferay.portal.model.LayoutPrototypeSoap.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.portal.model.LayoutPrototypeSoap[] search(
143                    long companyId, java.lang.Boolean active,
144                    com.liferay.portal.kernel.util.OrderByComparator obc)
145                    throws RemoteException {
146                    try {
147                            java.util.List<com.liferay.portal.model.LayoutPrototype> returnValue =
148                                    LayoutPrototypeServiceUtil.search(companyId, active, obc);
149    
150                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModels(returnValue);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            /**
160            * @deprecated As of 6.2.0, replaced by {@link #updateLayoutPrototype(long,
161            Map, String, boolean, ServiceContext)}
162            */
163            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
164                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
165                    java.lang.String[] nameMapValues, java.lang.String description,
166                    boolean active) throws RemoteException {
167                    try {
168                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
169                                            nameMapValues);
170    
171                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
172                                            nameMap, description, active);
173    
174                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
175                    }
176                    catch (Exception e) {
177                            _log.error(e, e);
178    
179                            throw new RemoteException(e.getMessage());
180                    }
181            }
182    
183            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
184                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
185                    java.lang.String[] nameMapValues, java.lang.String description,
186                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
187                    throws RemoteException {
188                    try {
189                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
190                                            nameMapValues);
191    
192                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
193                                            nameMap, description, 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            private static Log _log = LogFactoryUtil.getLog(LayoutPrototypeServiceSoap.class);
205    }