1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
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 categoryId)
105         throws RemoteException {
106         try {
107             MBCategoryServiceUtil.deleteCategory(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[] getCategories(
117         long groupId, long parentCategoryId, int start, int end)
118         throws RemoteException {
119         try {
120             java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
121                 MBCategoryServiceUtil.getCategories(groupId, parentCategoryId,
122                     start, end);
123 
124             return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
125         }
126         catch (Exception e) {
127             _log.error(e, e);
128 
129             throw new RemoteException(e.getMessage());
130         }
131     }
132 
133     public static int getCategoriesCount(long groupId, long parentCategoryId)
134         throws RemoteException {
135         try {
136             int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
137                     parentCategoryId);
138 
139             return returnValue;
140         }
141         catch (Exception e) {
142             _log.error(e, e);
143 
144             throw new RemoteException(e.getMessage());
145         }
146     }
147 
148     public static com.liferay.portlet.messageboards.model.MBCategorySoap getCategory(
149         long categoryId) throws RemoteException {
150         try {
151             com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.getCategory(categoryId);
152 
153             return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(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 categoryId)
163         throws RemoteException {
164         try {
165             MBCategoryServiceUtil.subscribeCategory(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 categoryId)
175         throws RemoteException {
176         try {
177             MBCategoryServiceUtil.unsubscribeCategory(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         throws RemoteException {
197         try {
198             com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.updateCategory(categoryId,
199                     parentCategoryId, name, description, emailAddress,
200                     inProtocol, inServerName, inServerPort, inUseSSL,
201                     inUserName, inPassword, inReadInterval, outEmailAddress,
202                     outCustom, outServerName, outServerPort, outUseSSL,
203                     outUserName, outPassword, mailingListActive,
204                     mergeWithParentCategory);
205 
206             return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
207         }
208         catch (Exception e) {
209             _log.error(e, e);
210 
211             throw new RemoteException(e.getMessage());
212         }
213     }
214 
215     private static Log _log = LogFactoryUtil.getLog(MBCategoryServiceSoap.class);
216 }