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     * Provides the SOAP utility for the
029     * {@link com.liferay.portal.service.LayoutPrototypeServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it is difficult for SOAP to
032     * support certain types.
033     *
034     * <p>
035     * ServiceBuilder follows certain rules in translating the methods. For example,
036     * if the method in the service utility returns a {@link java.util.List}, that
037     * is translated to an array of {@link com.liferay.portal.model.LayoutPrototypeSoap}.
038     * If the method in the service utility returns a
039     * {@link com.liferay.portal.model.LayoutPrototype}, that is translated to a
040     * {@link com.liferay.portal.model.LayoutPrototypeSoap}. Methods that SOAP cannot
041     * safely wire are skipped.
042     * </p>
043     *
044     * <p>
045     * The benefits of using the SOAP utility is that it is cross platform
046     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
047     * even Perl, to call the generated services. One drawback of SOAP is that it is
048     * slow because it needs to serialize all calls into a text format (XML).
049     * </p>
050     *
051     * <p>
052     * You can see a list of services at http://localhost:8080/api/axis. Set the
053     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
054     * security.
055     * </p>
056     *
057     * <p>
058     * The SOAP utility is only generated for remote services.
059     * </p>
060     *
061     * @author Brian Wing Shun Chan
062     * @see LayoutPrototypeServiceHttp
063     * @see com.liferay.portal.model.LayoutPrototypeSoap
064     * @see com.liferay.portal.service.LayoutPrototypeServiceUtil
065     * @generated
066     */
067    public class LayoutPrototypeServiceSoap {
068            /**
069            * @deprecated As of 6.2.0, replaced by {@link #addLayoutPrototype(Map,
070            String, boolean, ServiceContext)}
071            */
072            public static com.liferay.portal.model.LayoutPrototypeSoap addLayoutPrototype(
073                    java.lang.String[] nameMapLanguageIds,
074                    java.lang.String[] nameMapValues, java.lang.String description,
075                    boolean active) throws RemoteException {
076                    try {
077                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
078                                            nameMapValues);
079    
080                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
081                                            description, active);
082    
083                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
084                    }
085                    catch (Exception e) {
086                            _log.error(e, e);
087    
088                            throw new RemoteException(e.getMessage());
089                    }
090            }
091    
092            public static com.liferay.portal.model.LayoutPrototypeSoap addLayoutPrototype(
093                    java.lang.String[] nameMapLanguageIds,
094                    java.lang.String[] nameMapValues, java.lang.String description,
095                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
096                    throws RemoteException {
097                    try {
098                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
099                                            nameMapValues);
100    
101                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
102                                            description, active, serviceContext);
103    
104                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
105                    }
106                    catch (Exception e) {
107                            _log.error(e, e);
108    
109                            throw new RemoteException(e.getMessage());
110                    }
111            }
112    
113            public static void deleteLayoutPrototype(long layoutPrototypeId)
114                    throws RemoteException {
115                    try {
116                            LayoutPrototypeServiceUtil.deleteLayoutPrototype(layoutPrototypeId);
117                    }
118                    catch (Exception e) {
119                            _log.error(e, e);
120    
121                            throw new RemoteException(e.getMessage());
122                    }
123            }
124    
125            public static com.liferay.portal.model.LayoutPrototypeSoap getLayoutPrototype(
126                    long layoutPrototypeId) throws RemoteException {
127                    try {
128                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.getLayoutPrototype(layoutPrototypeId);
129    
130                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
131                    }
132                    catch (Exception e) {
133                            _log.error(e, e);
134    
135                            throw new RemoteException(e.getMessage());
136                    }
137            }
138    
139            public static com.liferay.portal.model.LayoutPrototypeSoap[] search(
140                    long companyId, java.lang.Boolean active,
141                    com.liferay.portal.kernel.util.OrderByComparator obc)
142                    throws RemoteException {
143                    try {
144                            java.util.List<com.liferay.portal.model.LayoutPrototype> returnValue =
145                                    LayoutPrototypeServiceUtil.search(companyId, active, obc);
146    
147                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModels(returnValue);
148                    }
149                    catch (Exception e) {
150                            _log.error(e, e);
151    
152                            throw new RemoteException(e.getMessage());
153                    }
154            }
155    
156            /**
157            * @deprecated As of 6.2.0, replaced by {@link #updateLayoutPrototype(long,
158            Map, String, boolean, ServiceContext)}
159            */
160            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
161                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
162                    java.lang.String[] nameMapValues, java.lang.String description,
163                    boolean active) throws RemoteException {
164                    try {
165                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
166                                            nameMapValues);
167    
168                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
169                                            nameMap, description, active);
170    
171                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
172                    }
173                    catch (Exception e) {
174                            _log.error(e, e);
175    
176                            throw new RemoteException(e.getMessage());
177                    }
178            }
179    
180            public static com.liferay.portal.model.LayoutPrototypeSoap updateLayoutPrototype(
181                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
182                    java.lang.String[] nameMapValues, java.lang.String description,
183                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
184                    throws RemoteException {
185                    try {
186                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
187                                            nameMapValues);
188    
189                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
190                                            nameMap, description, active, serviceContext);
191    
192                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
193                    }
194                    catch (Exception e) {
195                            _log.error(e, e);
196    
197                            throw new RemoteException(e.getMessage());
198                    }
199            }
200    
201            private static Log _log = LogFactoryUtil.getLog(LayoutPrototypeServiceSoap.class);
202    }