001
014
015 package com.liferay.portlet.documentlibrary.service;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.dynamic.data.mapping.kernel.DDMFormValues;
020
021 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
022 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023 import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
024 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
025 import com.liferay.portal.kernel.dao.orm.Projection;
026 import com.liferay.portal.kernel.dao.orm.QueryDefinition;
027 import com.liferay.portal.kernel.exception.PortalException;
028 import com.liferay.portal.kernel.exception.SystemException;
029 import com.liferay.portal.kernel.increment.BufferedIncrement;
030 import com.liferay.portal.kernel.lock.Lock;
031 import com.liferay.portal.kernel.search.Hits;
032 import com.liferay.portal.kernel.search.Indexable;
033 import com.liferay.portal.kernel.search.IndexableType;
034 import com.liferay.portal.kernel.systemevent.SystemEvent;
035 import com.liferay.portal.kernel.transaction.Isolation;
036 import com.liferay.portal.kernel.transaction.Propagation;
037 import com.liferay.portal.kernel.transaction.Transactional;
038 import com.liferay.portal.kernel.util.DateRange;
039 import com.liferay.portal.kernel.util.OrderByComparator;
040 import com.liferay.portal.model.PersistedModel;
041 import com.liferay.portal.model.SystemEventConstants;
042 import com.liferay.portal.service.BaseLocalService;
043 import com.liferay.portal.service.PersistedModelLocalService;
044 import com.liferay.portal.service.ServiceContext;
045
046 import com.liferay.portlet.documentlibrary.model.DLFileEntry;
047 import com.liferay.portlet.documentlibrary.model.DLFileVersion;
048 import com.liferay.portlet.exportimport.lar.PortletDataContext;
049
050 import java.io.File;
051 import java.io.InputStream;
052 import java.io.Serializable;
053
054 import java.util.List;
055 import java.util.Map;
056
057
069 @ProviderType
070 @Transactional(isolation = Isolation.PORTAL, rollbackFor = {
071 PortalException.class, SystemException.class})
072 public interface DLFileEntryLocalService extends BaseLocalService,
073 PersistedModelLocalService {
074
079
080
086 @Indexable(type = IndexableType.REINDEX)
087 public DLFileEntry addDLFileEntry(DLFileEntry dlFileEntry);
088
089 public DLFileEntry addFileEntry(long userId, long groupId,
090 long repositoryId, long folderId, java.lang.String sourceFileName,
091 java.lang.String mimeType, java.lang.String title,
092 java.lang.String description, java.lang.String changeLog,
093 long fileEntryTypeId,
094 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, File file,
095 InputStream is, long size, ServiceContext serviceContext)
096 throws PortalException;
097
098 public DLFileVersion cancelCheckOut(long userId, long fileEntryId)
099 throws PortalException;
100
101 public void checkInFileEntry(long userId, long fileEntryId,
102 java.lang.String lockUuid, ServiceContext serviceContext)
103 throws PortalException;
104
105 public void checkInFileEntry(long userId, long fileEntryId,
106 boolean majorVersion, java.lang.String changeLog,
107 ServiceContext serviceContext) throws PortalException;
108
109 public DLFileEntry checkOutFileEntry(long userId, long fileEntryId,
110 java.lang.String owner, long expirationTime,
111 ServiceContext serviceContext) throws PortalException;
112
113 public DLFileEntry checkOutFileEntry(long userId, long fileEntryId,
114 ServiceContext serviceContext) throws PortalException;
115
116 public void convertExtraSettings(java.lang.String[] keys)
117 throws PortalException;
118
119 public DLFileEntry copyFileEntry(long userId, long groupId,
120 long repositoryId, long fileEntryId, long destFolderId,
121 ServiceContext serviceContext) throws PortalException;
122
123 public void copyFileEntryMetadata(long companyId, long fileEntryTypeId,
124 long fileEntryId, long fromFileVersionId, long toFileVersionId,
125 ServiceContext serviceContext) throws PortalException;
126
127
133 public DLFileEntry createDLFileEntry(long fileEntryId);
134
135
141 @Indexable(type = IndexableType.DELETE)
142 public DLFileEntry deleteDLFileEntry(DLFileEntry dlFileEntry);
143
144
151 @Indexable(type = IndexableType.DELETE)
152 public DLFileEntry deleteDLFileEntry(long fileEntryId)
153 throws PortalException;
154
155 public void deleteFileEntries(long groupId, long folderId)
156 throws PortalException;
157
158 public void deleteFileEntries(long groupId, long folderId,
159 boolean includeTrashedEntries) throws PortalException;
160
161 @Indexable(type = IndexableType.DELETE)
162 @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
163 public DLFileEntry deleteFileEntry(DLFileEntry dlFileEntry)
164 throws PortalException;
165
166 @Indexable(type = IndexableType.DELETE)
167 public DLFileEntry deleteFileEntry(long fileEntryId)
168 throws PortalException;
169
170 @Indexable(type = IndexableType.DELETE)
171 public DLFileEntry deleteFileEntry(long userId, long fileEntryId)
172 throws PortalException;
173
174 @Indexable(type = IndexableType.REINDEX)
175 public DLFileEntry deleteFileVersion(long userId, long fileEntryId,
176 java.lang.String version) throws PortalException;
177
178
181 @Override
182 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
183 throws PortalException;
184
185 public void deleteRepositoryFileEntries(long repositoryId, long folderId)
186 throws PortalException;
187
188 public void deleteRepositoryFileEntries(long repositoryId, long folderId,
189 boolean includeTrashedEntries) throws PortalException;
190
191 public DynamicQuery dynamicQuery();
192
193
199 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
200
201
213 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
214 int end);
215
216
229 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
230 int end, OrderByComparator<T> orderByComparator);
231
232
238 public long dynamicQueryCount(DynamicQuery dynamicQuery);
239
240
247 public long dynamicQueryCount(DynamicQuery dynamicQuery,
248 Projection projection);
249
250 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251 public DLFileEntry fetchDLFileEntry(long fileEntryId);
252
253
260 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261 public DLFileEntry fetchDLFileEntryByUuidAndGroupId(java.lang.String uuid,
262 long groupId);
263
264 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
265 public DLFileEntry fetchFileEntry(long groupId, long folderId,
266 java.lang.String title);
267
268 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
269 public DLFileEntry fetchFileEntryByAnyImageId(long imageId);
270
271 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
272 public DLFileEntry fetchFileEntryByFileName(long groupId, long folderId,
273 java.lang.String fileName);
274
275 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
276 public DLFileEntry fetchFileEntryByName(long groupId, long folderId,
277 java.lang.String name);
278
279 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
280 public ActionableDynamicQuery getActionableDynamicQuery();
281
282 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
283 public List<DLFileEntry> getDDMStructureFileEntries(long[] ddmStructureIds);
284
285 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
286 public List<DLFileEntry> getDDMStructureFileEntries(long groupId,
287 long[] ddmStructureIds);
288
289
300 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
301 public List<DLFileEntry> getDLFileEntries(int start, int end);
302
303
310 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
311 public List<DLFileEntry> getDLFileEntriesByUuidAndCompanyId(
312 java.lang.String uuid, long companyId);
313
314
324 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
325 public List<DLFileEntry> getDLFileEntriesByUuidAndCompanyId(
326 java.lang.String uuid, long companyId, int start, int end,
327 OrderByComparator<DLFileEntry> orderByComparator);
328
329
334 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
335 public int getDLFileEntriesCount();
336
337
344 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
345 public DLFileEntry getDLFileEntry(long fileEntryId)
346 throws PortalException;
347
348
356 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
357 public DLFileEntry getDLFileEntryByUuidAndGroupId(java.lang.String uuid,
358 long groupId) throws PortalException;
359
360 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
361 public ExportActionableDynamicQuery getExportActionableDynamicQuery(
362 PortletDataContext portletDataContext);
363
364 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
365 public List<DLFileEntry> getExtraSettingsFileEntries(int start, int end);
366
367 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
368 public int getExtraSettingsFileEntriesCount();
369
370 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
371 public File getFile(long fileEntryId, java.lang.String version,
372 boolean incrementCounter) throws PortalException;
373
374 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
375 public File getFile(long fileEntryId, java.lang.String version,
376 boolean incrementCounter, int increment) throws PortalException;
377
378
382 @java.lang.Deprecated
383 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
384 public File getFile(long userId, long fileEntryId,
385 java.lang.String version, boolean incrementCounter)
386 throws PortalException;
387
388
392 @java.lang.Deprecated
393 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
394 public File getFile(long userId, long fileEntryId,
395 java.lang.String version, boolean incrementCounter, int increment)
396 throws PortalException;
397
398 public InputStream getFileAsStream(long fileEntryId,
399 java.lang.String version) throws PortalException;
400
401 public InputStream getFileAsStream(long fileEntryId,
402 java.lang.String version, boolean incrementCounter)
403 throws PortalException;
404
405 public InputStream getFileAsStream(long fileEntryId,
406 java.lang.String version, boolean incrementCounter, int increment)
407 throws PortalException;
408
409
413 @java.lang.Deprecated
414 public InputStream getFileAsStream(long userId, long fileEntryId,
415 java.lang.String version) throws PortalException;
416
417
421 @java.lang.Deprecated
422 public InputStream getFileAsStream(long userId, long fileEntryId,
423 java.lang.String version, boolean incrementCounter)
424 throws PortalException;
425
426
430 @java.lang.Deprecated
431 public InputStream getFileAsStream(long userId, long fileEntryId,
432 java.lang.String version, boolean incrementCounter, int increment)
433 throws PortalException;
434
435 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
436 public List<DLFileEntry> getFileEntries(long folderId, java.lang.String name);
437
438 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
439 public List<DLFileEntry> getFileEntries(long groupId, long folderId);
440
441 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
442 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
443 int start, int end, OrderByComparator<DLFileEntry> obc);
444
445 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
446 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
447 int status, int start, int end, OrderByComparator<DLFileEntry> obc);
448
449 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
450 public List<DLFileEntry> getFileEntries(long groupId, long userId,
451 List<java.lang.Long> folderIds, java.lang.String[] mimeTypes,
452 QueryDefinition<DLFileEntry> queryDefinition)
453 throws java.lang.Exception;
454
455 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
456 public List<DLFileEntry> getFileEntries(long groupId, long userId,
457 List<java.lang.Long> repositoryIds, List<java.lang.Long> folderIds,
458 java.lang.String[] mimeTypes,
459 QueryDefinition<DLFileEntry> queryDefinition)
460 throws java.lang.Exception;
461
462 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
463 public List<DLFileEntry> getFileEntries(int start, int end);
464
465 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
466 public int getFileEntriesCount();
467
468
471 @java.lang.Deprecated
472 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
473 public int getFileEntriesCount(long groupId, DateRange dateRange,
474 long repositoryId, QueryDefinition<DLFileEntry> queryDefinition);
475
476 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
477 public int getFileEntriesCount(long groupId, long folderId);
478
479 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
480 public int getFileEntriesCount(long groupId, long folderId, int status);
481
482 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
483 public int getFileEntriesCount(long groupId, long userId,
484 List<java.lang.Long> folderIds, java.lang.String[] mimeTypes,
485 QueryDefinition<DLFileEntry> queryDefinition)
486 throws java.lang.Exception;
487
488 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
489 public int getFileEntriesCount(long groupId, long userId,
490 List<java.lang.Long> repositoryIds, List<java.lang.Long> folderIds,
491 java.lang.String[] mimeTypes,
492 QueryDefinition<DLFileEntry> queryDefinition)
493 throws java.lang.Exception;
494
495 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
496 public DLFileEntry getFileEntry(long fileEntryId) throws PortalException;
497
498 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
499 public DLFileEntry getFileEntry(long groupId, long folderId,
500 java.lang.String title) throws PortalException;
501
502 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
503 public DLFileEntry getFileEntryByName(long groupId, long folderId,
504 java.lang.String name) throws PortalException;
505
506 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
507 public DLFileEntry getFileEntryByUuidAndGroupId(java.lang.String uuid,
508 long groupId) throws PortalException;
509
510 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
511 public List<DLFileEntry> getGroupFileEntries(long groupId, int start,
512 int end);
513
514 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
515 public List<DLFileEntry> getGroupFileEntries(long groupId, int start,
516 int end, OrderByComparator<DLFileEntry> obc);
517
518 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
519 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
520 long repositoryId, long rootFolderId, int start, int end,
521 OrderByComparator<DLFileEntry> obc);
522
523 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
524 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
525 long rootFolderId, int start, int end,
526 OrderByComparator<DLFileEntry> obc);
527
528 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
529 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
530 int start, int end);
531
532 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
533 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
534 int start, int end, OrderByComparator<DLFileEntry> obc);
535
536 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
537 public int getGroupFileEntriesCount(long groupId);
538
539 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
540 public int getGroupFileEntriesCount(long groupId, long userId);
541
542 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
543 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
544
545 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
546 public List<DLFileEntry> getMisversionedFileEntries();
547
548 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
549 public List<DLFileEntry> getNoAssetFileEntries();
550
551
556 public java.lang.String getOSGiServiceIdentifier();
557
558 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
559 public List<DLFileEntry> getOrphanedFileEntries();
560
561 @Override
562 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
563 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
564 throws PortalException;
565
566 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
567 public List<DLFileEntry> getRepositoryFileEntries(long repositoryId,
568 int start, int end);
569
570 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
571 public int getRepositoryFileEntriesCount(long repositoryId);
572
573 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
574 public java.lang.String getUniqueTitle(long groupId, long folderId,
575 long fileEntryId, java.lang.String title, java.lang.String extension)
576 throws PortalException;
577
578 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
579 public boolean hasExtraSettings();
580
581 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
582 public boolean hasFileEntryLock(long userId, long fileEntryId)
583 throws PortalException;
584
585 @BufferedIncrement(configuration = "DLFileEntry", incrementClass = com.liferay.portal.kernel.increment.NumberIncrement.class)
586 public void incrementViewCounter(DLFileEntry dlFileEntry, int increment);
587
588 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
589 public boolean isFileEntryCheckedOut(long fileEntryId)
590 throws PortalException;
591
592 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
593 public boolean isKeepFileVersionLabel(long fileEntryId,
594 ServiceContext serviceContext) throws PortalException;
595
596 public Lock lockFileEntry(long userId, long fileEntryId)
597 throws PortalException;
598
599 @Indexable(type = IndexableType.REINDEX)
600 public DLFileEntry moveFileEntry(long userId, long fileEntryId,
601 long newFolderId, ServiceContext serviceContext)
602 throws PortalException;
603
604 public void rebuildTree(long companyId) throws PortalException;
605
606 public void revertFileEntry(long userId, long fileEntryId,
607 java.lang.String version, ServiceContext serviceContext)
608 throws PortalException;
609
610 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
611 public Hits search(long groupId, long userId, long creatorUserId,
612 long folderId, java.lang.String[] mimeTypes, int status, int start,
613 int end) throws PortalException;
614
615 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
616 public Hits search(long groupId, long userId, long creatorUserId,
617 int status, int start, int end) throws PortalException;
618
619 public void setTreePaths(long folderId, java.lang.String treePath,
620 boolean reindex) throws PortalException;
621
622 public void unlockFileEntry(long fileEntryId);
623
624
630 @Indexable(type = IndexableType.REINDEX)
631 public DLFileEntry updateDLFileEntry(DLFileEntry dlFileEntry);
632
633 public DLFileEntry updateFileEntry(long userId, long fileEntryId,
634 java.lang.String sourceFileName, java.lang.String mimeType,
635 java.lang.String title, java.lang.String description,
636 java.lang.String changeLog, boolean majorVersion, long fileEntryTypeId,
637 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, File file,
638 InputStream is, long size, ServiceContext serviceContext)
639 throws PortalException;
640
641 public DLFileEntry updateFileEntryType(long userId, long fileEntryId,
642 long fileEntryTypeId, ServiceContext serviceContext)
643 throws PortalException;
644
645 public void updateSmallImage(long smallImageId, long largeImageId)
646 throws PortalException;
647
648 public DLFileEntry updateStatus(long userId, long fileVersionId,
649 int status, ServiceContext serviceContext,
650 Map<java.lang.String, Serializable> workflowContext)
651 throws PortalException;
652
653 public void validateFile(long groupId, long folderId, long fileEntryId,
654 java.lang.String fileName, java.lang.String title)
655 throws PortalException;
656
657 public boolean verifyFileEntryCheckOut(long fileEntryId,
658 java.lang.String lockUuid) throws PortalException;
659
660 public boolean verifyFileEntryLock(long fileEntryId,
661 java.lang.String lockUuid) throws PortalException;
662 }