1
14
15 package com.liferay.portlet.documentlibrary.service.http;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.LongWrapper;
20 import com.liferay.portal.kernel.util.MethodWrapper;
21 import com.liferay.portal.kernel.util.NullWrapper;
22 import com.liferay.portal.security.auth.HttpPrincipal;
23 import com.liferay.portal.service.http.TunnelUtil;
24
25 import com.liferay.portlet.documentlibrary.service.DLFileShortcutServiceUtil;
26
27
64 public class DLFileShortcutServiceHttp {
65 public static com.liferay.portlet.documentlibrary.model.DLFileShortcut addFileShortcut(
66 HttpPrincipal httpPrincipal, long groupId, long folderId,
67 long toFolderId, java.lang.String toName,
68 com.liferay.portal.service.ServiceContext serviceContext)
69 throws com.liferay.portal.kernel.exception.PortalException,
70 com.liferay.portal.kernel.exception.SystemException {
71 try {
72 Object paramObj0 = new LongWrapper(groupId);
73
74 Object paramObj1 = new LongWrapper(folderId);
75
76 Object paramObj2 = new LongWrapper(toFolderId);
77
78 Object paramObj3 = toName;
79
80 if (toName == null) {
81 paramObj3 = new NullWrapper("java.lang.String");
82 }
83
84 Object paramObj4 = serviceContext;
85
86 if (serviceContext == null) {
87 paramObj4 = new NullWrapper(
88 "com.liferay.portal.service.ServiceContext");
89 }
90
91 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
92 "addFileShortcut",
93 new Object[] {
94 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
95 });
96
97 Object returnObj = null;
98
99 try {
100 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
101 }
102 catch (Exception e) {
103 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
104 throw (com.liferay.portal.kernel.exception.PortalException)e;
105 }
106
107 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
108 throw (com.liferay.portal.kernel.exception.SystemException)e;
109 }
110
111 throw new com.liferay.portal.kernel.exception.SystemException(e);
112 }
113
114 return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
115 }
116 catch (com.liferay.portal.kernel.exception.SystemException se) {
117 _log.error(se, se);
118
119 throw se;
120 }
121 }
122
123 public static void deleteFileShortcut(HttpPrincipal httpPrincipal,
124 long fileShortcutId)
125 throws com.liferay.portal.kernel.exception.PortalException,
126 com.liferay.portal.kernel.exception.SystemException {
127 try {
128 Object paramObj0 = new LongWrapper(fileShortcutId);
129
130 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
131 "deleteFileShortcut", new Object[] { paramObj0 });
132
133 try {
134 TunnelUtil.invoke(httpPrincipal, methodWrapper);
135 }
136 catch (Exception e) {
137 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
138 throw (com.liferay.portal.kernel.exception.PortalException)e;
139 }
140
141 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
142 throw (com.liferay.portal.kernel.exception.SystemException)e;
143 }
144
145 throw new com.liferay.portal.kernel.exception.SystemException(e);
146 }
147 }
148 catch (com.liferay.portal.kernel.exception.SystemException se) {
149 _log.error(se, se);
150
151 throw se;
152 }
153 }
154
155 public static com.liferay.portlet.documentlibrary.model.DLFileShortcut getFileShortcut(
156 HttpPrincipal httpPrincipal, long fileShortcutId)
157 throws com.liferay.portal.kernel.exception.PortalException,
158 com.liferay.portal.kernel.exception.SystemException {
159 try {
160 Object paramObj0 = new LongWrapper(fileShortcutId);
161
162 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
163 "getFileShortcut", new Object[] { paramObj0 });
164
165 Object returnObj = null;
166
167 try {
168 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
169 }
170 catch (Exception e) {
171 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
172 throw (com.liferay.portal.kernel.exception.PortalException)e;
173 }
174
175 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
176 throw (com.liferay.portal.kernel.exception.SystemException)e;
177 }
178
179 throw new com.liferay.portal.kernel.exception.SystemException(e);
180 }
181
182 return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
183 }
184 catch (com.liferay.portal.kernel.exception.SystemException se) {
185 _log.error(se, se);
186
187 throw se;
188 }
189 }
190
191 public static com.liferay.portlet.documentlibrary.model.DLFileShortcut updateFileShortcut(
192 HttpPrincipal httpPrincipal, long fileShortcutId, long folderId,
193 long toFolderId, java.lang.String toName,
194 com.liferay.portal.service.ServiceContext serviceContext)
195 throws com.liferay.portal.kernel.exception.PortalException,
196 com.liferay.portal.kernel.exception.SystemException {
197 try {
198 Object paramObj0 = new LongWrapper(fileShortcutId);
199
200 Object paramObj1 = new LongWrapper(folderId);
201
202 Object paramObj2 = new LongWrapper(toFolderId);
203
204 Object paramObj3 = toName;
205
206 if (toName == null) {
207 paramObj3 = new NullWrapper("java.lang.String");
208 }
209
210 Object paramObj4 = serviceContext;
211
212 if (serviceContext == null) {
213 paramObj4 = new NullWrapper(
214 "com.liferay.portal.service.ServiceContext");
215 }
216
217 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
218 "updateFileShortcut",
219 new Object[] {
220 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
221 });
222
223 Object returnObj = null;
224
225 try {
226 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
227 }
228 catch (Exception e) {
229 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
230 throw (com.liferay.portal.kernel.exception.PortalException)e;
231 }
232
233 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
234 throw (com.liferay.portal.kernel.exception.SystemException)e;
235 }
236
237 throw new com.liferay.portal.kernel.exception.SystemException(e);
238 }
239
240 return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
241 }
242 catch (com.liferay.portal.kernel.exception.SystemException se) {
243 _log.error(se, se);
244
245 throw se;
246 }
247 }
248
249 private static Log _log = LogFactoryUtil.getLog(DLFileShortcutServiceHttp.class);
250 }