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.service.WebsiteServiceUtil;
020    
021    import java.rmi.RemoteException;
022    
023    /**
024     * Provides the SOAP utility for the
025     * {@link com.liferay.portal.service.WebsiteServiceUtil} service utility. The
026     * static methods of this class calls the same methods of the service utility.
027     * However, the signatures are different because it is difficult for SOAP to
028     * support certain types.
029     *
030     * <p>
031     * ServiceBuilder follows certain rules in translating the methods. For example,
032     * if the method in the service utility returns a {@link java.util.List}, that
033     * is translated to an array of {@link com.liferay.portal.model.WebsiteSoap}.
034     * If the method in the service utility returns a
035     * {@link com.liferay.portal.model.Website}, that is translated to a
036     * {@link com.liferay.portal.model.WebsiteSoap}. Methods that SOAP cannot
037     * safely wire are skipped.
038     * </p>
039     *
040     * <p>
041     * The benefits of using the SOAP utility is that it is cross platform
042     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
043     * even Perl, to call the generated services. One drawback of SOAP is that it is
044     * slow because it needs to serialize all calls into a text format (XML).
045     * </p>
046     *
047     * <p>
048     * You can see a list of services at http://localhost:8080/api/axis. Set the
049     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
050     * security.
051     * </p>
052     *
053     * <p>
054     * The SOAP utility is only generated for remote services.
055     * </p>
056     *
057     * @author Brian Wing Shun Chan
058     * @see WebsiteServiceHttp
059     * @see com.liferay.portal.model.WebsiteSoap
060     * @see com.liferay.portal.service.WebsiteServiceUtil
061     * @generated
062     */
063    public class WebsiteServiceSoap {
064            /**
065            * @deprecated As of 6.2.0, replaced by {@link #addWebsite( String, long,
066            String, int, boolean, ServiceContext)}
067            */
068            public static com.liferay.portal.model.WebsiteSoap addWebsite(
069                    java.lang.String className, long classPK, java.lang.String url,
070                    int typeId, boolean primary) throws RemoteException {
071                    try {
072                            com.liferay.portal.model.Website returnValue = WebsiteServiceUtil.addWebsite(className,
073                                            classPK, url, typeId, primary);
074    
075                            return com.liferay.portal.model.WebsiteSoap.toSoapModel(returnValue);
076                    }
077                    catch (Exception e) {
078                            _log.error(e, e);
079    
080                            throw new RemoteException(e.getMessage());
081                    }
082            }
083    
084            public static com.liferay.portal.model.WebsiteSoap addWebsite(
085                    java.lang.String className, long classPK, java.lang.String url,
086                    int typeId, boolean primary,
087                    com.liferay.portal.service.ServiceContext serviceContext)
088                    throws RemoteException {
089                    try {
090                            com.liferay.portal.model.Website returnValue = WebsiteServiceUtil.addWebsite(className,
091                                            classPK, url, typeId, primary, serviceContext);
092    
093                            return com.liferay.portal.model.WebsiteSoap.toSoapModel(returnValue);
094                    }
095                    catch (Exception e) {
096                            _log.error(e, e);
097    
098                            throw new RemoteException(e.getMessage());
099                    }
100            }
101    
102            public static void deleteWebsite(long websiteId) throws RemoteException {
103                    try {
104                            WebsiteServiceUtil.deleteWebsite(websiteId);
105                    }
106                    catch (Exception e) {
107                            _log.error(e, e);
108    
109                            throw new RemoteException(e.getMessage());
110                    }
111            }
112    
113            public static com.liferay.portal.model.WebsiteSoap getWebsite(
114                    long websiteId) throws RemoteException {
115                    try {
116                            com.liferay.portal.model.Website returnValue = WebsiteServiceUtil.getWebsite(websiteId);
117    
118                            return com.liferay.portal.model.WebsiteSoap.toSoapModel(returnValue);
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.WebsiteSoap[] getWebsites(
128                    java.lang.String className, long classPK) throws RemoteException {
129                    try {
130                            java.util.List<com.liferay.portal.model.Website> returnValue = WebsiteServiceUtil.getWebsites(className,
131                                            classPK);
132    
133                            return com.liferay.portal.model.WebsiteSoap.toSoapModels(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.WebsiteSoap updateWebsite(
143                    long websiteId, java.lang.String url, int typeId, boolean primary)
144                    throws RemoteException {
145                    try {
146                            com.liferay.portal.model.Website returnValue = WebsiteServiceUtil.updateWebsite(websiteId,
147                                            url, typeId, primary);
148    
149                            return com.liferay.portal.model.WebsiteSoap.toSoapModel(returnValue);
150                    }
151                    catch (Exception e) {
152                            _log.error(e, e);
153    
154                            throw new RemoteException(e.getMessage());
155                    }
156            }
157    
158            private static Log _log = LogFactoryUtil.getLog(WebsiteServiceSoap.class);
159    }