001
014
015 package com.liferay.document.library.kernel.service;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.document.library.kernel.model.DLFileEntry;
020 import com.liferay.document.library.kernel.model.DLFileVersion;
021
022 import com.liferay.dynamic.data.mapping.kernel.DDMFormValues;
023
024 import com.liferay.exportimport.kernel.lar.PortletDataContext;
025
026 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
027 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
028 import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
029 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
030 import com.liferay.portal.kernel.dao.orm.Projection;
031 import com.liferay.portal.kernel.dao.orm.QueryDefinition;
032 import com.liferay.portal.kernel.exception.PortalException;
033 import com.liferay.portal.kernel.exception.SystemException;
034 import com.liferay.portal.kernel.increment.BufferedIncrement;
035 import com.liferay.portal.kernel.lock.Lock;
036 import com.liferay.portal.kernel.model.PersistedModel;
037 import com.liferay.portal.kernel.model.SystemEventConstants;
038 import com.liferay.portal.kernel.search.Hits;
039 import com.liferay.portal.kernel.search.Indexable;
040 import com.liferay.portal.kernel.search.IndexableType;
041 import com.liferay.portal.kernel.service.BaseLocalService;
042 import com.liferay.portal.kernel.service.PersistedModelLocalService;
043 import com.liferay.portal.kernel.service.ServiceContext;
044 import com.liferay.portal.kernel.systemevent.SystemEvent;
045 import com.liferay.portal.kernel.transaction.Isolation;
046 import com.liferay.portal.kernel.transaction.Propagation;
047 import com.liferay.portal.kernel.transaction.Transactional;
048 import com.liferay.portal.kernel.util.DateRange;
049 import com.liferay.portal.kernel.util.OrderByComparator;
050
051 import java.io.File;
052 import java.io.InputStream;
053 import java.io.Serializable;
054
055 import java.util.List;
056 import java.util.Map;
057
058
070 @ProviderType
071 @Transactional(isolation = Isolation.PORTAL, rollbackFor = {
072 PortalException.class, SystemException.class})
073 public interface DLFileEntryLocalService extends BaseLocalService,
074 PersistedModelLocalService {
075
080 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
081 public boolean hasExtraSettings();
082
083 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
084 public boolean hasFileEntryLock(long userId, long fileEntryId)
085 throws PortalException;
086
087 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
088 public boolean isFileEntryCheckedOut(long fileEntryId)
089 throws PortalException;
090
091 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
092 public boolean isKeepFileVersionLabel(long fileEntryId,
093 boolean majorVersion, ServiceContext serviceContext)
094 throws PortalException;
095
096
100 @java.lang.Deprecated
101 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
102 public boolean isKeepFileVersionLabel(long fileEntryId,
103 ServiceContext serviceContext) throws PortalException;
104
105 public boolean verifyFileEntryCheckOut(long fileEntryId,
106 java.lang.String lockUuid) throws PortalException;
107
108 public boolean verifyFileEntryLock(long fileEntryId,
109 java.lang.String lockUuid) throws PortalException;
110
111
117 @Indexable(type = IndexableType.REINDEX)
118 public DLFileEntry addDLFileEntry(DLFileEntry dlFileEntry);
119
120 public DLFileEntry addFileEntry(long userId, long groupId,
121 long repositoryId, long folderId, java.lang.String sourceFileName,
122 java.lang.String mimeType, java.lang.String title,
123 java.lang.String description, java.lang.String changeLog,
124 long fileEntryTypeId,
125 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, File file,
126 InputStream is, long size, ServiceContext serviceContext)
127 throws PortalException;
128
129 public DLFileEntry checkOutFileEntry(long userId, long fileEntryId,
130 ServiceContext serviceContext) throws PortalException;
131
132 public DLFileEntry checkOutFileEntry(long userId, long fileEntryId,
133 java.lang.String owner, long expirationTime,
134 ServiceContext serviceContext) throws PortalException;
135
136 public DLFileEntry copyFileEntry(long userId, long groupId,
137 long repositoryId, long fileEntryId, long destFolderId,
138 ServiceContext serviceContext) throws PortalException;
139
140
146 public DLFileEntry createDLFileEntry(long fileEntryId);
147
148
154 @Indexable(type = IndexableType.DELETE)
155 public DLFileEntry deleteDLFileEntry(DLFileEntry dlFileEntry);
156
157
164 @Indexable(type = IndexableType.DELETE)
165 public DLFileEntry deleteDLFileEntry(long fileEntryId)
166 throws PortalException;
167
168 @Indexable(type = IndexableType.DELETE)
169 @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
170 public DLFileEntry deleteFileEntry(DLFileEntry dlFileEntry)
171 throws PortalException;
172
173 @Indexable(type = IndexableType.DELETE)
174 public DLFileEntry deleteFileEntry(long fileEntryId)
175 throws PortalException;
176
177 @Indexable(type = IndexableType.DELETE)
178 public DLFileEntry deleteFileEntry(long userId, long fileEntryId)
179 throws PortalException;
180
181 @Indexable(type = IndexableType.REINDEX)
182 public DLFileEntry deleteFileVersion(long userId, long fileEntryId,
183 java.lang.String version) throws PortalException;
184
185 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186 public DLFileEntry fetchDLFileEntry(long fileEntryId);
187
188
195 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196 public DLFileEntry fetchDLFileEntryByUuidAndGroupId(java.lang.String uuid,
197 long groupId);
198
199 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200 public DLFileEntry fetchFileEntry(long groupId, long folderId,
201 java.lang.String title);
202
203 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
204 public DLFileEntry fetchFileEntryByAnyImageId(long imageId);
205
206 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
207 public DLFileEntry fetchFileEntryByFileName(long groupId, long folderId,
208 java.lang.String fileName);
209
210 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
211 public DLFileEntry fetchFileEntryByName(long groupId, long folderId,
212 java.lang.String name);
213
214
221 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
222 public DLFileEntry getDLFileEntry(long fileEntryId)
223 throws PortalException;
224
225
233 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
234 public DLFileEntry getDLFileEntryByUuidAndGroupId(java.lang.String uuid,
235 long groupId) throws PortalException;
236
237 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238 public DLFileEntry getFileEntry(long fileEntryId) throws PortalException;
239
240 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
241 public DLFileEntry getFileEntry(long groupId, long folderId,
242 java.lang.String title) throws PortalException;
243
244 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
245 public DLFileEntry getFileEntryByName(long groupId, long folderId,
246 java.lang.String name) throws PortalException;
247
248 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
249 public DLFileEntry getFileEntryByUuidAndGroupId(java.lang.String uuid,
250 long groupId) throws PortalException;
251
252 @Indexable(type = IndexableType.REINDEX)
253 public DLFileEntry moveFileEntry(long userId, long fileEntryId,
254 long newFolderId, ServiceContext serviceContext)
255 throws PortalException;
256
257
263 @Indexable(type = IndexableType.REINDEX)
264 public DLFileEntry updateDLFileEntry(DLFileEntry dlFileEntry);
265
266 public DLFileEntry updateFileEntry(long userId, long fileEntryId,
267 java.lang.String sourceFileName, java.lang.String mimeType,
268 java.lang.String title, java.lang.String description,
269 java.lang.String changeLog, boolean majorVersion, long fileEntryTypeId,
270 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, File file,
271 InputStream is, long size, ServiceContext serviceContext)
272 throws PortalException;
273
274 public DLFileEntry updateFileEntryType(long userId, long fileEntryId,
275 long fileEntryTypeId, ServiceContext serviceContext)
276 throws PortalException;
277
278 public DLFileEntry updateStatus(long userId, long fileVersionId,
279 int status, ServiceContext serviceContext,
280 Map<java.lang.String, Serializable> workflowContext)
281 throws PortalException;
282
283 public DLFileVersion cancelCheckOut(long userId, long fileEntryId)
284 throws PortalException;
285
286 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287 public ActionableDynamicQuery getActionableDynamicQuery();
288
289 public DynamicQuery dynamicQuery();
290
291 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
292 public ExportActionableDynamicQuery getExportActionableDynamicQuery(
293 PortletDataContext portletDataContext);
294
295 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
296 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
297
298 public Lock lockFileEntry(long userId, long fileEntryId)
299 throws PortalException;
300
301
304 @Override
305 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
306 throws PortalException;
307
308 @Override
309 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
310 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
311 throws PortalException;
312
313 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
314 public Hits search(long groupId, long userId, long creatorUserId,
315 int status, int start, int end) throws PortalException;
316
317 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
318 public Hits search(long groupId, long userId, long creatorUserId,
319 long folderId, java.lang.String[] mimeTypes, int status, int start,
320 int end) throws PortalException;
321
322
327 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
328 public int getDLFileEntriesCount();
329
330 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
331 public int getExtraSettingsFileEntriesCount();
332
333 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
334 public int getFileEntriesCount();
335
336
339 @java.lang.Deprecated
340 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
341 public int getFileEntriesCount(long groupId, DateRange dateRange,
342 long repositoryId, QueryDefinition<DLFileEntry> queryDefinition);
343
344 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
345 public int getFileEntriesCount(long groupId, long folderId);
346
347 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
348 public int getFileEntriesCount(long groupId, long folderId, int status);
349
350 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
351 public int getFileEntriesCount(long groupId, long userId,
352 List<java.lang.Long> folderIds, java.lang.String[] mimeTypes,
353 QueryDefinition<DLFileEntry> queryDefinition)
354 throws java.lang.Exception;
355
356 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
357 public int getFileEntriesCount(long groupId, long userId,
358 List<java.lang.Long> repositoryIds, List<java.lang.Long> folderIds,
359 java.lang.String[] mimeTypes,
360 QueryDefinition<DLFileEntry> queryDefinition)
361 throws java.lang.Exception;
362
363 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
364 public int getGroupFileEntriesCount(long groupId);
365
366 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
367 public int getGroupFileEntriesCount(long groupId, long userId);
368
369 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
370 public int getRepositoryFileEntriesCount(long repositoryId);
371
372 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
373 public File getFile(long fileEntryId, java.lang.String version,
374 boolean incrementCounter) throws PortalException;
375
376 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
377 public File getFile(long fileEntryId, java.lang.String version,
378 boolean incrementCounter, int increment) throws PortalException;
379
380
384 @java.lang.Deprecated
385 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
386 public File getFile(long userId, long fileEntryId,
387 java.lang.String version, boolean incrementCounter)
388 throws PortalException;
389
390
394 @java.lang.Deprecated
395 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
396 public File getFile(long userId, long fileEntryId,
397 java.lang.String version, boolean incrementCounter, int increment)
398 throws PortalException;
399
400 public InputStream getFileAsStream(long fileEntryId,
401 java.lang.String version) throws PortalException;
402
403 public InputStream getFileAsStream(long fileEntryId,
404 java.lang.String version, boolean incrementCounter)
405 throws PortalException;
406
407 public InputStream getFileAsStream(long fileEntryId,
408 java.lang.String version, boolean incrementCounter, int increment)
409 throws PortalException;
410
411
415 @java.lang.Deprecated
416 public InputStream getFileAsStream(long userId, long fileEntryId,
417 java.lang.String version) throws PortalException;
418
419
423 @java.lang.Deprecated
424 public InputStream getFileAsStream(long userId, long fileEntryId,
425 java.lang.String version, boolean incrementCounter)
426 throws PortalException;
427
428
432 @java.lang.Deprecated
433 public InputStream getFileAsStream(long userId, long fileEntryId,
434 java.lang.String version, boolean incrementCounter, int increment)
435 throws PortalException;
436
437
442 public java.lang.String getOSGiServiceIdentifier();
443
444 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
445 public java.lang.String getUniqueTitle(long groupId, long folderId,
446 long fileEntryId, java.lang.String title, java.lang.String extension)
447 throws PortalException;
448
449
455 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
456
457
469 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
470 int end);
471
472
485 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
486 int end, OrderByComparator<T> orderByComparator);
487
488 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
489 public List<DLFileEntry> getDDMStructureFileEntries(long groupId,
490 long[] ddmStructureIds);
491
492 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
493 public List<DLFileEntry> getDDMStructureFileEntries(long[] ddmStructureIds);
494
495
506 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
507 public List<DLFileEntry> getDLFileEntries(int start, int end);
508
509
516 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
517 public List<DLFileEntry> getDLFileEntriesByUuidAndCompanyId(
518 java.lang.String uuid, long companyId);
519
520
530 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
531 public List<DLFileEntry> getDLFileEntriesByUuidAndCompanyId(
532 java.lang.String uuid, long companyId, int start, int end,
533 OrderByComparator<DLFileEntry> orderByComparator);
534
535 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
536 public List<DLFileEntry> getExtraSettingsFileEntries(int start, int end);
537
538 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
539 public List<DLFileEntry> getFileEntries(int start, int end);
540
541 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
542 public List<DLFileEntry> getFileEntries(long folderId, java.lang.String name);
543
544 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
545 public List<DLFileEntry> getFileEntries(long groupId, long folderId);
546
547 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
548 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
549 int start, int end, OrderByComparator<DLFileEntry> obc);
550
551 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
552 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
553 int status, int start, int end, OrderByComparator<DLFileEntry> obc);
554
555 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
556 public List<DLFileEntry> getFileEntries(long groupId, long userId,
557 List<java.lang.Long> folderIds, java.lang.String[] mimeTypes,
558 QueryDefinition<DLFileEntry> queryDefinition)
559 throws java.lang.Exception;
560
561 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
562 public List<DLFileEntry> getFileEntries(long groupId, long userId,
563 List<java.lang.Long> repositoryIds, List<java.lang.Long> folderIds,
564 java.lang.String[] mimeTypes,
565 QueryDefinition<DLFileEntry> queryDefinition)
566 throws java.lang.Exception;
567
568 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
569 public List<DLFileEntry> getGroupFileEntries(long groupId, int start,
570 int end);
571
572 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
573 public List<DLFileEntry> getGroupFileEntries(long groupId, int start,
574 int end, OrderByComparator<DLFileEntry> obc);
575
576 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
577 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
578 int start, int end);
579
580 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
581 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
582 int start, int end, OrderByComparator<DLFileEntry> obc);
583
584 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
585 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
586 long repositoryId, long rootFolderId, int start, int end,
587 OrderByComparator<DLFileEntry> obc);
588
589 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
590 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
591 long rootFolderId, int start, int end,
592 OrderByComparator<DLFileEntry> obc);
593
594 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
595 public List<DLFileEntry> getMisversionedFileEntries();
596
597 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
598 public List<DLFileEntry> getNoAssetFileEntries();
599
600 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
601 public List<DLFileEntry> getOrphanedFileEntries();
602
603 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
604 public List<DLFileEntry> getRepositoryFileEntries(long repositoryId,
605 int start, int end);
606
607
613 public long dynamicQueryCount(DynamicQuery dynamicQuery);
614
615
622 public long dynamicQueryCount(DynamicQuery dynamicQuery,
623 Projection projection);
624
625 public void checkInFileEntry(long userId, long fileEntryId,
626 boolean majorVersion, java.lang.String changeLog,
627 ServiceContext serviceContext) throws PortalException;
628
629 public void checkInFileEntry(long userId, long fileEntryId,
630 java.lang.String lockUuid, ServiceContext serviceContext)
631 throws PortalException;
632
633 public void convertExtraSettings(java.lang.String[] keys)
634 throws PortalException;
635
636 public void copyFileEntryMetadata(long companyId, long fileEntryTypeId,
637 long fileEntryId, long fromFileVersionId, long toFileVersionId,
638 ServiceContext serviceContext) throws PortalException;
639
640 public void deleteFileEntries(long groupId, long folderId)
641 throws PortalException;
642
643 public void deleteFileEntries(long groupId, long folderId,
644 boolean includeTrashedEntries) throws PortalException;
645
646 public void deleteRepositoryFileEntries(long repositoryId, long folderId)
647 throws PortalException;
648
649 public void deleteRepositoryFileEntries(long repositoryId, long folderId,
650 boolean includeTrashedEntries) throws PortalException;
651
652 @BufferedIncrement(configuration = "DLFileEntry", incrementClass = com.liferay.portal.kernel.increment.NumberIncrement.class)
653 public void incrementViewCounter(DLFileEntry dlFileEntry, int increment);
654
655 public void rebuildTree(long companyId) throws PortalException;
656
657 public void revertFileEntry(long userId, long fileEntryId,
658 java.lang.String version, ServiceContext serviceContext)
659 throws PortalException;
660
661 public void setTreePaths(long folderId, java.lang.String treePath,
662 boolean reindex) throws PortalException;
663
664 public void unlockFileEntry(long fileEntryId);
665
666 public void updateSmallImage(long smallImageId, long largeImageId)
667 throws PortalException;
668
669 public void validateFile(long groupId, long folderId, long fileEntryId,
670 java.lang.String fileName, java.lang.String title)
671 throws PortalException;
672 }