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