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.DLFileShortcutServiceUtil;
35
36
75 public class DLFileShortcutServiceHttp {
76 public static com.liferay.portlet.documentlibrary.model.DLFileShortcut addFileShortcut(
77 HttpPrincipal httpPrincipal, long folderId, long toFolderId,
78 java.lang.String toName, boolean addCommunityPermissions,
79 boolean addGuestPermissions)
80 throws com.liferay.portal.PortalException,
81 com.liferay.portal.SystemException {
82 try {
83 Object paramObj0 = new LongWrapper(folderId);
84
85 Object paramObj1 = new LongWrapper(toFolderId);
86
87 Object paramObj2 = toName;
88
89 if (toName == null) {
90 paramObj2 = new NullWrapper("java.lang.String");
91 }
92
93 Object paramObj3 = new BooleanWrapper(addCommunityPermissions);
94
95 Object paramObj4 = new BooleanWrapper(addGuestPermissions);
96
97 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
98 "addFileShortcut",
99 new Object[] {
100 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
101 });
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.PortalException) {
110 throw (com.liferay.portal.PortalException)e;
111 }
112
113 if (e instanceof com.liferay.portal.SystemException) {
114 throw (com.liferay.portal.SystemException)e;
115 }
116
117 throw new com.liferay.portal.SystemException(e);
118 }
119
120 return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
121 }
122 catch (com.liferay.portal.SystemException se) {
123 _log.error(se, se);
124
125 throw se;
126 }
127 }
128
129 public static com.liferay.portlet.documentlibrary.model.DLFileShortcut addFileShortcut(
130 HttpPrincipal httpPrincipal, long folderId, long toFolderId,
131 java.lang.String toName, java.lang.String[] communityPermissions,
132 java.lang.String[] guestPermissions)
133 throws com.liferay.portal.PortalException,
134 com.liferay.portal.SystemException {
135 try {
136 Object paramObj0 = new LongWrapper(folderId);
137
138 Object paramObj1 = new LongWrapper(toFolderId);
139
140 Object paramObj2 = toName;
141
142 if (toName == null) {
143 paramObj2 = new NullWrapper("java.lang.String");
144 }
145
146 Object paramObj3 = communityPermissions;
147
148 if (communityPermissions == null) {
149 paramObj3 = new NullWrapper("[Ljava.lang.String;");
150 }
151
152 Object paramObj4 = guestPermissions;
153
154 if (guestPermissions == null) {
155 paramObj4 = new NullWrapper("[Ljava.lang.String;");
156 }
157
158 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
159 "addFileShortcut",
160 new Object[] {
161 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
162 });
163
164 Object returnObj = null;
165
166 try {
167 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
168 }
169 catch (Exception e) {
170 if (e instanceof com.liferay.portal.PortalException) {
171 throw (com.liferay.portal.PortalException)e;
172 }
173
174 if (e instanceof com.liferay.portal.SystemException) {
175 throw (com.liferay.portal.SystemException)e;
176 }
177
178 throw new com.liferay.portal.SystemException(e);
179 }
180
181 return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
182 }
183 catch (com.liferay.portal.SystemException se) {
184 _log.error(se, se);
185
186 throw se;
187 }
188 }
189
190 public static void deleteFileShortcut(HttpPrincipal httpPrincipal,
191 long fileShortcutId)
192 throws com.liferay.portal.PortalException,
193 com.liferay.portal.SystemException {
194 try {
195 Object paramObj0 = new LongWrapper(fileShortcutId);
196
197 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
198 "deleteFileShortcut", new Object[] { paramObj0 });
199
200 try {
201 TunnelUtil.invoke(httpPrincipal, methodWrapper);
202 }
203 catch (Exception e) {
204 if (e instanceof com.liferay.portal.PortalException) {
205 throw (com.liferay.portal.PortalException)e;
206 }
207
208 if (e instanceof com.liferay.portal.SystemException) {
209 throw (com.liferay.portal.SystemException)e;
210 }
211
212 throw new com.liferay.portal.SystemException(e);
213 }
214 }
215 catch (com.liferay.portal.SystemException se) {
216 _log.error(se, se);
217
218 throw se;
219 }
220 }
221
222 public static com.liferay.portlet.documentlibrary.model.DLFileShortcut getFileShortcut(
223 HttpPrincipal httpPrincipal, long fileShortcutId)
224 throws com.liferay.portal.PortalException,
225 com.liferay.portal.SystemException {
226 try {
227 Object paramObj0 = new LongWrapper(fileShortcutId);
228
229 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
230 "getFileShortcut", new Object[] { paramObj0 });
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.documentlibrary.model.DLFileShortcut)returnObj;
250 }
251 catch (com.liferay.portal.SystemException se) {
252 _log.error(se, se);
253
254 throw se;
255 }
256 }
257
258 public static com.liferay.portlet.documentlibrary.model.DLFileShortcut updateFileShortcut(
259 HttpPrincipal httpPrincipal, long fileShortcutId, long folderId,
260 long toFolderId, java.lang.String toName)
261 throws com.liferay.portal.PortalException,
262 com.liferay.portal.SystemException {
263 try {
264 Object paramObj0 = new LongWrapper(fileShortcutId);
265
266 Object paramObj1 = new LongWrapper(folderId);
267
268 Object paramObj2 = new LongWrapper(toFolderId);
269
270 Object paramObj3 = toName;
271
272 if (toName == null) {
273 paramObj3 = new NullWrapper("java.lang.String");
274 }
275
276 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
277 "updateFileShortcut",
278 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
279
280 Object returnObj = null;
281
282 try {
283 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
284 }
285 catch (Exception e) {
286 if (e instanceof com.liferay.portal.PortalException) {
287 throw (com.liferay.portal.PortalException)e;
288 }
289
290 if (e instanceof com.liferay.portal.SystemException) {
291 throw (com.liferay.portal.SystemException)e;
292 }
293
294 throw new com.liferay.portal.SystemException(e);
295 }
296
297 return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
298 }
299 catch (com.liferay.portal.SystemException se) {
300 _log.error(se, se);
301
302 throw se;
303 }
304 }
305
306 private static Log _log = LogFactoryUtil.getLog(DLFileShortcutServiceHttp.class);
307 }