Liferay 7.0-ce-b4

com.liferay.portlet.documentlibrary.service.impl
Class DLAppLocalServiceImpl

java.lang.Object
  extended by com.liferay.portal.service.BaseLocalServiceImpl
      extended by com.liferay.portlet.documentlibrary.service.base.DLAppLocalServiceBaseImpl
          extended by com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl
All Implemented Interfaces:
IdentifiableOSGiService, BaseLocalService, DLAppLocalService

public class DLAppLocalServiceImpl
extends DLAppLocalServiceBaseImpl

Provides the local service for accessing, adding, deleting, moving, subscription handling of, and updating document library file entries, file ranks, and folders. All portlets should interact with the document library through this class or through DLAppService, rather than through the individual document library service classes.

This class provides a unified interface to all Liferay and third party repositories. While the method signatures are universal for all repositories. Additional implementation-specific parameters may be specified in the serviceContext.

The repositoryId parameter used by most of the methods is the primary key of the specific repository. If the repository is a default Liferay repository, the repositoryId is the groupId or scopeGroupId. Otherwise, the repositoryId will correspond to values obtained from RepositoryLocalServiceUtil.

See Also:
DLAppServiceImpl

Field Summary
protected  RepositoryProvider repositoryProvider
           
 
Fields inherited from class com.liferay.portlet.documentlibrary.service.base.DLAppLocalServiceBaseImpl
counterLocalService, dlAppHelperLocalService, dlAppLocalService, dlFileEntryMetadataFinder, dlFileEntryMetadataLocalService, dlFileEntryMetadataPersistence, dlFileRankFinder, dlFileRankLocalService, dlFileRankPersistence, dlFolderFinder, dlFolderLocalService, dlFolderPersistence, repositoryEntryLocalService, repositoryEntryPersistence, repositoryLocalService, repositoryPersistence, subscriptionLocalService, subscriptionPersistence, trashEntryLocalService, trashEntryPersistence
 
Constructor Summary
DLAppLocalServiceImpl()
           
 
Method Summary
 FileEntry addFileEntry(long userId, long repositoryId, long folderId, String sourceFileName, String mimeType, byte[] bytes, ServiceContext serviceContext)
           
 FileEntry addFileEntry(long userId, long repositoryId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, byte[] bytes, ServiceContext serviceContext)
          Adds a file entry and associated metadata based on a byte array.
 FileEntry addFileEntry(long userId, long repositoryId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, File file, ServiceContext serviceContext)
          Adds a file entry and associated metadata based on a File object.
 FileEntry addFileEntry(long userId, long repositoryId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, InputStream is, long size, ServiceContext serviceContext)
          Adds a file entry and associated metadata based on an InputStream object.
 DLFileRank addFileRank(long repositoryId, long companyId, long userId, long fileEntryId, ServiceContext serviceContext)
          Adds the file rank to the existing file entry.
 FileShortcut addFileShortcut(long userId, long repositoryId, long folderId, long toFileEntryId, ServiceContext serviceContext)
          Adds the file shortcut to the existing file entry.
 Folder addFolder(long userId, long repositoryId, long parentFolderId, String name, String description, ServiceContext serviceContext)
          Adds a folder.
protected  FileEntry copyFileEntry(long userId, LocalRepository toLocalRepository, FileEntry fileEntry, long newFolderId, ServiceContext serviceContext)
           
protected  Folder copyFolder(long userId, long folderId, long parentFolderId, LocalRepository fromLocalRepository, LocalRepository toLocalRepository, ServiceContext serviceContext)
           
protected  void copyFolderDependencies(long userId, Folder sourceFolder, Folder destinationFolder, LocalRepository fromLocalRepository, LocalRepository toLocalRepository, ServiceContext serviceContext)
           
 void deleteAll(long repositoryId)
          Delete all data associated to the given repository.
 void deleteAllRepositories(long groupId)
           
 void deleteFileEntry(long fileEntryId)
          Deletes the file entry.
