1
22
23 package com.liferay.portlet.wiki.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.BooleanWrapper;
28 import com.liferay.portal.kernel.util.LongWrapper;
29 import com.liferay.portal.kernel.util.MethodWrapper;
30 import com.liferay.portal.kernel.util.NullWrapper;
31 import com.liferay.portal.security.auth.HttpPrincipal;
32 import com.liferay.portal.service.http.TunnelUtil;
33
34 import com.liferay.portlet.wiki.service.WikiNodeServiceUtil;
35
36
75 public class WikiNodeServiceHttp {
76 public static com.liferay.portlet.wiki.model.WikiNode addNode(
77 HttpPrincipal httpPrincipal, long plid, java.lang.String name,
78 java.lang.String description, boolean addCommunityPermissions,
79 boolean addGuestPermissions)
80 throws com.liferay.portal.SystemException,
81 com.liferay.portal.PortalException {
82 try {
83 Object paramObj0 = new LongWrapper(plid);
84
85 Object paramObj1 = name;
86
87 if (name == null) {
88 paramObj1 = new NullWrapper("java.lang.String");
89 }
90
91 Object paramObj2 = description;
92
93 if (description == null) {
94 paramObj2 = new NullWrapper("java.lang.String");
95 }
96
97 Object paramObj3 = new BooleanWrapper(addCommunityPermissions);
98
99 Object paramObj4 = new BooleanWrapper(addGuestPermissions);
100
101 MethodWrapper methodWrapper = new MethodWrapper(WikiNodeServiceUtil.class.getName(),
102 "addNode",
103 new Object[] {
104 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
105 });
106
107 Object returnObj = null;
108
109 try {
110 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
111 }
112 catch (Exception e) {
113 if (e instanceof com.liferay.portal.SystemException) {
114 throw (com.liferay.portal.SystemException)e;
115 }
116
117 if (e instanceof com.liferay.portal.PortalException) {
118 throw (com.liferay.portal.PortalException)e;
119 }
120
121 throw new com.liferay.portal.SystemException(e);
122 }
123
124 return (com.liferay.portlet.wiki.model.WikiNode)returnObj;
125 }
126 catch (com.liferay.portal.SystemException se) {
127 _log.error(se, se);
128
129 throw se;
130 }
131 }
132
133 public static com.liferay.portlet.wiki.model.WikiNode addNode(
134 HttpPrincipal httpPrincipal, long plid, java.lang.String name,
135 java.lang.String description, java.lang.String[] communityPermissions,
136 java.lang.String[] guestPermissions)
137 throws com.liferay.portal.SystemException,
138 com.liferay.portal.PortalException {
139 try {
140 Object paramObj0 = new LongWrapper(plid);
141
142 Object paramObj1 = name;
143
144 if (name == null) {
145 paramObj1 = new NullWrapper("java.lang.String");
146 }
147
148 Object paramObj2 = description;
149
150 if (description == null) {
151 paramObj2 = new NullWrapper("java.lang.String");
152 }
153
154 Object paramObj3 = communityPermissions;
155
156 if (communityPermissions == null) {
157 paramObj3 = new NullWrapper("[Ljava.lang.String;");
158 }
159
160 Object paramObj4 = guestPermissions;
161
162 if (guestPermissions == null) {
163 paramObj4 = new NullWrapper("[Ljava.lang.String;");
164 }
165
166 MethodWrapper methodWrapper = new MethodWrapper(WikiNodeServiceUtil.class.getName(),
167 "addNode",
168 new Object[] {
169 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
170 });
171
172 Object returnObj = null;
173
174 try {
175 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
176 }
177 catch (Exception e) {
178 if (e instanceof com.liferay.portal.SystemException) {
179 throw (com.liferay.portal.SystemException)e;
180 }
181
182 if (e instanceof com.liferay.portal.PortalException) {
183 throw (com.liferay.portal.PortalException)e;
184 }
185
186 throw new com.liferay.portal.SystemException(e);
187 }
188
189 return (com.liferay.portlet.wiki.model.WikiNode)returnObj;
190 }
191 catch (com.liferay.portal.SystemException se) {
192 _log.error(se, se);
193
194 throw se;
195 }
196 }
197
198 public static void deleteNode(HttpPrincipal httpPrincipal, long nodeId)
199 throws com.liferay.portal.SystemException,
200 com.liferay.portal.PortalException {
201 try {
202 Object paramObj0 = new LongWrapper(nodeId);
203
204 MethodWrapper methodWrapper = new MethodWrapper(WikiNodeServiceUtil.class.getName(),
205 "deleteNode", new Object[] { paramObj0 });
206
207 try {
208 TunnelUtil.invoke(httpPrincipal, methodWrapper);
209 }
210 catch (Exception e) {
211 if (e instanceof com.liferay.portal.SystemException) {
212 throw (com.liferay.portal.SystemException)e;
213 }
214
215 if (e instanceof com.liferay.portal.PortalException) {
216 throw (com.liferay.portal.PortalException)e;
217 }
218
219 throw new com.liferay.portal.SystemException(e);
220 }
221 }
222 catch (com.liferay.portal.SystemException se) {
223 _log.error(se, se);
224
225 throw se;
226 }
227 }
228
229 public static com.liferay.portlet.wiki.model.WikiNode getNode(
230 HttpPrincipal httpPrincipal, long nodeId)
231 throws com.liferay.portal.SystemException,
232 com.liferay.portal.PortalException {
233 try {
234 Object paramObj0 = new LongWrapper(nodeId);
235
236 MethodWrapper methodWrapper = new MethodWrapper(WikiNodeServiceUtil.class.getName(),
237 "getNode", new Object[] { paramObj0 });
238
239 Object returnObj = null;
240
241 try {
242 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
243 }
244 catch (Exception e) {
245 if (e instanceof com.liferay.portal.SystemException) {
246 throw (com.liferay.portal.SystemException)e;
247 }
248
249 if (e instanceof com.liferay.portal.PortalException) {
250 throw (com.liferay.portal.PortalException)e;
251 }
252
253 throw new com.liferay.portal.SystemException(e);
254 }
255
256 return (com.liferay.portlet.wiki.model.WikiNode)returnObj;
257 }
258 catch (com.liferay.portal.SystemException se) {
259 _log.error(se, se);
260
261 throw se;
262 }
263 }
264
265 public static com.liferay.portlet.wiki.model.WikiNode updateNode(
266 HttpPrincipal httpPrincipal, long nodeId, java.lang.String name,
267 java.lang.String description)
268 throws com.liferay.portal.SystemException,
269 com.liferay.portal.PortalException {
270 try {
271 Object paramObj0 = new LongWrapper(nodeId);
272
273 Object paramObj1 = name;
274
275 if (name == null) {
276 paramObj1 = new NullWrapper("java.lang.String");
277 }
278
279 Object paramObj2 = description;
280
281 if (description == null) {
282 paramObj2 = new NullWrapper("java.lang.String");
283 }
284
285 MethodWrapper methodWrapper = new MethodWrapper(WikiNodeServiceUtil.class.getName(),
286 "updateNode",
287 new Object[] { paramObj0, paramObj1, paramObj2 });
288
289 Object returnObj = null;
290
291 try {
292 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
293 }
294 catch (Exception e) {
295 if (e instanceof com.liferay.portal.SystemException) {
296 throw (com.liferay.portal.SystemException)e;
297 }
298
299 if (e instanceof com.liferay.portal.PortalException) {
300 throw (com.liferay.portal.PortalException)e;
301 }
302
303 throw new com.liferay.portal.SystemException(e);
304 }
305
306 return (com.liferay.portlet.wiki.model.WikiNode)returnObj;
307 }
308 catch (com.liferay.portal.SystemException se) {
309 _log.error(se, se);
310
311 throw se;
312 }
313 }
314
315 private static Log _log = LogFactoryUtil.getLog(WikiNodeServiceHttp.class);
316 }