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