protected  void deleteFileEntry(long oldFileEntryId, long newFileEntryId, LocalRepository fromLocalRepository, LocalRepository toLocalRepository)
           
 void deleteFileRanksByFileEntryId(long fileEntryId)
          Deletes the file ranks associated to a given file entry.
 void deleteFileRanksByUserId(long userId)
          Deletes the file ranks associated to a given user.
 void deleteFileShortcut(FileShortcut fileShortcut)
          Deletes the file shortcut.
 void deleteFileShortcut(long fileShortcutId)
          Deletes the file shortcut.
 void deleteFileShortcuts(long toFileEntryId)
          Deletes all file shortcuts associated to the file entry.
 void deleteFolder(long folderId)
          Deletes the folder and all of its subfolders and file entries.
protected  void deleteRepository(LocalRepository localRepository)
           
 FileEntry getFileEntry(long fileEntryId)
          Returns the file entry with the primary key.
 FileEntry getFileEntry(long groupId, long folderId, String title)
          Returns the file entry with the title in the folder.
 FileEntry getFileEntryByUuidAndGroupId(String uuid, long groupId)
          Returns the file entry with the UUID and group.
 List<DLFileRank> getFileRanks(long repositoryId, long userId)
          Returns the file ranks from the user.
 FileShortcut getFileShortcut(long fileShortcutId)
          Returns the file shortcut with the primary key.
 FileVersion getFileVersion(long fileVersionId)
          Returns the file version with the primary key.
 Folder getFolder(long folderId)
          Returns the folder with the primary key.
 Folder getFolder(long repositoryId, long parentFolderId, String name)
          Returns the folder with the name in the parent folder.
protected  LocalRepository getFolderLocalRepository(long folderId, long groupId)
           
protected  LocalRepository getLocalRepository(long repositoryId)
           
 Folder getMountFolder(long repositoryId)
          Returns the mount folder of the repository with the primary key.
protected  FileEntry moveFileEntry(long userId, long fileEntryId, long newFolderId, LocalRepository fromLocalRepository, LocalRepository toLocalRepository, ServiceContext serviceContext)
           
 FileEntry moveFileEntry(long userId, long fileEntryId, long newFolderId, ServiceContext serviceContext)
          Moves the file entry to the new folder.
protected  Folder moveFolder(long userId, long folderId, long parentFolderId, LocalRepository fromLocalRepository, LocalRepository toLocalRepository, ServiceContext serviceContext)
           
 Folder moveFolder(long userId, long folderId, long parentFolderId, ServiceContext serviceContext)
           
 void subscribeFileEntryType(long userId, long groupId, long fileEntryTypeId)
          Subscribe the user to changes in documents of the file entry type.
 void subscribeFolder(long userId, long groupId, long folderId)
          Subscribe the user to document changes in the folder.
 void unsubscribeFileEntryType(long userId, long groupId, long fileEntryTypeId)
          Unsubscribe the user from changes in documents of the file entry type.
 void unsubscribeFolder(long userId, long groupId, long folderId)
          Unsubscribe the user from document changes in the folder.
 void updateAsset(long userId, FileEntry fileEntry, FileVersion fileVersion, long[] assetCategoryIds, String[] assetTagNames, long[] assetLinkEntryIds)
          Updates the file entry's asset replacing its asset categories, tags, and links.
 FileEntry updateFileEntry(long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String description, String changeLog, boolean majorVersion, byte[] bytes, ServiceContext serviceContext)
          Updates a file entry and associated metadata based on a byte array object.
 FileEntry updateFileEntry(long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String description, String changeLog, boolean majorVersion, File file, ServiceContext serviceContext)
          Updates a file entry and associated metadata based on a File object.
 FileEntry updateFileEntry(long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String description, String changeLog, boolean majorVersion, InputStream is, long size, ServiceContext serviceContext)
          Updates a file entry and associated metadata based on an InputStream object.
 DLFileRank updateFileRank(long repositoryId, long companyId, long userId, long fileEntryId, ServiceContext serviceContext)
          Updates a file rank to the existing file entry.
 FileShortcut updateFileShortcut(long userId, long fileShortcutId, long folderId, long toFileEntryId, ServiceContext serviceContext)
          Updates a file shortcut to the existing file entry.
 void updateFileShortcuts(long oldToFileEntryId, long newToFileEntryId)
          Updates all file shortcuts to the existing file entry to the new file entry.
 void updateFileShortcuts(long toRepositoryId, long oldToFileEntryId, long newToFileEntryId)
          Deprecated. 
 Folder updateFolder(long folderId, long parentFolderId, String name, String description, ServiceContext serviceContext)
          Updates the folder.
 
