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