Liferay 7.0-ce-m3

com.liferay.portal.kernel.repository
Class DefaultLocalRepositoryImpl

java.lang.Object
  extended by com.liferay.portal.kernel.repository.DefaultLocalRepositoryImpl
All Implemented Interfaces:
CapabilityProvider, DocumentRepository, LocalRepository

public class DefaultLocalRepositoryImpl
extends Object
implements 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.


Constructor Summary
DefaultLocalRepositoryImpl(Repository repository)
           
 
Method Summary
 FileEntry addFileEntry(long userId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, File file, ServiceContext serviceContext)
           
 FileEntry addFileEntry(long userId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, InputStream is, long size, ServiceContext serviceContext)
           
 Folder addFolder(long userId, long parentFolderId, String name, String description, ServiceContext serviceContext)
           
 void checkInFileEntry(long userId, long fileEntryId, boolean major, String changeLog, ServiceContext serviceContext)
           
 void checkInFileEntry(long userId, long fileEntryId, String lockUuid, ServiceContext serviceContext)
           
 FileEntry copyFileEntry(long userId, long groupId, long fileEntryId, long destFolderId, ServiceContext serviceContext)
           
 void deleteAll()
           
 void deleteFileEntry(long fileEntryId)
           
 void deleteFolder(long folderId)
           
<T extends Capability>
T
getCapability(Class<T> capabilityClass)
           
 FileEntry getFileEntry(long fileEntryId)
           
 FileEntry getFileEntry(long folderId, String title)
           
 FileEntry getFileEntryByUuid(String uuid)
           
 FileVersion getFileVersion(long fileVersionId)
           
 Folder getFolder(long folderId)
           
 Folder getFolder(long parentFolderId, String name)
           
 List<FileEntry> getRepositoryFileEntries(long userId, long rootFolderId, int start, int end, OrderByComparator<FileEntry> obc)
           
 long getRepositoryId()
           
<T extends Capability>
boolean
isCapabilityProvided(Class<T> capabilityClass)
           
 FileEntry moveFileEntry(long userId, long fileEntryId, long newFolderId, ServiceContext serviceContext)
           
 Folder moveFolder(long userId, long folderId, long parentFolderId, ServiceContext serviceContext)
           
 void revertFileEntry(long userId, long fileEntryId, String version, ServiceContext serviceContext)
           
 void updateAsset(long userId, FileEntry fileEntry, FileVersion fileVersion, long[] assetCategoryIds, String[] assetTagNames, long[] assetLinkEntryIds)
           
 FileEntry updateFileEntry(long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String description, String changeLog, boolean majorVersion, File file, ServiceContext serviceContext)
           
 FileEntry updateFileEntry(long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String description, String changeLog, boolean majorVersion, InputStream is, long size, ServiceContext serviceContext)
           
 Folder 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
 

Constructor Detail

DefaultLocalRepositoryImpl

public DefaultLocalRepositoryImpl(Repository repository)
Method Detail

addFileEntry

public FileEntry addFileEntry(long userId,
                              long folderId,
                              String sourceFileName,
                              String mimeType,
                              String title,
                              String description,
                              String changeLog,
                              File file,
                              ServiceContext serviceContext)
Specified by:
addFileEntry in interface DocumentRepository

addFileEntry

public FileEntry addFileEntry(long userId,
                              long folderId,
                              String sourceFileName,
                              String mimeType,
                              String title,
                              String description,
                              String changeLog,
                              InputStream is,
                              long size,
                              ServiceContext serviceContext)
Specified by:
addFileEntry in interface DocumentRepository

addFolder

public Folder addFolder(long userId,
                        long parentFolderId,
                        String name,
                        String description,
                        ServiceContext serviceContext)
Specified by:
addFolder in interface DocumentRepository

checkInFileEntry

public void checkInFileEntry(long userId,
                             long fileEntryId,
                             boolean major,
                             String changeLog,
                             ServiceContext serviceContext)
                      throws PortalException
Specified by:
checkInFileEntry in interface DocumentRepository
Throws:
PortalException

checkInFileEntry

public void checkInFileEntry(long userId,
                             long fileEntryId,
                             String lockUuid,
                             ServiceContext serviceContext)
                      throws PortalException
Specified by:
checkInFileEntry in interface DocumentRepository
Throws:
PortalException

copyFileEntry