Methods inherited from class com.liferay.portlet.documentlibrary.service.base.DLAppLocalServiceBaseImpl
afterPropertiesSet, destroy, getCounterLocalService, getDLAppHelperLocalService, getDLAppLocalService, getDLFileEntryMetadataFinder, getDLFileEntryMetadataLocalService, getDLFileEntryMetadataPersistence, getDLFileRankFinder, getDLFileRankLocalService, getDLFileRankPersistence, getDLFolderFinder, getDLFolderLocalService, getDLFolderPersistence, getOSGiServiceIdentifier, getRepositoryEntryLocalService, getRepositoryEntryPersistence, getRepositoryLocalService, getRepositoryPersistence, getSubscriptionLocalService, getSubscriptionPersistence, getTrashEntryLocalService, getTrashEntryPersistence, runSQL, setCounterLocalService, setDLAppHelperLocalService, setDLAppLocalService, setDLFileEntryMetadataFinder, setDLFileEntryMetadataLocalService, setDLFileEntryMetadataPersistence, setDLFileRankFinder, setDLFileRankLocalService, setDLFileRankPersistence, setDLFolderFinder, setDLFolderLocalService, setDLFolderPersistence, setRepositoryEntryLocalService, setRepositoryEntryPersistence, setRepositoryLocalService, setRepositoryPersistence, setSubscriptionLocalService, setSubscriptionPersistence, setTrashEntryLocalService, setTrashEntryPersistence
 
Methods inherited from class com.liferay.portal.service.BaseLocalServiceImpl
getClassLoader, getLocalizationMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

repositoryProvider

@BeanReference(type=RepositoryProvider.class)
protected RepositoryProvider repositoryProvider
Constructor Detail

DLAppLocalServiceImpl

public DLAppLocalServiceImpl()
Method Detail

addFileEntry

public FileEntry addFileEntry(long userId,
                              long repositoryId,
                              long folderId,
                              String sourceFileName,
                              String mimeType,
                              byte[] bytes,
                              ServiceContext serviceContext)
                       throws PortalException
Throws:
PortalException

addFileEntry

public FileEntry addFileEntry(long userId,
                              long repositoryId,
                              long folderId,
                              String sourceFileName,
                              String mimeType,
                              String title,
                              String description,
                              String changeLog,
                              byte[] bytes,
                              ServiceContext serviceContext)
                       throws PortalException
Adds a file entry and associated metadata based on a byte array.

This method takes two file names, the sourceFileName and the title. The sourceFileName corresponds to the name of the actual file being uploaded. The title corresponds to a name the client wishes to assign this file after it has been uploaded to the portal. If it is null, the sourceFileName will be used.

Parameters:
userId - the primary key of the file entry's creator/owner
repositoryId - the primary key of the file entry's repository
folderId - the primary key of the file entry's parent folder
sourceFileName - the original file's name
mimeType - the file's MIME type
title - the name to be assigned to the file (optionally null )
description - the file's description
changeLog - the file's version change log
bytes - the file's data (optionally null)
serviceContext - the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
Returns:
the file entry
Throws:
PortalException

