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
055     * http://localhost:8080/api/secure/axis. Set the property
056     * <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
057     * security.
058     * </p>
059     *
060     * <p>
061     * The SOAP utility is only generated for remote services.
062     * </p>
063     *
064     * @author    Brian Wing Shun Chan
065     * @see       LayoutPrototypeServiceHttp
066     * @see       com.liferay.portal.model.LayoutPrototypeSoap
067     * @see       com.liferay.portal.service.LayoutPrototypeServiceUtil
068     * @generated
069     */
070    public class LayoutPrototypeServiceSoap {
071            public static com.liferay.portal.model.LayoutPrototypeSoap addLayoutPrototype(
072                    java.lang.String[] nameMapLanguageIds,
073                    java.lang.String[] nameMapValues, java.lang.String description,
074                    boolean active) throws RemoteException {
075                    try {
076                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
077                                            nameMapValues);
078    
079                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap,
080                                            description, active);
081    
082                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
083                    }
084                    catch (Exception e) {
085                            _log.error(e, e);
086    
087                            throw new RemoteException(e.getMessage());
088                    }
089            }
090    
091            public static void deleteLayoutPrototype(long layoutPrototypeId)
092                    throws RemoteException {
093                    try {
094                            LayoutPrototypeServiceUtil.deleteLayoutPrototype(layoutPrototypeId);
095                    }
096                    catch (Exception e) {
097                            _log.error(e, e);
098    
099                            throw new RemoteException(e.getMessage());
100                    }
101            }
102    
103            public static com.liferay.portal.model.LayoutPrototypeSoap getLayoutPrototype(
104                    long layoutPrototypeId) throws RemoteException {
105                    try {
106                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.getLayoutPrototype(layoutPrototypeId);
107    
108                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
109                    }
110                    catch (Exception e) {
111                            _log.error(e, e);
112    
113                            throw new RemoteException(e.getMessage());
114                    }
115            }
116    
117            public static com.liferay.portal.model.LayoutPrototypeSoap[] search(
118                    long companyId, java.lang.Boolean active,
119                    com.liferay.portal.kernel.util.OrderByComparator obc)
120                    throws RemoteException {
121                    try {
122                            java.util.List<com.liferay.portal.model.LayoutPrototype> returnValue =
123                                    LayoutPrototypeServiceUtil.search(companyId, active, obc);
124    
125                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModels(returnValue);
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 updateLayoutPrototype(
135                    long layoutPrototypeId, java.lang.String[] nameMapLanguageIds,
136                    java.lang.String[] nameMapValues, java.lang.String description,
137                    boolean active) throws RemoteException {
138                    try {
139                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
140                                            nameMapValues);
141    
142                            com.liferay.portal.model.LayoutPrototype returnValue = LayoutPrototypeServiceUtil.updateLayoutPrototype(layoutPrototypeId,
143                                            nameMap, description, active);
144    
145                            return com.liferay.portal.model.LayoutPrototypeSoap.toSoapModel(returnValue);
146                    }
147                    catch (Exception e) {
148                            _log.error(e, e);
149    
150                            throw new RemoteException(e.getMessage());
151                    }
152            }
153    
154            private static Log _log = LogFactoryUtil.getLog(LayoutPrototypeServiceSoap.class);
155    }