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.DLFileEntryTypeServiceUtil;
025
026
056 public class DLFileEntryTypeServiceHttp {
057 public static com.liferay.portlet.documentlibrary.model.DLFileEntryType addFileEntryType(
058 HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
059 java.lang.String description, long[] ddmStructureIds,
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(DLFileEntryTypeServiceUtil.class.getName(),
065 "addFileEntryType", _addFileEntryTypeParameterTypes0);
066
067 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
068 name, description, ddmStructureIds, 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 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081 throw (com.liferay.portal.kernel.exception.SystemException)e;
082 }
083
084 throw new com.liferay.portal.kernel.exception.SystemException(e);
085 }
086
087 return (com.liferay.portlet.documentlibrary.model.DLFileEntryType)returnObj;
088 }
089 catch (com.liferay.portal.kernel.exception.SystemException se) {
090 _log.error(se, se);
091
092 throw se;
093 }
094 }
095
096 public static void deleteFileEntryType(HttpPrincipal httpPrincipal,
097 long fileEntryTypeId)
098 throws com.liferay.portal.kernel.exception.PortalException,
099 com.liferay.portal.kernel.exception.SystemException {
100 try {
101 MethodKey methodKey = new MethodKey(DLFileEntryTypeServiceUtil.class.getName(),
102 "deleteFileEntryType", _deleteFileEntryTypeParameterTypes1);
103
104 MethodHandler methodHandler = new MethodHandler(methodKey,
105 fileEntryTypeId);
106
107 try {
108 TunnelUtil.invoke(httpPrincipal, methodHandler);
109 }
110 catch (Exception e) {
111 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
112 throw (com.liferay.portal.kernel.exception.PortalException)e;
113 }
114
115 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
116 throw (com.liferay.portal.kernel.exception.SystemException)e;
117 }
118
119 throw new com.liferay.portal.kernel.exception.SystemException(e);
120 }
121 }
122 catch (com.liferay.portal.kernel.exception.SystemException se) {
123 _log.error(se, se);
124
125 throw se;
126 }
127 }
128
129 public static com.liferay.portlet.documentlibrary.model.DLFileEntryType getFileEntryType(
130 HttpPrincipal httpPrincipal, long fileEntryTypeId)
131 throws com.liferay.portal.kernel.exception.PortalException,
132 com.liferay.portal.kernel.exception.SystemException {
133 try {
134 MethodKey methodKey = new MethodKey(DLFileEntryTypeServiceUtil.class.getName(),
135 "getFileEntryType", _getFileEntryTypeParameterTypes2);
136
137 MethodHandler methodHandler = new MethodHandler(methodKey,
138 fileEntryTypeId);
139
140 Object returnObj = null;
141
142 try {
143 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
144 }
145 catch (Exception e) {
146 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
147 throw (com.liferay.portal.kernel.exception.PortalException)e;
148 }
149
150 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
151 throw (com.liferay.portal.kernel.exception.SystemException)e;
152 }
153
154 throw new com.liferay.portal.kernel.exception.SystemException(e);
155 }
156
157 return (com.liferay.portlet.documentlibrary.model.DLFileEntryType)returnObj;
158 }
159 catch (com.liferay.portal.kernel.exception.SystemException se) {
160 _log.error(se, se);
161
162 throw se;
163 }
164 }
165
166 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntryType> getFileEntryTypes(
167 HttpPrincipal httpPrincipal, long[] groupIds)
168 throws com.liferay.portal.kernel.exception.SystemException {
169 try {
170 MethodKey methodKey = new MethodKey(DLFileEntryTypeServiceUtil.class.getName(),
171 "getFileEntryTypes", _getFileEntryTypesParameterTypes3);
172
173 MethodHandler methodHandler = new MethodHandler(methodKey, groupIds);
174
175 Object returnObj = null;
176
177 try {
178 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
179 }
180 catch (Exception e) {
181 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
182 throw (com.liferay.portal.kernel.exception.SystemException)e;
183 }
184
185 throw new com.liferay.portal.kernel.exception.SystemException(e);
186 }
187
188 return (java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntryType>)returnObj;
189 }
190 catch (com.liferay.portal.kernel.exception.SystemException se) {
191 _log.error(se, se);
192
193 throw se;
194 }
195 }
196
197 public static int getFileEntryTypesCount(HttpPrincipal httpPrincipal,
198 long[] groupIds)
199 throws com.liferay.portal.kernel.exception.SystemException {
200 try {
201 MethodKey methodKey = new MethodKey(DLFileEntryTypeServiceUtil.class.getName(),
202 "getFileEntryTypesCount",
203 _getFileEntryTypesCountParameterTypes4);
204
205 MethodHandler methodHandler = new MethodHandler(methodKey, groupIds);
206
207 Object returnObj = null;
208
209 try {
210 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
211 }
212 catch (Exception e) {
213 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
214 throw (com.liferay.portal.kernel.exception.SystemException)e;
215 }
216
217 throw new com.liferay.portal.kernel.exception.SystemException(e);
218 }
219
220 return ((Integer)returnObj).intValue();
221 }
222 catch (com.liferay.portal.kernel.exception.SystemException se) {
223 _log.error(se, se);
224
225 throw se;
226 }
227 }
228
229 public static void updateFileEntryType(HttpPrincipal httpPrincipal,
230 long fileEntryTypeId, java.lang.String name,
231 java.lang.String description, long[] ddmStructureIds,
232 com.liferay.portal.service.ServiceContext serviceContext)
233 throws com.liferay.portal.kernel.exception.PortalException,
234 com.liferay.portal.kernel.exception.SystemException {
235 try {
236 MethodKey methodKey = new MethodKey(DLFileEntryTypeServiceUtil.class.getName(),
237 "updateFileEntryType", _updateFileEntryTypeParameterTypes5);
238
239 MethodHandler methodHandler = new MethodHandler(methodKey,
240 fileEntryTypeId, name, description, ddmStructureIds,
241 serviceContext);
242
243 try {
244 TunnelUtil.invoke(httpPrincipal, methodHandler);
245 }
246 catch (Exception e) {
247 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
248 throw (com.liferay.portal.kernel.exception.PortalException)e;
249 }
250
251 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
252 throw (com.liferay.portal.kernel.exception.SystemException)e;
253 }
254
255 throw new com.liferay.portal.kernel.exception.SystemException(e);
256 }
257 }
258 catch (com.liferay.portal.kernel.exception.SystemException se) {
259 _log.error(se, se);
260
261 throw se;
262 }
263 }
264
265 private static Log _log = LogFactoryUtil.getLog(DLFileEntryTypeServiceHttp.class);
266 private static final Class<?>[] _addFileEntryTypeParameterTypes0 = new Class[] {
267 long.class, java.lang.String.class, java.lang.String.class,
268 long[].class, com.liferay.portal.service.ServiceContext.class
269 };
270 private static final Class<?>[] _deleteFileEntryTypeParameterTypes1 = new Class[] {
271 long.class
272 };
273 private static final Class<?>[] _getFileEntryTypeParameterTypes2 = new Class[] {
274 long.class
275 };
276 private static final Class<?>[] _getFileEntryTypesParameterTypes3 = new Class[] {
277 long[].class
278 };
279 private static final Class<?>[] _getFileEntryTypesCountParameterTypes4 = new Class[] {
280 long[].class
281 };
282 private static final Class<?>[] _updateFileEntryTypeParameterTypes5 = new Class[] {
283 long.class, java.lang.String.class, java.lang.String.class,
284 long[].class, com.liferay.portal.service.ServiceContext.class
285 };
286 }