addFileEntry

public FileEntry addFileEntry(long userId,
                              long repositoryId,
                              long folderId,
                              String sourceFileName,
                              String mimeType,
                              String title,
                              String description,
                              String changeLog,
                              File file,
                              ServiceContext serviceContext)
                       throws PortalException
Adds a file entry and associated metadata based on a File object.

This method takes two file names, the sourceFileName and the title. The sourceFileName corresponds to the name of the actual file being uploaded. The title corresponds to a name the client wishes to assign this file after it has been uploaded to the portal. If it is null, the sourceFileName will be used.

Parameters:
userId - the primary key of the file entry's creator/owner
repositoryId - the primary key of the repository
folderId - the primary key of the file entry's parent folder
sourceFileName - the original file's name
mimeType - the file's MIME type
title - the name to be assigned to the file (optionally null )
description - the file's description
changeLog - the file's version change log
file - the file's data (optionally null)
serviceContext - the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
Returns:
the file entry
Throws:
PortalException

addFileEntry

public FileEntry addFileEntry(long userId,
                              long repositoryId,
                              long folderId,
                              String sourceFileName,
                              String mimeType,
                              String title,
                              String description,
                              String changeLog,
                              InputStream is,
                              long size,
                              ServiceContext serviceContext)
                       throws PortalException
Adds a file entry and associated metadata based on an InputStream object.

This method takes two file names, the sourceFileName and the title. The sourceFileName corresponds to the name of the actual file being uploaded. The title corresponds to a name the client wishes to assign this file after it has been uploaded to the portal. If it is null, the sourceFileName will be used.

Parameters:
userId - the primary key of the file entry's creator/owner
repositoryId - the primary key of the repository
folderId - the primary key of the file entry's parent folder
sourceFileName - the original file's name
mimeType - the file's MIME type
title - the name to be assigned to the file (optionally null )
description - the file's description
changeLog - the file's version change log
is - the file's data (optionally null)
size - the file's size (optionally 0)
serviceContext - the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
Returns:
the file entry
Throws:
PortalException

addFileRank

public DLFileRank addFileRank(long repositoryId,
                              long companyId,
                              long userId,
                              long fileEntryId,
                              ServiceContext serviceContext)
Adds the file rank to the existing file entry. This method is only supported by the Liferay repository.

Parameters:
repositoryId - the primary key of the repository
companyId - the primary key of the company
userId - the primary key of the file rank's creator/owner
fileEntryId - the primary key of the file entry
serviceContext - the service context to be applied
Returns:
the file rank

addFileShortcut

public FileShortcut addFileShortcut(long userId,
                                    long repositoryId,
                                    long folderId,
                                    long toFileEntryId,
                                    ServiceContext serviceContext)
                             throws PortalException
Adds the file shortcut to the existing file entry. This method is only supported by the Liferay repository.

Parameters:
userId - the primary key of the file shortcut's creator/owner
repositoryId - the primary key of the repository
folderId - the primary key of the file shortcut's parent folder
toFileEntryId - the primary key of the file entry to point to
serviceContext - the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry.
Returns:
the file shortcut
Throws:
PortalException

addFolder

public Folder addFolder(long userId,
                        long repositoryId,
                        long parentFolderId,
                        String name,
                        String description,
                        ServiceContext serviceContext)
                 throws PortalException
Adds a folder.

Parameters:
userId - the primary key of the folder's creator/owner
repositoryId - the primary key of the repository
parentFolderId - the primary key of the folder's parent folder
name - the folder's name
description - the folder's description
serviceContext - the service context to be applied. In a Liferay repository, it may include mountPoint which is a boolean specifying whether the folder is a facade for mounting a third-party repository
Returns:
the folder
Throws:
PortalException

deleteAll

public void deleteAll(long repositoryId)
               throws PortalException
