001
014
015 package com.liferay.portlet.documentlibrary.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.util.MethodCache;
019 import com.liferay.portal.kernel.util.ReferenceRegistry;
020
021
034 public class DLFileEntryServiceUtil {
035
040 public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
041 long groupId, long repositoryId, long folderId,
042 java.lang.String sourceFileName, java.lang.String mimeType,
043 java.lang.String title, java.lang.String description,
044 java.lang.String changeLog, long fileEntryTypeId,
045 java.util.Map<java.lang.String, com.liferay.portlet.dynamicdatamapping.storage.Fields> fieldsMap,
046 java.io.File file, java.io.InputStream is, long size,
047 com.liferay.portal.service.ServiceContext serviceContext)
048 throws com.liferay.portal.kernel.exception.PortalException,
049 com.liferay.portal.kernel.exception.SystemException {
050 return getService()
051 .addFileEntry(groupId, repositoryId, folderId,
052 sourceFileName, mimeType, title, description, changeLog,
053 fileEntryTypeId, fieldsMap, file, is, size, serviceContext);
054 }
055
056 public static void cancelCheckOut(long fileEntryId)
057 throws com.liferay.portal.kernel.exception.PortalException,
058 com.liferay.portal.kernel.exception.SystemException {
059 getService().cancelCheckOut(fileEntryId);
060 }
061
062 public static void checkInFileEntry(long fileEntryId, boolean major,
063 java.lang.String changeLog,
064 com.liferay.portal.service.ServiceContext serviceContext)
065 throws com.liferay.portal.kernel.exception.PortalException,
066 com.liferay.portal.kernel.exception.SystemException {
067 getService()
068 .checkInFileEntry(fileEntryId, major, changeLog, serviceContext);
069 }
070
071 public static void checkInFileEntry(long fileEntryId,
072 java.lang.String lockUuid)
073 throws com.liferay.portal.kernel.exception.PortalException,
074 com.liferay.portal.kernel.exception.SystemException {
075 getService().checkInFileEntry(fileEntryId, lockUuid);
076 }
077
078
081 public static com.liferay.portlet.documentlibrary.model.DLFileEntry checkOutFileEntry(
082 long fileEntryId)
083 throws com.liferay.portal.kernel.exception.PortalException,
084 com.liferay.portal.kernel.exception.SystemException {
085 return getService().checkOutFileEntry(fileEntryId);
086 }
087
088 public static com.liferay.portlet.documentlibrary.model.DLFileEntry checkOutFileEntry(
089 long fileEntryId,
090 com.liferay.portal.service.ServiceContext serviceContext)
091 throws com.liferay.portal.kernel.exception.PortalException,
092 com.liferay.portal.kernel.exception.SystemException {
093 return getService().checkOutFileEntry(fileEntryId, serviceContext);
094 }
095
096
100 public static com.liferay.portlet.documentlibrary.model.DLFileEntry checkOutFileEntry(
101 long fileEntryId, java.lang.String owner, long expirationTime)
102 throws com.liferay.portal.kernel.exception.PortalException,
103 com.liferay.portal.kernel.exception.SystemException {
104 return getService().checkOutFileEntry(fileEntryId, owner, expirationTime);
105 }
106
107 public static com.liferay.portlet.documentlibrary.model.DLFileEntry checkOutFileEntry(
108 long fileEntryId, java.lang.String owner, long expirationTime,
109 com.liferay.portal.service.ServiceContext serviceContext)
110 throws com.liferay.portal.kernel.exception.PortalException,
111 com.liferay.portal.kernel.exception.SystemException {
112 return getService()
113 .checkOutFileEntry(fileEntryId, owner, expirationTime,
114 serviceContext);
115 }
116
117 public static com.liferay.portlet.documentlibrary.model.DLFileEntry copyFileEntry(
118 long groupId, long repositoryId, long fileEntryId, long destFolderId,
119 com.liferay.portal.service.ServiceContext serviceContext)
120 throws com.liferay.portal.kernel.exception.PortalException,
121 com.liferay.portal.kernel.exception.SystemException {
122 return getService()
123 .copyFileEntry(groupId, repositoryId, fileEntryId,
124 destFolderId, serviceContext);
125 }
126
127 public static void deleteFileEntry(long fileEntryId)
128 throws com.liferay.portal.kernel.exception.PortalException,
129 com.liferay.portal.kernel.exception.SystemException {
130 getService().deleteFileEntry(fileEntryId);
131 }
132
133 public static void deleteFileEntry(long groupId, long folderId,
134 java.lang.String title)
135 throws com.liferay.portal.kernel.exception.PortalException,
136 com.liferay.portal.kernel.exception.SystemException {
137 getService().deleteFileEntry(groupId, folderId, title);
138 }
139
140 public static com.liferay.portlet.documentlibrary.model.DLFileEntry fetchFileEntryByImageId(
141 long imageId)
142 throws com.liferay.portal.kernel.exception.PortalException,
143 com.liferay.portal.kernel.exception.SystemException {
144 return getService().fetchFileEntryByImageId(imageId);
145 }
146
147 public static java.io.InputStream getFileAsStream(long fileEntryId,
148 java.lang.String version)
149 throws com.liferay.portal.kernel.exception.PortalException,
150 com.liferay.portal.kernel.exception.SystemException {
151 return getService().getFileAsStream(fileEntryId, version);
152 }
153
154 public static java.io.InputStream getFileAsStream(long fileEntryId,
155 java.lang.String version, boolean incrementCounter)
156 throws com.liferay.portal.kernel.exception.PortalException,
157 com.liferay.portal.kernel.exception.SystemException {
158 return getService()
159 .getFileAsStream(fileEntryId, version, incrementCounter);
160 }
161
162 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
163 long groupId, long folderId, int start, int end,
164 com.liferay.portal.kernel.util.OrderByComparator obc)
165 throws com.liferay.portal.kernel.exception.SystemException {
166 return getService().getFileEntries(groupId, folderId, start, end, obc);
167 }
168
169 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
170 long groupId, long folderId, long fileEntryTypeId, int start, int end,
171 com.liferay.portal.kernel.util.OrderByComparator obc)
172 throws com.liferay.portal.kernel.exception.SystemException {
173 return getService()
174 .getFileEntries(groupId, folderId, fileEntryTypeId, start,
175 end, obc);
176 }
177
178 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
179 long groupId, long folderId, java.lang.String[] mimeTypes, int start,
180 int end, com.liferay.portal.kernel.util.OrderByComparator obc)
181 throws com.liferay.portal.kernel.exception.SystemException {
182 return getService()
183 .getFileEntries(groupId, folderId, mimeTypes, start, end, obc);
184 }
185
186 public static int getFileEntriesCount(long groupId, long folderId)
187 throws com.liferay.portal.kernel.exception.SystemException {
188 return getService().getFileEntriesCount(groupId, folderId);
189 }
190
191 public static int getFileEntriesCount(long groupId, long folderId,
192 long fileEntryTypeId)
193 throws com.liferay.portal.kernel.exception.SystemException {
194 return getService()
195 .getFileEntriesCount(groupId, folderId, fileEntryTypeId);
196 }
197
198 public static int getFileEntriesCount(long groupId, long folderId,
199 java.lang.String[] mimeTypes)
200 throws com.liferay.portal.kernel.exception.SystemException {
201 return getService().getFileEntriesCount(groupId, folderId, mimeTypes);
202 }
203
204 public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
205 long fileEntryId)
206 throws com.liferay.portal.kernel.exception.PortalException,
207 com.liferay.portal.kernel.exception.SystemException {
208 return getService().getFileEntry(fileEntryId);
209 }
210
211 public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
212 long groupId, long folderId, java.lang.String title)
213 throws com.liferay.portal.kernel.exception.PortalException,
214 com.liferay.portal.kernel.exception.SystemException {
215 return getService().getFileEntry(groupId, folderId, title);
216 }
217
218 public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByUuidAndGroupId(
219 java.lang.String uuid, long groupId)
220 throws com.liferay.portal.kernel.exception.PortalException,
221 com.liferay.portal.kernel.exception.SystemException {
222 return getService().getFileEntryByUuidAndGroupId(uuid, groupId);
223 }
224
225 public static com.liferay.portal.model.Lock getFileEntryLock(
226 long fileEntryId) {
227 return getService().getFileEntryLock(fileEntryId);
228 }
229
230 public static int getFoldersFileEntriesCount(long groupId,
231 java.util.List<java.lang.Long> folderIds, int status)
232 throws com.liferay.portal.kernel.exception.SystemException {
233 return getService()
234 .getFoldersFileEntriesCount(groupId, folderIds, status);
235 }
236
237 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getGroupFileEntries(
238 long groupId, long userId, long rootFolderId, int start, int end,
239 com.liferay.portal.kernel.util.OrderByComparator obc)
240 throws com.liferay.portal.kernel.exception.SystemException {
241 return getService()
242 .getGroupFileEntries(groupId, userId, rootFolderId, start,
243 end, obc);
244 }
245
246 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getGroupFileEntries(
247 long groupId, long userId, long rootFolderId,
248 java.lang.String[] mimeTypes, int status, int start, int end,
249 com.liferay.portal.kernel.util.OrderByComparator obc)
250 throws com.liferay.portal.kernel.exception.SystemException {
251 return getService()
252 .getGroupFileEntries(groupId, userId, rootFolderId,
253 mimeTypes, status, start, end, obc);
254 }
255
256 public static int getGroupFileEntriesCount(long groupId, long userId,
257 long rootFolderId)
258 throws com.liferay.portal.kernel.exception.SystemException {
259 return getService()
260 .getGroupFileEntriesCount(groupId, userId, rootFolderId);
261 }
262
263 public static int getGroupFileEntriesCount(long groupId, long userId,
264 long rootFolderId, java.lang.String[] mimeTypes, int status)
265 throws com.liferay.portal.kernel.exception.SystemException {
266 return getService()
267 .getGroupFileEntriesCount(groupId, userId, rootFolderId,
268 mimeTypes, status);
269 }
270
271 public static boolean hasFileEntryLock(long fileEntryId)
272 throws com.liferay.portal.kernel.exception.PortalException,
273 com.liferay.portal.kernel.exception.SystemException {
274 return getService().hasFileEntryLock(fileEntryId);
275 }
276
277 public static boolean isFileEntryCheckedOut(long fileEntryId)
278 throws com.liferay.portal.kernel.exception.PortalException,
279 com.liferay.portal.kernel.exception.SystemException {
280 return getService().isFileEntryCheckedOut(fileEntryId);
281 }
282
283 public static com.liferay.portal.model.Lock lockFileEntry(long fileEntryId)
284 throws com.liferay.portal.kernel.exception.PortalException,
285 com.liferay.portal.kernel.exception.SystemException {
286 return getService().lockFileEntry(fileEntryId);
287 }
288
289 public static com.liferay.portal.model.Lock lockFileEntry(
290 long fileEntryId, java.lang.String owner, long expirationTime)
291 throws com.liferay.portal.kernel.exception.PortalException,
292 com.liferay.portal.kernel.exception.SystemException {
293 return getService().lockFileEntry(fileEntryId, owner, expirationTime);
294 }
295
296 public static com.liferay.portlet.documentlibrary.model.DLFileEntry moveFileEntry(
297 long fileEntryId, long newFolderId,
298 com.liferay.portal.service.ServiceContext serviceContext)
299 throws com.liferay.portal.kernel.exception.PortalException,
300 com.liferay.portal.kernel.exception.SystemException {
301 return getService()
302 .moveFileEntry(fileEntryId, newFolderId, serviceContext);
303 }
304
305 public static com.liferay.portal.model.Lock refreshFileEntryLock(
306 java.lang.String lockUuid, long expirationTime)
307 throws com.liferay.portal.kernel.exception.PortalException,
308 com.liferay.portal.kernel.exception.SystemException {
309 return getService().refreshFileEntryLock(lockUuid, expirationTime);
310 }
311
312 public static void revertFileEntry(long fileEntryId,
313 java.lang.String version,
314 com.liferay.portal.service.ServiceContext serviceContext)
315 throws com.liferay.portal.kernel.exception.PortalException,
316 com.liferay.portal.kernel.exception.SystemException {
317 getService().revertFileEntry(fileEntryId, version, serviceContext);
318 }
319
320 public static void unlockFileEntry(long fileEntryId)
321 throws com.liferay.portal.kernel.exception.PortalException,
322 com.liferay.portal.kernel.exception.SystemException {
323 getService().unlockFileEntry(fileEntryId);
324 }
325
326 public static void unlockFileEntry(long fileEntryId,
327 java.lang.String lockUuid)
328 throws com.liferay.portal.kernel.exception.PortalException,
329 com.liferay.portal.kernel.exception.SystemException {
330 getService().unlockFileEntry(fileEntryId, lockUuid);
331 }
332
333 public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
334 long fileEntryId, java.lang.String sourceFileName,
335 java.lang.String mimeType, java.lang.String title,
336 java.lang.String description, java.lang.String changeLog,
337 boolean majorVersion, long fileEntryTypeId,
338 java.util.Map<java.lang.String, com.liferay.portlet.dynamicdatamapping.storage.Fields> fieldsMap,
339 java.io.File file, java.io.InputStream is, long size,
340 com.liferay.portal.service.ServiceContext serviceContext)
341 throws com.liferay.portal.kernel.exception.PortalException,
342 com.liferay.portal.kernel.exception.SystemException {
343 return getService()
344 .updateFileEntry(fileEntryId, sourceFileName, mimeType,
345 title, description, changeLog, majorVersion, fileEntryTypeId,
346 fieldsMap, file, is, size, serviceContext);
347 }
348
349 public static boolean verifyFileEntryCheckOut(long fileEntryId,
350 java.lang.String lockUuid)
351 throws com.liferay.portal.kernel.exception.PortalException,
352 com.liferay.portal.kernel.exception.SystemException {
353 return getService().verifyFileEntryCheckOut(fileEntryId, lockUuid);
354 }
355
356 public static boolean verifyFileEntryLock(long fileEntryId,
357 java.lang.String lockUuid)
358 throws com.liferay.portal.kernel.exception.PortalException,
359 com.liferay.portal.kernel.exception.SystemException {
360 return getService().verifyFileEntryLock(fileEntryId, lockUuid);
361 }
362
363 public static DLFileEntryService getService() {
364 if (_service == null) {
365 _service = (DLFileEntryService)PortalBeanLocatorUtil.locate(DLFileEntryService.class.getName());
366
367 ReferenceRegistry.registerReference(DLFileEntryServiceUtil.class,
368 "_service");
369 MethodCache.remove(DLFileEntryService.class);
370 }
371
372 return _service;
373 }
374
375 public void setService(DLFileEntryService service) {
376 MethodCache.remove(DLFileEntryService.class);
377
378 _service = service;
379
380 ReferenceRegistry.registerReference(DLFileEntryServiceUtil.class,
381 "_service");
382 MethodCache.remove(DLFileEntryService.class);
383 }
384
385 private static DLFileEntryService _service;
386 }