001
014
015 package com.liferay.portlet.documentlibrary.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.LongWrapper;
020 import com.liferay.portal.kernel.util.MethodWrapper;
021 import com.liferay.portal.kernel.util.NullWrapper;
022 import com.liferay.portal.security.auth.HttpPrincipal;
023 import com.liferay.portal.service.http.TunnelUtil;
024
025 import com.liferay.portlet.documentlibrary.service.DLFileShortcutServiceUtil;
026
027
057 public class DLFileShortcutServiceHttp {
058 public static com.liferay.portlet.documentlibrary.model.DLFileShortcut addFileShortcut(
059 HttpPrincipal httpPrincipal, long groupId, long folderId,
060 long toFolderId, java.lang.String toName,
061 com.liferay.portal.service.ServiceContext serviceContext)
062 throws com.liferay.portal.kernel.exception.PortalException,
063 com.liferay.portal.kernel.exception.SystemException {
064 try {
065 Object paramObj0 = new LongWrapper(groupId);
066
067 Object paramObj1 = new LongWrapper(folderId);
068
069 Object paramObj2 = new LongWrapper(toFolderId);
070
071 Object paramObj3 = toName;
072
073 if (toName == null) {
074 paramObj3 = new NullWrapper("java.lang.String");
075 }
076
077 Object paramObj4 = serviceContext;
078
079 if (serviceContext == null) {
080 paramObj4 = new NullWrapper(
081 "com.liferay.portal.service.ServiceContext");
082 }
083
084 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
085 "addFileShortcut",
086 new Object[] {
087 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
088 });
089
090 Object returnObj = null;
091
092 try {
093 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
094 }
095 catch (Exception e) {
096 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
097 throw (com.liferay.portal.kernel.exception.PortalException)e;
098 }
099
100 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
101 throw (com.liferay.portal.kernel.exception.SystemException)e;
102 }
103
104 throw new com.liferay.portal.kernel.exception.SystemException(e);
105 }
106
107 return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
108 }
109 catch (com.liferay.portal.kernel.exception.SystemException se) {
110 _log.error(se, se);
111
112 throw se;
113 }
114 }
115
116 public static void deleteFileShortcut(HttpPrincipal httpPrincipal,
117 long fileShortcutId)
118 throws com.liferay.portal.kernel.exception.PortalException,
119 com.liferay.portal.kernel.exception.SystemException {
120 try {
121 Object paramObj0 = new LongWrapper(fileShortcutId);
122
123 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
124 "deleteFileShortcut", new Object[] { paramObj0 });
125
126 try {
127 TunnelUtil.invoke(httpPrincipal, methodWrapper);
128 }
129 catch (Exception e) {
130 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
131 throw (com.liferay.portal.kernel.exception.PortalException)e;
132 }
133
134 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
135 throw (com.liferay.portal.kernel.exception.SystemException)e;
136 }
137
138 throw new com.liferay.portal.kernel.exception.SystemException(e);
139 }
140 }
141 catch (com.liferay.portal.kernel.exception.SystemException se) {
142 _log.error(se, se);
143
144 throw se;
145 }
146 }
147
148 public static com.liferay.portlet.documentlibrary.model.DLFileShortcut getFileShortcut(
149 HttpPrincipal httpPrincipal, long fileShortcutId)
150 throws com.liferay.portal.kernel.exception.PortalException,
151 com.liferay.portal.kernel.exception.SystemException {
152 try {
153 Object paramObj0 = new LongWrapper(fileShortcutId);
154
155 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
156 "getFileShortcut", new Object[] { paramObj0 });
157
158 Object returnObj = null;
159
160 try {
161 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
162 }
163 catch (Exception e) {
164 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
165 throw (com.liferay.portal.kernel.exception.PortalException)e;
166 }
167
168 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
169 throw (com.liferay.portal.kernel.exception.SystemException)e;
170 }
171
172 throw new com.liferay.portal.kernel.exception.SystemException(e);
173 }
174
175 return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
176 }
177 catch (com.liferay.portal.kernel.exception.SystemException se) {
178 _log.error(se, se);
179
180 throw se;
181 }
182 }
183
184 public static com.liferay.portlet.documentlibrary.model.DLFileShortcut updateFileShortcut(
185 HttpPrincipal httpPrincipal, long fileShortcutId, long folderId,
186 long toFolderId, java.lang.String toName,
187 com.liferay.portal.service.ServiceContext serviceContext)
188 throws com.liferay.portal.kernel.exception.PortalException,
189 com.liferay.portal.kernel.exception.SystemException {
190 try {
191 Object paramObj0 = new LongWrapper(fileShortcutId);
192
193 Object paramObj1 = new LongWrapper(folderId);
194
195 Object paramObj2 = new LongWrapper(toFolderId);
196
197 Object paramObj3 = toName;
198
199 if (toName == null) {
200 paramObj3 = new NullWrapper("java.lang.String");
201 }
202
203 Object paramObj4 = serviceContext;
204
205 if (serviceContext == null) {
206 paramObj4 = new NullWrapper(
207 "com.liferay.portal.service.ServiceContext");
208 }
209
210 MethodWrapper methodWrapper = new MethodWrapper(DLFileShortcutServiceUtil.class.getName(),
211 "updateFileShortcut",
212 new Object[] {
213 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
214 });
215
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.kernel.exception.PortalException) {
223 throw (com.liferay.portal.kernel.exception.PortalException)e;
224 }
225
226 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
227 throw (com.liferay.portal.kernel.exception.SystemException)e;
228 }
229
230 throw new com.liferay.portal.kernel.exception.SystemException(e);
231 }
232
233 return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
234 }
235 catch (com.liferay.portal.kernel.exception.SystemException se) {
236 _log.error(se, se);
237
238 throw se;
239 }
240 }
241
242 private static Log _log = LogFactoryUtil.getLog(DLFileShortcutServiceHttp.class);
243 }