Delete all data associated to the given repository. This method is only supported by the Liferay repository.

Parameters:
repositoryId - the primary key of the data's repository
Throws:
PortalException

deleteAllRepositories

public void deleteAllRepositories(long groupId)
                           throws PortalException
Throws:
PortalException

deleteFileEntry

public void deleteFileEntry(long fileEntryId)
                     throws PortalException
Deletes the file entry.

Parameters:
fileEntryId - the primary key of the file entry
Throws:
PortalException

deleteFileRanksByFileEntryId

public void deleteFileRanksByFileEntryId(long fileEntryId)
Deletes the file ranks associated to a given file entry. This method is only supported by the Liferay repository.

Parameters:
fileEntryId - the primary key of the file entry

deleteFileRanksByUserId

public void deleteFileRanksByUserId(long userId)
Deletes the file ranks associated to a given user. This method is only supported by the Liferay repository.

Parameters:
userId - the primary key of the user

deleteFileShortcut

public void deleteFileShortcut(FileShortcut fileShortcut)
                        throws PortalException
Deletes the file shortcut. This method is only supported by the Liferay repository.

Parameters:
fileShortcut - the file shortcut
Throws:
PortalException

deleteFileShortcut

public void deleteFileShortcut(long fileShortcutId)
                        throws PortalException
Deletes the file shortcut. This method is only supported by the Liferay repository.

Parameters:
fileShortcutId - the primary key of the file shortcut
Throws:
PortalException

deleteFileShortcuts

public void deleteFileShortcuts(long toFileEntryId)
                         throws PortalException
Deletes all file shortcuts associated to the file entry. This method is only supported by the Liferay repository.

Parameters:
toFileEntryId - the primary key of the associated file entry
Throws:
PortalException

deleteFolder

public void deleteFolder(long folderId)
                  throws PortalException
Deletes the folder and all of its subfolders and file entries.

Parameters:
folderId - the primary key of the folder
Throws:
PortalException

getFileEntry

public FileEntry getFileEntry(long fileEntryId)
                       throws PortalException
Returns the file entry with the primary key.

Parameters:
fileEntryId - the primary key of the file entry
Returns:
the file entry with the primary key
Throws:
PortalException

getFileEntry

public FileEntry getFileEntry(long groupId,
                              long folderId,
                              String title)
                       throws PortalException
Returns the file entry with the title in the folder.

Parameters:
groupId - the primary key of the file entry's group
folderId - the primary key of the file entry's folder
title - the file entry's title
Returns:
the file entry with the title in the folder
Throws:
PortalException

getFileEntryByUuidAndGroupId

public FileEntry getFileEntryByUuidAndGroupId(String uuid,
                                              long groupId)
                                       throws PortalException
Returns the file entry with the UUID and group.

Parameters:
uuid - the file entry's UUID
groupId - the primary key of the file entry's group
Returns:
the file entry with the UUID and group
Throws:
PortalException

getFileRanks

public List<DLFileRank> getFileRanks(long repositoryId,
                                     long userId)
Returns the file ranks from the user. This method is only supported by the Liferay repository.

Parameters:
repositoryId - the primary key of the repository
userId - the primary key of the user
Returns:
the file ranks from the user

getFileShortcut

public FileShortcut getFileShortcut(long fileShortcutId)
                             throws PortalException
Returns the file shortcut with the primary key. This method is only supported by the Liferay repository.

Parameters:
fileShortcutId - the primary key of the file shortcut
Returns:
the file shortcut with the primary key
Throws:
PortalException

getFileVersion

public FileVersion getFileVersion(long fileVersionId)
                           throws PortalException
Returns the file version with the primary key.

Parameters:
fileVersionId - the primary key of the file version
Returns:
the file version with the primary key
Throws:
PortalException

getFolder

public Folder getFolder(long folderId)
                 throws PortalException
Returns the folder with the primary key.

