Class DefaultLocalRepositoryImpl
Object
com.liferay.portal.kernel.repository.DefaultLocalRepositoryImpl
- All Implemented Interfaces:
CapabilityProvider
,DocumentRepository
,LocalRepository
This class is designed for third party repository implementations. Since the
paradigm of remote and local services exists only within Liferay, the
assumption is that all permission checking will be delegated to the specific
repository.
There are also many calls within this class that pass in a user ID as a
parameter. These methods should only be called for administration of Liferay
repositories and are hence not supported in all third party repositories.
This includes moving between document library hooks and LAR import/export.
Calling these methods will throw an
UnsupportedOperationException
.- Author:
- Alexander Chow
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFileEntry
(String externalReferenceCode, long userId, long folderId, String sourceFileName, String mimeType, String title, String urlTitle, String description, String changeLog, File file, Date displayDate, Date expirationDate, Date reviewDate, ServiceContext serviceContext) addFileEntry
(String externalReferenceCode, long userId, long folderId, String sourceFileName, String mimeType, String title, String urlTitle, String description, String changeLog, InputStream inputStream, long size, Date displayDate, Date expirationDate, Date reviewDate, ServiceContext serviceContext) addFileShortcut
(String externalReferenceCode, long userId, long folderId, long toFileEntryId, ServiceContext serviceContext) addFolder
(String externalReferenceCode, long userId, long parentFolderId, String name, String description, ServiceContext serviceContext) void
checkInFileEntry
(long userId, long fileEntryId, DLVersionNumberIncrease dlVersionNumberIncrease, String changeLog, ServiceContext serviceContext) void
checkInFileEntry
(long userId, long fileEntryId, String lockUuid, ServiceContext serviceContext) copyFileEntry
(long userId, long groupId, long fileEntryId, long destFolderId, ServiceContext serviceContext) void
void
deleteFileEntry
(long fileEntryId) void
deleteFileShortcut
(long fileShortcutId) void
deleteFileShortcuts
(long toFileEntryId) void
deleteFileVersion
(long fileVersionId) void
deleteFolder
(long folderId) fetchFileEntry
(long folderId, String title) <T extends Capability>
TgetCapability
(Class<T> capabilityClass) getFileEntries
(long folderId, int status, int start, int end, OrderByComparator<FileEntry> orderByComparator) getFileEntries
(long folderId, int start, int end, OrderByComparator<FileEntry> orderByComparator) getFileEntries
(long folderId, String[] mimeTypes, int status, int start, int end, OrderByComparator<FileEntry> orderByComparator) getFileEntriesAndFileShortcuts
(long folderId, int status, int start, int end) int
getFileEntriesAndFileShortcutsCount
(long folderId, int status) int
getFileEntriesCount
(long folderId) int
getFileEntriesCount
(long folderId, int status) int
getFileEntriesCount
(long folderId, String[] mimeTypes, int status) getFileEntry
(long fileEntryId) getFileEntry
(long folderId, String title) getFileEntryByFileName
(long folderId, String fileName) getFileEntryByUuid
(String uuid) getFileShortcut
(long fileShortcutId) getFileVersion
(long fileVersionId) getFolder
(long folderId) getFolders
(long parentFolderId, boolean includeMountFolders, int start, int end, OrderByComparator<Folder> orderByComparator) getFolders
(long parentFolderId, int status, boolean includeMountFolders, int start, int end, OrderByComparator<Folder> orderByComparator) getFoldersAndFileEntriesAndFileShortcuts
(long folderId, int status, boolean includeMountFolders, int start, int end, OrderByComparator<?> orderByComparator) int
getFoldersAndFileEntriesAndFileShortcutsCount
(long folderId, int status, boolean includeMountFolders) int
getFoldersCount
(long parentFolderId, boolean includeMountfolders) int
getFoldersCount
(long parentFolderId, int status, boolean includeMountfolders) getRepositoryFileEntries
(long userId, long rootFolderId, int start, int end, OrderByComparator<FileEntry> orderByComparator) long
<T extends Capability>
booleanisCapabilityProvided
(Class<T> capabilityClass) moveFileEntry
(long userId, long fileEntryId, long newFolderId, ServiceContext serviceContext) moveFolder
(long userId, long folderId, long parentFolderId, ServiceContext serviceContext) void
revertFileEntry
(long userId, long fileEntryId, String version, ServiceContext serviceContext) updateFileEntry
(long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String urlTitle, String description, String changeLog, DLVersionNumberIncrease dlVersionNumberIncrease, File file, Date displayDate, Date expirationDate, Date reviewDate, ServiceContext serviceContext) updateFileEntry
(long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String urlTitle, String description, String changeLog, DLVersionNumberIncrease dlVersionNumberIncrease, InputStream inputStream, long size, Date displayDate, Date expirationDate, Date reviewDate, ServiceContext serviceContext) updateFileShortcut
(long userId, long fileShortcutId, long folderId, long toFileEntryId, ServiceContext serviceContext) void
updateFileShortcuts
(long oldToFileEntryId, long newToFileEntryId) updateFolder
(long folderId, long parentFolderId, String name, String description, ServiceContext serviceContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.liferay.portal.kernel.repository.DocumentRepository
fetchFileEntryByExternalReferenceCode, fetchFileShortcut, fetchFileShortcutByExternalReferenceCode, fetchFolderByExternalReferenceCode, getFileEntryByExternalReferenceCode, getFileShortcutByExternalReferenceCode, getFolderByExternalReferenceCode
-
Constructor Details
-
DefaultLocalRepositoryImpl
-
-
Method Details
-
addFileEntry
public FileEntry addFileEntry(String externalReferenceCode, long userId, long folderId, String sourceFileName, String mimeType, String title, String urlTitle, String description, String changeLog, File file, Date displayDate, Date expirationDate, Date reviewDate, ServiceContext serviceContext) - Specified by:
addFileEntry
in interfaceDocumentRepository
-
addFileEntry
public FileEntry addFileEntry(String externalReferenceCode, long userId, long folderId, String sourceFileName, String mimeType, String title, String urlTitle, String description, String changeLog, InputStream inputStream, long size, Date displayDate, Date expirationDate, Date reviewDate, ServiceContext serviceContext) - Specified by:
addFileEntry
in interfaceDocumentRepository
-
addFileShortcut
public FileShortcut addFileShortcut(String externalReferenceCode, long userId, long folderId, long toFileEntryId, ServiceContext serviceContext) - Specified by:
addFileShortcut
in interfaceDocumentRepository
-
addFolder
public Folder addFolder(String externalReferenceCode, long userId, long parentFolderId, String name, String description, ServiceContext serviceContext) - Specified by:
addFolder
in interfaceDocumentRepository
-
checkInFileEntry
public void checkInFileEntry(long userId, long fileEntryId, DLVersionNumberIncrease dlVersionNumberIncrease, String changeLog, ServiceContext serviceContext) throws PortalException - Specified by:
checkInFileEntry
in interfaceDocumentRepository
- Throws:
PortalException
-
checkInFileEntry
public void checkInFileEntry(long userId, long fileEntryId, String lockUuid, ServiceContext serviceContext) throws PortalException - Specified by:
checkInFileEntry
in interfaceDocumentRepository
- Throws:
PortalException
-
copyFileEntry
public FileEntry copyFileEntry(long userId, long groupId, long fileEntryId, long destFolderId, ServiceContext serviceContext) throws PortalException - Specified by:
copyFileEntry
in interfaceDocumentRepository
- Throws:
PortalException
-
deleteAll
public void deleteAll()- Specified by:
deleteAll
in interfaceDocumentRepository
-
deleteFileEntry
- Specified by:
deleteFileEntry
in interfaceDocumentRepository
- Throws:
PortalException
-
deleteFileShortcut
- Specified by:
deleteFileShortcut
in interfaceDocumentRepository
- Throws:
PortalException
-
deleteFileShortcuts
- Specified by:
deleteFileShortcuts
in interfaceDocumentRepository
- Throws:
PortalException
-
deleteFileVersion
- Specified by:
deleteFileVersion
in interfaceDocumentRepository
- Throws:
PortalException
-
deleteFolder
- Specified by:
deleteFolder
in interfaceDocumentRepository
- Throws:
PortalException
-
fetchFileEntry
- Specified by:
fetchFileEntry
in interfaceDocumentRepository
- Throws:
PortalException
-
getCapability
- Specified by:
getCapability
in interfaceCapabilityProvider
-
getFileEntries
public List<FileEntry> getFileEntries(long folderId, int status, int start, int end, OrderByComparator<FileEntry> orderByComparator) throws PortalException - Specified by:
getFileEntries
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntries
public List<FileEntry> getFileEntries(long folderId, int start, int end, OrderByComparator<FileEntry> orderByComparator) throws PortalException - Specified by:
getFileEntries
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntries
public List<FileEntry> getFileEntries(long folderId, String[] mimeTypes, int status, int start, int end, OrderByComparator<FileEntry> orderByComparator) throws PortalException - Specified by:
getFileEntries
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntriesAndFileShortcuts
public List<RepositoryEntry> getFileEntriesAndFileShortcuts(long folderId, int status, int start, int end) throws PortalException - Specified by:
getFileEntriesAndFileShortcuts
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntriesAndFileShortcutsCount
- Specified by:
getFileEntriesAndFileShortcutsCount
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntriesCount
- Specified by:
getFileEntriesCount
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntriesCount
- Specified by:
getFileEntriesCount
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntriesCount
public int getFileEntriesCount(long folderId, String[] mimeTypes, int status) throws PortalException - Specified by:
getFileEntriesCount
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntry
- Specified by:
getFileEntry
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntry
- Specified by:
getFileEntry
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntryByFileName
- Specified by:
getFileEntryByFileName
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileEntryByUuid
- Specified by:
getFileEntryByUuid
in interfaceDocumentRepository
- Throws:
PortalException
-
getFileShortcut
- Specified by:
getFileShortcut
in interfaceDocumentRepository
-
getFileVersion
- Specified by:
getFileVersion
in interfaceDocumentRepository
- Throws:
PortalException
-
getFolder
- Specified by:
getFolder
in interfaceDocumentRepository
- Throws:
PortalException
-
getFolder
- Specified by:
getFolder
in interfaceDocumentRepository
- Throws:
PortalException
-
getFolders
public List<Folder> getFolders(long parentFolderId, boolean includeMountFolders, int start, int end, OrderByComparator<Folder> orderByComparator) throws PortalException - Specified by:
getFolders
in interfaceDocumentRepository
- Throws:
PortalException
-
getFolders
public List<Folder> getFolders(long parentFolderId, int status, boolean includeMountFolders, int start, int end, OrderByComparator<Folder> orderByComparator) throws PortalException - Specified by:
getFolders
in interfaceDocumentRepository
- Throws:
PortalException
-
getFoldersAndFileEntriesAndFileShortcuts
public List<RepositoryEntry> getFoldersAndFileEntriesAndFileShortcuts(long folderId, int status, boolean includeMountFolders, int start, int end, OrderByComparator<?> orderByComparator) throws PortalException - Specified by:
getFoldersAndFileEntriesAndFileShortcuts
in interfaceDocumentRepository
- Throws:
PortalException
-
getFoldersAndFileEntriesAndFileShortcutsCount
public int getFoldersAndFileEntriesAndFileShortcutsCount(long folderId, int status, boolean includeMountFolders) throws PortalException - Specified by:
getFoldersAndFileEntriesAndFileShortcutsCount
in interfaceDocumentRepository
- Throws:
PortalException
-
getFoldersCount
- Specified by:
getFoldersCount
in interfaceDocumentRepository
- Throws:
PortalException
-
getFoldersCount
public int getFoldersCount(long parentFolderId, int status, boolean includeMountfolders) throws PortalException - Specified by:
getFoldersCount
in interfaceDocumentRepository
- Throws:
PortalException
-
getRepositoryFileEntries
public List<FileEntry> getRepositoryFileEntries(long userId, long rootFolderId, int start, int end, OrderByComparator<FileEntry> orderByComparator) throws PortalException - Specified by:
getRepositoryFileEntries
in interfaceDocumentRepository
- Throws:
PortalException
-
getRepositoryId
public long getRepositoryId()- Specified by:
getRepositoryId
in interfaceDocumentRepository
-
isCapabilityProvided
- Specified by:
isCapabilityProvided
in interfaceCapabilityProvider
-
moveFileEntry
public FileEntry moveFileEntry(long userId, long fileEntryId, long newFolderId, ServiceContext serviceContext) - Specified by:
moveFileEntry
in interfaceDocumentRepository
-
moveFolder
public Folder moveFolder(long userId, long folderId, long parentFolderId, ServiceContext serviceContext) - Specified by:
moveFolder
in interfaceDocumentRepository
-
revertFileEntry
public void revertFileEntry(long userId, long fileEntryId, String version, ServiceContext serviceContext) throws PortalException - Specified by:
revertFileEntry
in interfaceDocumentRepository
- Throws:
PortalException
-
updateFileEntry
public FileEntry updateFileEntry(long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String urlTitle, String description, String changeLog, DLVersionNumberIncrease dlVersionNumberIncrease, File file, Date displayDate, Date expirationDate, Date reviewDate, ServiceContext serviceContext) - Specified by:
updateFileEntry
in interfaceDocumentRepository
-
updateFileEntry
public FileEntry updateFileEntry(long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String urlTitle, String description, String changeLog, DLVersionNumberIncrease dlVersionNumberIncrease, InputStream inputStream, long size, Date displayDate, Date expirationDate, Date reviewDate, ServiceContext serviceContext) - Specified by:
updateFileEntry
in interfaceDocumentRepository
-
updateFileShortcut
public FileShortcut updateFileShortcut(long userId, long fileShortcutId, long folderId, long toFileEntryId, ServiceContext serviceContext) - Specified by:
updateFileShortcut
in interfaceDocumentRepository
-
updateFileShortcuts
public void updateFileShortcuts(long oldToFileEntryId, long newToFileEntryId) - Specified by:
updateFileShortcuts
in interfaceDocumentRepository
-
updateFolder
public Folder updateFolder(long folderId, long parentFolderId, String name, String description, ServiceContext serviceContext) - Specified by:
updateFolder
in interfaceDocumentRepository
-