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