Parameters:
folderId - the primary key of the folder
Returns:
the folder with the primary key
Throws:
PortalException

getFolder

public Folder getFolder(long repositoryId,
                        long parentFolderId,
                        String name)
                 throws PortalException
Returns the folder with the name in the parent folder.

Parameters:
repositoryId - the primary key of the folder's repository
parentFolderId - the primary key of the folder's parent folder
name - the folder's name
Returns:
the folder with the name in the parent folder
Throws:
PortalException

getMountFolder

public Folder getMountFolder(long repositoryId)
                      throws PortalException
Returns the mount folder of the repository with the primary key. This method is only supported by the Liferay repository.

Parameters:
repositoryId - the primary key of the repository
Returns:
the folder used for mounting third-party repositories
Throws:
PortalException

moveFileEntry

public FileEntry moveFileEntry(long userId,
                               long fileEntryId,
                               long newFolderId,
                               ServiceContext serviceContext)
                        throws PortalException
Moves the file entry to the new folder.

Parameters:
userId - the primary key of the user
fileEntryId - the primary key of the file entry
newFolderId - the primary key of the new folder
serviceContext - the service context to be applied
Returns:
the file entry
Throws:
PortalException

moveFolder

public Folder moveFolder(long userId,
                         long folderId,
                         long parentFolderId,
                         ServiceContext serviceContext)
                  throws PortalException
Throws:
PortalException

subscribeFileEntryType

public void subscribeFileEntryType(long userId,
                                   long groupId,
                                   long fileEntryTypeId)
                            throws PortalException
Subscribe the user to changes in documents of the file entry type. This method is only supported by the Liferay repository.

Parameters:
userId - the primary key of the user
groupId - the primary key of the file entry type's group
fileEntryTypeId - the primary key of the file entry type
Throws:
PortalException

subscribeFolder

public void subscribeFolder(long userId,
                            long groupId,
                            long folderId)
                     throws PortalException
Subscribe the user to document changes in the folder. This method is only supported by the Liferay repository.

Parameters:
userId - the primary key of the user
groupId - the primary key of the folder's group
folderId - the primary key of the folder
Throws:
PortalException

unsubscribeFileEntryType

public void unsubscribeFileEntryType(long userId,
                                     long groupId,
                                     long fileEntryTypeId)
                              throws PortalException
Unsubscribe the user from changes in documents of the file entry type. This method is only supported by the Liferay repository.

Parameters:
userId - the primary key of the user
groupId - the primary key of the file entry type's group
fileEntryTypeId - the primary key of the file entry type
Throws:
PortalException

unsubscribeFolder

public void unsubscribeFolder(long userId,
                              long groupId,
                              long folderId)
                       throws PortalException
Unsubscribe the user from document changes in the folder. This method is only supported by the Liferay repository.

Parameters:
userId - the primary key of the user
groupId - the primary key of the folder's group
folderId - the primary key of the folder
Throws:
PortalException

updateAsset

public void updateAsset(long userId,
                        FileEntry fileEntry,
                        FileVersion fileVersion,
                        long[] assetCategoryIds,
                        String[] assetTagNames,
                        long[] assetLinkEntryIds)
                 throws PortalException
Updates the file entry's asset replacing its asset categories, tags, and links.

Parameters:
userId - the primary key of the user
fileEntry - the file entry to update
fileVersion - the file version to update
assetCategoryIds - the primary keys of the new asset categories
assetTagNames - the new asset tag names
assetLinkEntryIds - the primary keys of the new asset link entries
Throws:
PortalException

updateFileEntry

public FileEntry updateFileEntry(long userId,
                                 long fileEntryId,
                                 String sourceFileName,
                                 String mimeType,
                                 String title,
                                 String description,
                                 String changeLog,
                                 boolean majorVersion,
                                 byte[] bytes,
                                 ServiceContext serviceContext)
                          throws PortalException
