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.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.bookmarks.service.BookmarksFolderServiceUtil;
35
36
73 public class BookmarksFolderServiceHttp {
74 public static com.liferay.portlet.bookmarks.model.BookmarksFolder addFolder(
75 HttpPrincipal httpPrincipal, long parentFolderId,
76 java.lang.String name, java.lang.String description,
77 com.liferay.portal.service.ServiceContext serviceContext)
78 throws com.liferay.portal.PortalException,
79 com.liferay.portal.SystemException {
80 try {
81 Object paramObj0 = new LongWrapper(parentFolderId);
82
83 Object paramObj1 = name;
84
85 if (name == null) {
86 paramObj1 = new NullWrapper("java.lang.String");
87 }
88
89 Object paramObj2 = description;
90
91 if (description == null) {
92 paramObj2 = new NullWrapper("java.lang.String");
93 }
94
95 Object paramObj3 = serviceContext;
96
97 if (serviceContext == null) {
98 paramObj3 = new NullWrapper(
99 "com.liferay.portal.service.ServiceContext");
100 }
101
102 MethodWrapper methodWrapper = new MethodWrapper(BookmarksFolderServiceUtil.class.getName(),
103 "addFolder",
104 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
105
106 Object returnObj = null;
107
108 try {
109 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
110 }
111 catch (Exception e) {
112 if (e instanceof com.liferay.portal.PortalException) {
113 throw (com.liferay.portal.PortalException)e;
114 }
115
116 if (e instanceof com.liferay.portal.SystemException) {
117 throw (com.liferay.portal.SystemException)e;
118 }
119
120 throw new com.liferay.portal.SystemException(e);
121 }
122
123 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
124 }
125 catch (com.liferay.portal.SystemException se) {
126 _log.error(se, se);
127
128 throw se;
129 }
130 }
131
132 public static void deleteFolder(HttpPrincipal httpPrincipal, long folderId)
133 throws com.liferay.portal.PortalException,
134 com.liferay.portal.SystemException {
135 try {
136 Object paramObj0 = new LongWrapper(folderId);
137
138 MethodWrapper methodWrapper = new MethodWrapper(BookmarksFolderServiceUtil.class.getName(),
139 "deleteFolder", new Object[] { paramObj0 });
140
141 try {
142 TunnelUtil.invoke(httpPrincipal, methodWrapper);
143 }
144 catch (Exception e) {
145 if (e instanceof com.liferay.portal.PortalException) {
146 throw (com.liferay.portal.PortalException)e;
147 }
148
149 if (e instanceof com.liferay.portal.SystemException) {
150 throw (com.liferay.portal.SystemException)e;
151 }
152
153 throw new com.liferay.portal.SystemException(e);
154 }
155 }
156 catch (com.liferay.portal.SystemException se) {
157 _log.error(se, se);
158
159 throw se;
160 }
161 }
162
163 public static com.liferay.portlet.bookmarks.model.BookmarksFolder getFolder(
164 HttpPrincipal httpPrincipal, long folderId)
165 throws com.liferay.portal.PortalException,
166 com.liferay.portal.SystemException {
167 try {
168 Object paramObj0 = new LongWrapper(folderId);
169
170 MethodWrapper methodWrapper = new MethodWrapper(BookmarksFolderServiceUtil.class.getName(),
171 "getFolder", new Object[] { paramObj0 });
172
173 Object returnObj = null;
174
175 try {
176 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
177 }
178 catch (Exception e) {
179 if (e instanceof com.liferay.portal.PortalException) {
180 throw (com.liferay.portal.PortalException)e;
181 }
182
183 if (e instanceof com.liferay.portal.SystemException) {
184 throw (com.liferay.portal.SystemException)e;
185 }
186
187 throw new com.liferay.portal.SystemException(e);
188 }
189
190 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
191 }
192 catch (com.liferay.portal.SystemException se) {
193 _log.error(se, se);
194
195 throw se;
196 }
197 }
198
199 public static com.liferay.portlet.bookmarks.model.BookmarksFolder updateFolder(
200 HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
201 java.lang.String name, java.lang.String description,
202 boolean mergeWithParentFolder,
203 com.liferay.portal.service.ServiceContext serviceContext)
204 throws com.liferay.portal.PortalException,
205 com.liferay.portal.SystemException {
206 try {
207 Object paramObj0 = new LongWrapper(folderId);
208
209 Object paramObj1 = new LongWrapper(parentFolderId);
210
211 Object paramObj2 = name;
212
213 if (name == null) {
214 paramObj2 = new NullWrapper("java.lang.String");
215 }
216
217 Object paramObj3 = description;
218
219 if (description == null) {
220 paramObj3 = new NullWrapper("java.lang.String");
221 }
222
223 Object paramObj4 = new BooleanWrapper(mergeWithParentFolder);
224
225 Object paramObj5 = serviceContext;
226
227 if (serviceContext == null) {
228 paramObj5 = new NullWrapper(
229 "com.liferay.portal.service.ServiceContext");
230 }
231
232 MethodWrapper methodWrapper = new MethodWrapper(BookmarksFolderServiceUtil.class.getName(),
233 "updateFolder",
234 new Object[] {
235 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
236 paramObj5
237 });
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.PortalException) {
246 throw (com.liferay.portal.PortalException)e;
247 }
248
249 if (e instanceof com.liferay.portal.SystemException) {
250 throw (com.liferay.portal.SystemException)e;
251 }
252
253 throw new com.liferay.portal.SystemException(e);
254 }
255
256 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
257 }
258 catch (com.liferay.portal.SystemException se) {
259 _log.error(se, se);
260
261 throw se;
262 }
263 }
264
265 private static Log _log = LogFactoryUtil.getLog(BookmarksFolderServiceHttp.class);
266 }