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