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