public FileEntry copyFileEntry(long userId,
                               long groupId,
                               long fileEntryId,
                               long destFolderId,
                               ServiceContext serviceContext)
                        throws PortalException
Specified by:
copyFileEntry in interface DocumentRepository
Throws:
PortalException

deleteAll

public void deleteAll()
Specified by:
deleteAll in interface DocumentRepository

deleteFileEntry

public void deleteFileEntry(long fileEntryId)
                     throws PortalException
Specified by:
deleteFileEntry in interface DocumentRepository
Throws:
PortalException

deleteFolder

public void deleteFolder(long folderId)
                  throws PortalException
Specified by:
deleteFolder in interface DocumentRepository
Throws:
PortalException

getCapability

public <T extends Capability> T getCapability(Class<T> capabilityClass)
Specified by:
getCapability in interface CapabilityProvider

getFileEntry

public FileEntry getFileEntry(long fileEntryId)
                       throws PortalException
Specified by:
getFileEntry in interface DocumentRepository
Throws:
PortalException

getFileEntry

public FileEntry getFileEntry(long folderId,
                              String title)
                       throws PortalException
Specified by:
getFileEntry in interface DocumentRepository
Throws:
PortalException

getFileEntryByUuid

public FileEntry getFileEntryByUuid(String uuid)
                             throws PortalException
Specified by:
getFileEntryByUuid in interface DocumentRepository
Throws:
PortalException

getFileVersion

public FileVersion getFileVersion(long fileVersionId)
                           throws PortalException
Specified by:
getFileVersion in interface DocumentRepository
Throws:
PortalException

getFolder

public Folder getFolder(long folderId)
                 throws PortalException
Specified by:
getFolder in interface DocumentRepository
Throws:
PortalException

getFolder

public Folder getFolder(long parentFolderId,
                        String name)
                 throws PortalException
Specified by:
getFolder in interface DocumentRepository
Throws:
PortalException

getRepositoryFileEntries

public List<FileEntry> getRepositoryFileEntries(long userId,
                                                long rootFolderId,
                                                int start,
                                                int end,
                                                OrderByComparator<FileEntry> obc)
                                         throws PortalException
Specified by:
getRepositoryFileEntries in interface DocumentRepository
Throws:
PortalException

getRepositoryId

public long getRepositoryId()
Specified by:
getRepositoryId in interface DocumentRepository

isCapabilityProvided

public <T extends Capability> boolean isCapabilityProvided(Class<T> capabilityClass)
Specified by:
isCapabilityProvided in interface CapabilityProvider

moveFileEntry

public FileEntry moveFileEntry(long userId,
                               long fileEntryId,
                               long newFolderId,
                               ServiceContext serviceContext)
Specified by:
moveFileEntry in interface DocumentRepository

moveFolder

public Folder moveFolder(long userId,
                         long folderId,
                         long parentFolderId,
                         ServiceContext serviceContext)
Specified by:
moveFolder in interface DocumentRepository

revertFileEntry

public void revertFileEntry(long userId,
                            long fileEntryId,
                            String version,
                            ServiceContext serviceContext)
                     throws PortalException
Specified by:
revertFileEntry in interface DocumentRepository
Throws:
PortalException

updateAsset

public void updateAsset(long userId,
                        FileEntry fileEntry,
                        FileVersion fileVersion,
                        long[] assetCategoryIds,
                        String[] assetTagNames,
                        long[] assetLinkEntryIds)
Specified by:
updateAsset in interface LocalRepository

updateFileEntry

public FileEntry updateFileEntry(long userId,
                                 long fileEntryId,
                                 String sourceFileName,
                                 String mimeType,
                                 String title,
                                 String description,
                                 String changeLog,
                                 boolean majorVersion,
                                 File file,
                                 ServiceContext serviceContext)
Specified by:
updateFileEntry in interface DocumentRepository

updateFileEntry

public FileEntry updateFileEntry(long userId,
                                 long fileEntryId,
                                 String sourceFileName,
                                 String mimeType,
                                 String title,
                                 String description,
                                 String changeLog,
                                 boolean majorVersion,
                                 InputStream is,
                                 long size,
                                 ServiceContext serviceContext)
Specified by:
updateFileEntry in interface DocumentRepository

updateFolder

public Folder updateFolder(long folderId,
                           long parentFolderId,
                           String name,
                           String description,
                           ServiceContext serviceContext)
Specified by:
updateFolder in interface DocumentRepository

Liferay 7.0-ce-m3