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