1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.messageboards.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  
20  import com.liferay.portlet.messageboards.service.MBCategoryServiceUtil;
21  
22  import java.rmi.RemoteException;
23  
24  /**
25   * <a href="MBCategoryServiceSoap.java.html"><b><i>View Source</i></b></a>
26   *
27   * <p>
28   * ServiceBuilder generated this class. Modifications in this class will be
29   * overwritten the next time is generated.
30   * </p>
31   *
32   * <p>
33   * This class provides a SOAP utility for the
34   * {@link com.liferay.portlet.messageboards.service.MBCategoryServiceUtil} service utility. The
35   * static methods of this class calls the same methods of the service utility.
36   * However, the signatures are different because it is difficult for SOAP to
37   * support certain types.
38   * </p>
39   *
40   * <p>
41   * ServiceBuilder follows certain rules in translating the methods. For example,
42   * if the method in the service utility returns a {@link java.util.List}, that
43   * is translated to an array of {@link com.liferay.portlet.messageboards.model.MBCategorySoap}.
44   * If the method in the service utility returns a
45   * {@link com.liferay.portlet.messageboards.model.MBCategory}, that is translated to a
46   * {@link com.liferay.portlet.messageboards.model.MBCategorySoap}. Methods that SOAP cannot
47   * safely wire are skipped.
48   * </p>
49   *
50   * <p>
51   * The benefits of using the SOAP utility is that it is cross platform
52   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
53   * even Perl, to call the generated services. One drawback of SOAP is that it is
54   * slow because it needs to serialize all calls into a text format (XML).
55   * </p>
56   *
57   * <p>
58   * You can see a list of services at
59   * http://localhost:8080/tunnel-web/secure/axis. Set the property
60   * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
61   * security.
62   * </p>
63   *
64   * <p>
65   * The SOAP utility is only generated for remote services.
66   * </p>
67   *
68   * @author    Brian Wing Shun Chan
69   * @see       MBCategoryServiceHttp
70   * @see       com.liferay.portlet.messageboards.model.MBCategorySoap
71   * @see       com.liferay.portlet.messageboards.service.MBCategoryServiceUtil
72   * @generated
73   */
74  public class MBCategoryServiceSoap {
75      public static com.liferay.portlet.messageboards.model.MBCategorySoap addCategory(
76          long parentCategoryId, java.lang.String name,
77          java.lang.String description, java.lang.String emailAddress,
78          java.lang.String inProtocol, java.lang.String inServerName,
79          int inServerPort, boolean inUseSSL, java.lang.String inUserName,
80          java.lang.String inPassword, int inReadInterval,
81          java.lang.String outEmailAddress, boolean outCustom,
82          java.lang.String outServerName, int outServerPort, boolean outUseSSL,
83          java.lang.String outUserName, java.lang.String outPassword,
84          boolean mailingListActive,
85          com.liferay.portal.service.ServiceContext serviceContext)
86          throws RemoteException {
87          try {
88              com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.addCategory(parentCategoryId,
89                      name, description, emailAddress, inProtocol, inServerName,
90                      inServerPort, inUseSSL, inUserName, inPassword,
91                      inReadInterval, outEmailAddress, outCustom, outServerName,
92                      outServerPort, outUseSSL, outUserName, outPassword,
93                      mailingListActive, serviceContext);
94  
95              return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
96          }
97          catch (Exception e) {
98              _log.error(e, e);
99  
100             throw new RemoteException(e.getMessage());
101         }
102     }
103 
104     public static void deleteCategory(long groupId, long categoryId)
105         throws RemoteException {
106         try {
107             MBCategoryServiceUtil.deleteCategory(groupId, categoryId);
108         }
109         catch (Exception e) {
110             _log.error(e, e);
111 
112             throw new RemoteException(e.getMessage());
113         }
114     }
115 
116     public static com.liferay.portlet.messageboards.model.MBCategorySoap getCategory(
117         long categoryId) throws RemoteException {
118         try {
119             com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.getCategory(categoryId);
120 
121             return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
122         }
123         catch (Exception e) {
124             _log.error(e, e);
125 
126             throw new RemoteException(e.getMessage());
127         }
128     }
129 
130     public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
131         long groupId, long parentCategoryId, int start, int end)
132         throws RemoteException {
133         try {
134             java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
135                 MBCategoryServiceUtil.getCategories(groupId, parentCategoryId,
136                     start, end);
137 
138             return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
139         }
140         catch (Exception e) {
141             _log.error(e, e);
142 
143             throw new RemoteException(e.getMessage());
144         }
145     }
146 
147     public static int getCategoriesCount(long groupId, long parentCategoryId)
148         throws RemoteException {
149         try {
150             int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
151                     parentCategoryId);
152 
153             return returnValue;
154         }
155         catch (Exception e) {
156             _log.error(e, e);
157 
158             throw new RemoteException(e.getMessage());
159         }
160     }
161 
162     public static void subscribeCategory(long groupId, long categoryId)
163         throws RemoteException {
164         try {
165             MBCategoryServiceUtil.subscribeCategory(groupId, categoryId);
166         }
167         catch (Exception e) {
168             _log.error(e, e);
169 
170             throw new RemoteException(e.getMessage());
171         }
172     }
173 
174     public static void unsubscribeCategory(long groupId, long categoryId)
175         throws RemoteException {
176         try {
177             MBCategoryServiceUtil.unsubscribeCategory(groupId, categoryId);
178         }
179         catch (Exception e) {
180             _log.error(e, e);
181 
182             throw new RemoteException(e.getMessage());
183         }
184     }
185 
186     public static com.liferay.portlet.messageboards.model.MBCategorySoap updateCategory(
187         long categoryId, long parentCategoryId, java.lang.String name,
188         java.lang.String description, java.lang.String emailAddress,
189         java.lang.String inProtocol, java.lang.String inServerName,
190         int inServerPort, boolean inUseSSL, java.lang.String inUserName,
191         java.lang.String inPassword, int inReadInterval,
192         java.lang.String outEmailAddress, boolean outCustom,
193         java.lang.String outServerName, int outServerPort, boolean outUseSSL,
194         java.lang.String outUserName, java.lang.String outPassword,
195         boolean mailingListActive, boolean mergeWithParentCategory,
196         com.liferay.portal.service.ServiceContext serviceContext)
197         throws RemoteException {
198         try {
199             com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.updateCategory(categoryId,
200                     parentCategoryId, name, description, emailAddress,
201                     inProtocol, inServerName, inServerPort, inUseSSL,
202                     inUserName, inPassword, inReadInterval, outEmailAddress,
203                     outCustom, outServerName, outServerPort, outUseSSL,
204                     outUserName, outPassword, mailingListActive,
205                     mergeWithParentCategory, serviceContext);
206 
207             return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
208         }
209         catch (Exception e) {
210             _log.error(e, e);
211 
212             throw new RemoteException(e.getMessage());
213         }
214     }
215 
216     private static Log _log = LogFactoryUtil.getLog(MBCategoryServiceSoap.class);
217 }