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