Updates a file entry and associated metadata based on a byte array object. If the file data is null, then only the associated metadata (i.e., title, description, and parameters in the serviceContext) will be updated.

This method takes two file names, the sourceFileName and the title. The sourceFileName corresponds to the name of the actual file being uploaded. The title corresponds to a name the client wishes to assign this file after it has been uploaded to the portal.

Parameters:
userId - the primary key of the user
fileEntryId - the primary key of the file entry
sourceFileName - the original file's name (optionally null)
mimeType - the file's MIME type (optionally null)
title - the new name to be assigned to the file (optionally null)
description - the file's new description
changeLog - the file's version change log (optionally null)
majorVersion - whether the new file version is a major version
bytes - the file's data (optionally null)
serviceContext - the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
Returns:
the file entry
Throws:
PortalException

updateFileEntry

public FileEntry updateFileEntry(long userId,
                                 long fileEntryId,
                                 String sourceFileName,
                                 String mimeType,
                                 String title,
                                 String description,
                                 String changeLog,
                                 boolean majorVersion,
                                 File file,
                                 ServiceContext serviceContext)
                          throws PortalException
Updates a file entry and associated metadata based on a File object. If the file data is null, then only the associated metadata (i.e., title, description, and parameters in the serviceContext) will be updated.

This method takes two file names, the sourceFileName and the title. The sourceFileName corresponds to the name of the actual file being uploaded. The title corresponds to a name the client wishes to assign this file after it has been uploaded to the portal.

Parameters:
userId - the primary key of the user
fileEntryId - the primary key of the file entry
sourceFileName - the original file's name (optionally null)
mimeType - the file's MIME type (optionally null)
title - the new name to be assigned to the file (optionally null)
description - the file's new description
changeLog - the file's version change log (optionally null)
majorVersion - whether the new file version is a major version
file - the file's data (optionally null)
serviceContext - the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
Returns:
the file entry
Throws:
PortalException

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)
                          throws PortalException
Updates a file entry and associated metadata based on an InputStream object. If the file data is null, then only the associated metadata (i.e., title, description, and parameters in the serviceContext) will be updated.

This method takes two file names, the sourceFileName and the title. The sourceFileName corresponds to the name of the actual file being uploaded. The title corresponds to a name the client wishes to assign this file after it has been uploaded to the portal.

Parameters:
userId - the primary key of the user
fileEntryId - the primary key of the file entry
sourceFileName - the original file's name (optionally null)
mimeType - the file's MIME type (optionally null)
title - the new name to be assigned to the file (optionally null)
description - the file's new description
changeLog - the file's version change log (optionally null)
majorVersion - whether the new file version is a major version
is - the file's data (optionally null)
size - the file's size (optionally 0)
serviceContext - the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
Returns:
the file entry
Throws:
PortalException

updateFileRank

public DLFileRank updateFileRank(long repositoryId,
                                 long companyId,
                                 long userId,
                                 long fileEntryId,
                                 ServiceContext serviceContext)
Updates a file rank to the existing file entry. This method is only supported by the Liferay repository.

Parameters:
repositoryId - the primary key of the file rank's repository
companyId - the primary key of the file rank's company
userId - the primary key of the file rank's creator/owner
fileEntryId - the primary key of the file rank's file entry
serviceContext - the service context to be applied
Returns:
the file rank

updateFileShortcut

public FileShortcut updateFileShortcut(long userId,
                                       long fileShortcutId,
                                       long folderId,
                                       long toFileEntryId,
                                       ServiceContext serviceContext)
                                throws PortalException
Updates a file shortcut to the existing file entry. This method is only supported by the Liferay repository.

Parameters:
userId - the primary key of the file shortcut's creator/owner
fileShortcutId - the primary key of the file shortcut
folderId - the primary key of the file shortcut's parent folder
toFileEntryId - the primary key of the file shortcut's file entry
serviceContext - the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry.
Returns:
the file shortcut
Throws:
PortalException

