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