001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.messageboards.service.http;
022:
023: import com.liferay.portal.kernel.log.Log;
024: import com.liferay.portal.kernel.log.LogFactoryUtil;
025:
026: import com.liferay.portlet.messageboards.service.MBCategoryServiceUtil;
027:
028: import java.rmi.RemoteException;
029:
030: /**
031: * <a href="MBCategoryServiceSoap.java.html"><b><i>View Source</i></b></a>
032: *
033: * <p>
034: * ServiceBuilder generated this class. Modifications in this class will be
035: * overwritten the next time is generated.
036: * </p>
037: *
038: * <p>
039: * This class provides a SOAP utility for the
040: * <code>com.liferay.portlet.messageboards.service.MBCategoryServiceUtil</code> service
041: * utility. The static methods of this class calls the same methods of the
042: * service utility. However, the signatures are different because it is
043: * difficult for SOAP to support certain types.
044: * </p>
045: *
046: * <p>
047: * ServiceBuilder follows certain rules in translating the methods. For example,
048: * if the method in the service utility returns a <code>java.util.List</code>,
049: * that is translated to an array of
050: * <code>com.liferay.portlet.messageboards.model.MBCategorySoap</code>. If the method in the
051: * service utility returns a <code>com.liferay.portlet.messageboards.model.MBCategory</code>,
052: * that is translated to a <code>com.liferay.portlet.messageboards.model.MBCategorySoap</code>.
053: * Methods that SOAP cannot safely wire are skipped.
054: * </p>
055: *
056: * <p>
057: * The benefits of using the SOAP utility is that it is cross platform
058: * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
059: * even Perl, to call the generated services. One drawback of SOAP is that it is
060: * slow because it needs to serialize all calls into a text format (XML).
061: * </p>
062: *
063: * <p>
064: * You can see a list of services at
065: * http://localhost:8080/tunnel-web/secure/axis. Set the property
066: * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
067: * security.
068: * </p>
069: *
070: * <p>
071: * The SOAP utility is only generated for remote services.
072: * </p>
073: *
074: * @author Brian Wing Shun Chan
075: *
076: * @see com.liferay.portlet.messageboards.service.MBCategoryServiceUtil
077: * @see com.liferay.portlet.messageboards.service.http.MBCategoryServiceHttp
078: * @see com.liferay.portlet.messageboards.service.model.MBCategorySoap
079: *
080: */
081: public class MBCategoryServiceSoap {
082: public static com.liferay.portlet.messageboards.model.MBCategorySoap addCategory(
083: long plid, long parentCategoryId, java.lang.String name,
084: java.lang.String description,
085: java.lang.String[] communityPermissions,
086: java.lang.String[] guestPermissions) throws RemoteException {
087: try {
088: com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil
089: .addCategory(plid, parentCategoryId, name,
090: description, communityPermissions,
091: guestPermissions);
092:
093: return com.liferay.portlet.messageboards.model.MBCategorySoap
094: .toSoapModel(returnValue);
095: } catch (Exception e) {
096: _log.error(e, e);
097:
098: throw new RemoteException(e.getMessage());
099: }
100: }
101:
102: public static void deleteCategory(long categoryId)
103: throws RemoteException {
104: try {
105: MBCategoryServiceUtil.deleteCategory(categoryId);
106: } catch (Exception e) {
107: _log.error(e, e);
108:
109: throw new RemoteException(e.getMessage());
110: }
111: }
112:
113: public static com.liferay.portlet.messageboards.model.MBCategorySoap getCategory(
114: long categoryId) throws RemoteException {
115: try {
116: com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil
117: .getCategory(categoryId);
118:
119: return com.liferay.portlet.messageboards.model.MBCategorySoap
120: .toSoapModel(returnValue);
121: } catch (Exception e) {
122: _log.error(e, e);
123:
124: throw new RemoteException(e.getMessage());
125: }
126: }
127:
128: public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
129: long groupId, long parentCategoryId, int begin, int end)
130: throws RemoteException {
131: try {
132: java.util.List returnValue = MBCategoryServiceUtil
133: .getCategories(groupId, parentCategoryId, begin,
134: end);
135:
136: return com.liferay.portlet.messageboards.model.MBCategorySoap
137: .toSoapModels(returnValue);
138: } catch (Exception e) {
139: _log.error(e, e);
140:
141: throw new RemoteException(e.getMessage());
142: }
143: }
144:
145: public static int getCategoriesCount(long groupId,
146: long parentCategoryId) throws RemoteException {
147: try {
148: int returnValue = MBCategoryServiceUtil.getCategoriesCount(
149: groupId, parentCategoryId);
150:
151: return returnValue;
152: } catch (Exception e) {
153: _log.error(e, e);
154:
155: throw new RemoteException(e.getMessage());
156: }
157: }
158:
159: public static void subscribeCategory(long categoryId)
160: throws RemoteException {
161: try {
162: MBCategoryServiceUtil.subscribeCategory(categoryId);
163: } catch (Exception e) {
164: _log.error(e, e);
165:
166: throw new RemoteException(e.getMessage());
167: }
168: }
169:
170: public static void unsubscribeCategory(long categoryId)
171: throws RemoteException {
172: try {
173: MBCategoryServiceUtil.unsubscribeCategory(categoryId);
174: } catch (Exception e) {
175: _log.error(e, e);
176:
177: throw new RemoteException(e.getMessage());
178: }
179: }
180:
181: public static com.liferay.portlet.messageboards.model.MBCategorySoap updateCategory(
182: long categoryId, long parentCategoryId,
183: java.lang.String name, java.lang.String description,
184: boolean mergeWithParentCategory) throws RemoteException {
185: try {
186: com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil
187: .updateCategory(categoryId, parentCategoryId, name,
188: description, mergeWithParentCategory);
189:
190: return com.liferay.portlet.messageboards.model.MBCategorySoap
191: .toSoapModel(returnValue);
192: } catch (Exception e) {
193: _log.error(e, e);
194:
195: throw new RemoteException(e.getMessage());
196: }
197: }
198:
199: private static Log _log = LogFactoryUtil
200: .getLog(MBCategoryServiceSoap.class);
201: }
|