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
081
087 @Indexable(type = IndexableType.REINDEX)
088 public DLFileEntry addDLFileEntry(DLFileEntry dlFileEntry);
089
090 public DLFileEntry addFileEntry(long userId, long groupId,
091 long repositoryId, long folderId, java.lang.String sourceFileName,
092 java.lang.String mimeType, java.lang.String title,
093 java.lang.String description, java.lang.String changeLog,
094 long fileEntryTypeId,
095 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, File file,
096 InputStream is, long size, ServiceContext serviceContext)
097 throws PortalException;
098
099 public DLFileVersion cancelCheckOut(long userId, long fileEntryId)
100 throws PortalException;
101
102 public void checkInFileEntry(long userId, long fileEntryId,
103 java.lang.String lockUuid, ServiceContext serviceContext)
104 throws PortalException;
105
106 public void checkInFileEntry(long userId, long fileEntryId,
107 boolean majorVersion, java.lang.String changeLog,
108 ServiceContext serviceContext) throws PortalException;
109
110 public DLFileEntry checkOutFileEntry(long userId, long fileEntryId,
111 java.lang.String owner, long expirationTime,
112 ServiceContext serviceContext) throws PortalException;
113
114 public DLFileEntry checkOutFileEntry(long userId, long fileEntryId,
115 ServiceContext serviceContext) throws PortalException;
116
117 public void convertExtraSettings(java.lang.String[] keys)
118 throws PortalException;
119
120 public DLFileEntry copyFileEntry(long userId, long groupId,
121 long repositoryId, long fileEntryId, long destFolderId,
122 ServiceContext serviceContext) throws PortalException;
123
124 public void copyFileEntryMetadata(long companyId, long fileEntryTypeId,
125 long fileEntryId, long fromFileVersionId, long toFileVersionId,
126 ServiceContext serviceContext) throws PortalException;
127
128
134 public DLFileEntry createDLFileEntry(long fileEntryId);
135
136
142 @Indexable(type = IndexableType.DELETE)
143 public DLFileEntry deleteDLFileEntry(DLFileEntry dlFileEntry);
144
145
152 @Indexable(type = IndexableType.DELETE)
153 public DLFileEntry deleteDLFileEntry(long fileEntryId)
154 throws PortalException;
155
156 public void deleteFileEntries(long groupId, long folderId)
157 throws PortalException;
158
159 public void deleteFileEntries(long groupId, long folderId,
160 boolean includeTrashedEntries) throws PortalException;
161
162 @Indexable(type = IndexableType.DELETE)
163 @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
164 public DLFileEntry deleteFileEntry(DLFileEntry dlFileEntry)
165 throws PortalException;
166
167 @Indexable(type = IndexableType.DELETE)
168 public DLFileEntry deleteFileEntry(long fileEntryId)
169 throws PortalException;
170
171 @Indexable(type = IndexableType.DELETE)
172 public DLFileEntry deleteFileEntry(long userId, long fileEntryId)
173 throws PortalException;
174
175 @Indexable(type = IndexableType.REINDEX)
176 public DLFileEntry deleteFileVersion(long userId, long fileEntryId,
177 java.lang.String version) throws PortalException;
178
179
182 @Override
183 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
184 throws PortalException;
185
186 public void deleteRepositoryFileEntries(long repositoryId, long folderId)
187 throws PortalException;
188
189 public void deleteRepositoryFileEntries(long repositoryId, long folderId,
190 boolean includeTrashedEntries) throws PortalException;
191
192 public DynamicQuery dynamicQuery();
193
194
200 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
201
202
214 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
215 int end);
216
217
230 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
231 int end, OrderByComparator<T> orderByComparator);
232
233
239 public long dynamicQueryCount(DynamicQuery dynamicQuery);
240
241
248 public long dynamicQueryCount(DynamicQuery dynamicQuery,
249 Projection projection);
250
251 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
252 public DLFileEntry fetchDLFileEntry(long fileEntryId);
253
254
261 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
262 public DLFileEntry fetchDLFileEntryByUuidAndGroupId(java.lang.String uuid,
263 long groupId);
264
265 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
266 public DLFileEntry fetchFileEntry(long groupId, long folderId,
267 java.lang.String title);
268
269 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270 public DLFileEntry fetchFileEntryByAnyImageId(long imageId);
271
272 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
273 public DLFileEntry fetchFileEntryByFileName(long groupId, long folderId,
274 java.lang.String fileName);
275
276 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277 public DLFileEntry fetchFileEntryByName(long groupId, long folderId,
278 java.lang.String name);
279
280 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
281 public ActionableDynamicQuery getActionableDynamicQuery();
282
283 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
284 public List<DLFileEntry> getDDMStructureFileEntries(long[] ddmStructureIds);
285
286 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287 public List<DLFileEntry> getDDMStructureFileEntries(long groupId,
288 long[] ddmStructureIds);
289
290
301 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
302 public List<DLFileEntry> getDLFileEntries(int start, int end);
303
304
311 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
312 public List<DLFileEntry> getDLFileEntriesByUuidAndCompanyId(
313 java.lang.String uuid, long companyId);
314
315
325 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
326 public List<DLFileEntry> getDLFileEntriesByUuidAndCompanyId(
327 java.lang.String uuid, long companyId, int start, int end,
328 OrderByComparator<DLFileEntry> orderByComparator);
329
330
335 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
336 public int getDLFileEntriesCount();
337
338
345 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
346 public DLFileEntry getDLFileEntry(long fileEntryId)
347 throws PortalException;
348
349
357 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
358 public DLFileEntry getDLFileEntryByUuidAndGroupId(java.lang.String uuid,
359 long groupId) throws PortalException;
360
361 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
362 public ExportActionableDynamicQuery getExportActionableDynamicQuery(
363 PortletDataContext portletDataContext);
364
365 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
366 public List<DLFileEntry> getExtraSettingsFileEntries(int start, int end);
367
368 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
369 public int getExtraSettingsFileEntriesCount();
370
371 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
372 public File getFile(long fileEntryId, java.lang.String version,
373 boolean incrementCounter) throws PortalException;
374
375 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
376 public File getFile(long fileEntryId, java.lang.String version,
377 boolean incrementCounter, int increment) throws PortalException;
378
379
383 @java.lang.Deprecated
384 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
385 public File getFile(long userId, long fileEntryId,
386 java.lang.String version, boolean incrementCounter)
387 throws PortalException;
388
389
393 @java.lang.Deprecated
394 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
395 public File getFile(long userId, long fileEntryId,
396 java.lang.String version, boolean incrementCounter, int increment)
397 throws PortalException;
398
399 public InputStream getFileAsStream(long fileEntryId,
400 java.lang.String version) throws PortalException;
401
402 public InputStream getFileAsStream(long fileEntryId,
403 java.lang.String version, boolean incrementCounter)
404 throws PortalException;
405
406 public InputStream getFileAsStream(long fileEntryId,
407 java.lang.String version, boolean incrementCounter, int increment)
408 throws PortalException;
409
410
414 @java.lang.Deprecated
415 public InputStream getFileAsStream(long userId, long fileEntryId,
416 java.lang.String version) throws PortalException;
417
418
422 @java.lang.Deprecated
423 public InputStream getFileAsStream(long userId, long fileEntryId,
424 java.lang.String version, boolean incrementCounter)
425 throws PortalException;
426
427
431 @java.lang.Deprecated
432 public InputStream getFileAsStream(long userId, long fileEntryId,
433 java.lang.String version, boolean incrementCounter, int increment)
434 throws PortalException;
435
436 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
437 public List<DLFileEntry> getFileEntries(long folderId, java.lang.String name);
438
439 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
440 public List<DLFileEntry> getFileEntries(long groupId, long folderId);
441
442 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
443 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
444 int start, int end, OrderByComparator<DLFileEntry> obc);
445
446 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
447 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
448 int status, int start, int end, OrderByComparator<DLFileEntry> obc);
449
450 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
451 public List<DLFileEntry> getFileEntries(long groupId, long userId,
452 List<java.lang.Long> folderIds, java.lang.String[] mimeTypes,
453 QueryDefinition<DLFileEntry> queryDefinition)
454 throws java.lang.Exception;
455
456 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
457 public List<DLFileEntry> getFileEntries(long groupId, long userId,
458 List<java.lang.Long> repositoryIds, List<java.lang.Long> folderIds,
459 java.lang.String[] mimeTypes,
460 QueryDefinition<DLFileEntry> queryDefinition)
461 throws java.lang.Exception;
462
463 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
464 public List<DLFileEntry> getFileEntries(int start, int end);
465
466 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
467 public int getFileEntriesCount();
468
469
472 @java.lang.Deprecated
473 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
474 public int getFileEntriesCount(long groupId, DateRange dateRange,
475 long repositoryId, QueryDefinition<DLFileEntry> queryDefinition);
476
477 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
478 public int getFileEntriesCount(long groupId, long folderId);
479
480 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
481 public int getFileEntriesCount(long groupId, long folderId, int status);
482
483 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
484 public int getFileEntriesCount(long groupId, long userId,
485 List<java.lang.Long> folderIds, java.lang.String[] mimeTypes,
486 QueryDefinition<DLFileEntry> queryDefinition)
487 throws java.lang.Exception;
488
489 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
490 public int getFileEntriesCount(long groupId, long userId,
491 List<java.lang.Long> repositoryIds, List<java.lang.Long> folderIds,
492 java.lang.String[] mimeTypes,
493 QueryDefinition<DLFileEntry> queryDefinition)
494 throws java.lang.Exception;
495
496 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
497 public DLFileEntry getFileEntry(long fileEntryId) throws PortalException;
498
499 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
500 public DLFileEntry getFileEntry(long groupId, long folderId,
501 java.lang.String title) throws PortalException;
502
503 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
504 public DLFileEntry getFileEntryByName(long groupId, long folderId,
505 java.lang.String name) throws PortalException;
506
507 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
508 public DLFileEntry getFileEntryByUuidAndGroupId(java.lang.String uuid,
509 long groupId) throws PortalException;
510
511 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
512 public List<DLFileEntry> getGroupFileEntries(long groupId, int start,
513 int end);
514
515 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
516 public List<DLFileEntry> getGroupFileEntries(long groupId, int start,
517 int end, OrderByComparator<DLFileEntry> obc);
518
519 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
520 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
521 long repositoryId, long rootFolderId, int start, int end,
522 OrderByComparator<DLFileEntry> obc);
523
524 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
525 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
526 long rootFolderId, int start, int end,
527 OrderByComparator<DLFileEntry> obc);
528
529 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
530 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
531 int start, int end);
532
533 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
534 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
535 int start, int end, OrderByComparator<DLFileEntry> obc);
536
537 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
538 public int getGroupFileEntriesCount(long groupId);
539
540 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
541 public int getGroupFileEntriesCount(long groupId, long userId);
542
543 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
544 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
545
546 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
547 public List<DLFileEntry> getMisversionedFileEntries();
548
549 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
550 public List<DLFileEntry> getNoAssetFileEntries();
551
552
557 public java.lang.String getOSGiServiceIdentifier();
558
559 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
560 public List<DLFileEntry> getOrphanedFileEntries();
561
562 @Override
563 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
564 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
565 throws PortalException;
566
567 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
568 public List<DLFileEntry> getRepositoryFileEntries(long repositoryId,
569 int start, int end);
570
571 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
572 public int getRepositoryFileEntriesCount(long repositoryId);
573
574 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
575 public java.lang.String getUniqueTitle(long groupId, long folderId,
576 long fileEntryId, java.lang.String title, java.lang.String extension)
577 throws PortalException;
578
579 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
580 public boolean hasExtraSettings();
581
582 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
583 public boolean hasFileEntryLock(long userId, long fileEntryId)
584 throws PortalException;
585
586 @BufferedIncrement(configuration = "DLFileEntry", incrementClass = com.liferay.portal.kernel.increment.NumberIncrement.class)
587 public void incrementViewCounter(DLFileEntry dlFileEntry, int increment);
588
589 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
590 public boolean isFileEntryCheckedOut(long fileEntryId)
591 throws PortalException;
592
593 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
594 public boolean isKeepFileVersionLabel(long fileEntryId,
595 boolean majorVersion, ServiceContext serviceContext)
596 throws PortalException;
597
598
602 @java.lang.Deprecated
603 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
604 public boolean isKeepFileVersionLabel(long fileEntryId,
605 ServiceContext serviceContext) throws PortalException;
606
607 public Lock lockFileEntry(long userId, long fileEntryId)
608 throws PortalException;
609
610 @Indexable(type = IndexableType.REINDEX)
611 public DLFileEntry moveFileEntry(long userId, long fileEntryId,
612 long newFolderId, ServiceContext serviceContext)
613 throws PortalException;
614
615 public void rebuildTree(long companyId) throws PortalException;
616
617 public void revertFileEntry(long userId, long fileEntryId,
618 java.lang.String version, ServiceContext serviceContext)
619 throws PortalException;
620
621 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
622 public Hits search(long groupId, long userId, long creatorUserId,
623 long folderId, java.lang.String[] mimeTypes, int status, int start,
624 int end) throws PortalException;
625
626 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
627 public Hits search(long groupId, long userId, long creatorUserId,
628 int status, int start, int end) throws PortalException;
629
630 public void setTreePaths(long folderId, java.lang.String treePath,
631 boolean reindex) throws PortalException;
632
633 public void unlockFileEntry(long fileEntryId);
634
635
641 @Indexable(type = IndexableType.REINDEX)
642 public DLFileEntry updateDLFileEntry(DLFileEntry dlFileEntry);
643
644 public DLFileEntry updateFileEntry(long userId, long fileEntryId,
645 java.lang.String sourceFileName, java.lang.String mimeType,
646 java.lang.String title, java.lang.String description,
647 java.lang.String changeLog, boolean majorVersion, long fileEntryTypeId,
648 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, File file,
649 InputStream is, long size, ServiceContext serviceContext)
650 throws PortalException;
651
652 public DLFileEntry updateFileEntryType(long userId, long fileEntryId,
653 long fileEntryTypeId, ServiceContext serviceContext)
654 throws PortalException;
655
656 public void updateSmallImage(long smallImageId, long largeImageId)
657 throws PortalException;
658
659 public DLFileEntry updateStatus(long userId, long fileVersionId,
660 int status, ServiceContext serviceContext,
661 Map<java.lang.String, Serializable> workflowContext)
662 throws PortalException;
663
664 public void validateFile(long groupId, long folderId, long fileEntryId,
665 java.lang.String fileName, java.lang.String title)
666 throws PortalException;
667
668 public boolean verifyFileEntryCheckOut(long fileEntryId,
669 java.lang.String lockUuid) throws PortalException;
670
671 public boolean verifyFileEntryLock(long fileEntryId,
672 java.lang.String lockUuid) throws PortalException;
673 }