updateFileShortcuts

public void updateFileShortcuts(long oldToFileEntryId,
                                long newToFileEntryId)
                         throws PortalException
Updates all file shortcuts to the existing file entry to the new file entry. This method is only supported by the Liferay repository.

Parameters:
oldToFileEntryId - the primary key of the old file entry pointed to
newToFileEntryId - the primary key of the new file entry to point to
Throws:
PortalException

updateFileShortcuts

@Deprecated
public void updateFileShortcuts(long toRepositoryId,
                                           long oldToFileEntryId,
                                           long newToFileEntryId)
                         throws PortalException
Deprecated. 

Deprecated as of 7.0.0, replaced by updateFileShortcuts(long, long)

Throws:
PortalException

updateFolder

public Folder updateFolder(long folderId,
                           long parentFolderId,
                           String name,
                           String description,
                           ServiceContext serviceContext)
                    throws PortalException
Updates the folder.

Parameters:
folderId - the primary key of the folder
parentFolderId - the primary key of the folder's new parent folder
name - the folder's new name
description - the folder's new description
serviceContext - the service context to be applied. In a Liferay repository, it may include:
  • defaultFileEntryTypeId - the file entry type to default all Liferay file entries to
  • dlFileEntryTypesSearchContainerPrimaryKeys - a comma-delimited list of file entry type primary keys allowed in the given folder and all descendants
  • restrictionType - specifying restriction type of file entry types allowed
  • workflowDefinitionXYZ - the workflow definition name specified per file entry type. The parameter name must be the string workflowDefinition appended by the fileEntryTypeId (optionally 0).
Returns:
the folder
Throws:
PortalException

copyFileEntry

protected FileEntry copyFileEntry(long userId,
                                  LocalRepository toLocalRepository,
                                  FileEntry fileEntry,
                                  long newFolderId,
                                  ServiceContext serviceContext)
                           throws PortalException
Throws:
PortalException

copyFolder

protected Folder copyFolder(long userId,
                            long folderId,
                            long parentFolderId,
                            LocalRepository fromLocalRepository,
                            LocalRepository toLocalRepository,
                            ServiceContext serviceContext)
                     throws PortalException
Throws:
PortalException

copyFolderDependencies

protected void copyFolderDependencies(long userId,
                                      Folder sourceFolder,
                                      Folder destinationFolder,
                                      LocalRepository fromLocalRepository,
                                      LocalRepository toLocalRepository,
                                      ServiceContext serviceContext)
                               throws PortalException
Throws:
PortalException

deleteFileEntry

protected void deleteFileEntry(long oldFileEntryId,
                               long newFileEntryId,
                               LocalRepository fromLocalRepository,
                               LocalRepository toLocalRepository)
                        throws PortalException
Throws:
PortalException

deleteRepository

protected void deleteRepository(LocalRepository localRepository)
                         throws PortalException
Throws:
PortalException

getFolderLocalRepository

protected LocalRepository getFolderLocalRepository(long folderId,
                                                   long groupId)
                                            throws PortalException
Throws:
PortalException

getLocalRepository

protected LocalRepository getLocalRepository(long repositoryId)
                                      throws PortalException
Throws:
PortalException

moveFileEntry

protected FileEntry moveFileEntry(long userId,
                                  long fileEntryId,
                                  long newFolderId,
                                  LocalRepository fromLocalRepository,
                                  LocalRepository toLocalRepository,
                                  ServiceContext serviceContext)
                           throws PortalException
Throws:
PortalException

moveFolder

protected Folder moveFolder(long userId,
                            long folderId,
                            long parentFolderId,
                            LocalRepository fromLocalRepository,
                            LocalRepository toLocalRepository,
                            ServiceContext serviceContext)
                     throws PortalException
Throws:
PortalException

Liferay 7.0-ce-b4