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