public class FileTransformationManager extends Object implements IFileTransformationManagerSPI
IFileTransformationManager
Constructor and Description |
---|
FileTransformationManager() |
Modifier and Type | Method and Description |
---|---|
FileTransformation |
addFileTransformation(SessionConfig sessionConfig,
FileTransformation fileTransformation,
ITransaction transaction)
Persist a FileTransformation for a serviceInstance.
|
void |
addTransformedFileConfig(TransformedFileConfig fileTransformedConfig,
ITransaction transaction)
Persists a transformed file.
|
void |
changeFilename(SessionConfig sessionConfig,
String tranformedFileId,
String newFilename,
ITransaction transaction)
Changes the filename of a tranformed file.
|
IServiceInterfaceUrl |
getFileHref(SessionConfig sessionConfig,
TransformedFileConfig transformedFileConfig,
ITransaction transaction)
Returns the href for linking to the given transformed file in a portal's page.
|
FileTransformation |
getFileTransformation(String fileTransformationId,
ITransaction transaction)
Return a given persisted transformation.
|
Collection<FileTransformation> |
getFileTransformationsByServiceInstanceId(String serviceInstanceId,
ITransaction transaction)
Returns all transformations for the given service instance.
|
IFile |
getPortalFile(SessionConfig sessionConfig,
TransformedFileConfig transformedFileConfig,
ITransaction transaction)
Returns the
IFile related to the given TransformedFileConfig . |
TransformedFileConfig |
getTransformedFileConfig(String transformedFileId,
ITransaction transaction)
Returns the persisted generated file.
|
Collection<TransformedFileConfig> |
getTransformedFileConfigByOriginalId(String originalFileId,
ITransaction transaction)
Returns all transformed files by the original file.
|
void |
moveTransformedFiles(FileConfig fileConfig,
IWebRootPortalBaseFolder oldWebRoot)
Moves the transformed public files from the old web root to the current.
|
void |
recreateTransformations(SessionConfig sessionConfig,
String serviceInstanceId,
ITransaction transaction)
Recreates all transformations of a given file.
|
void |
removeFileTransformation(SessionConfig sessionConfig,
FileTransformation fileTransformation,
ITransaction transaction)
Removes the specified transformation and its related files.
|
void |
removeFileTransformationInternal(SessionConfig sessionConfig,
FileTransformation fileTransformation,
IWebRootPortalBaseFolder webRoot,
ITransaction transaction)
Removes the specified transformation and all related files.
|
void |
removeTransformedFileConfig(TransformedFileConfig transformedFileConfig,
ITransaction transaction)
Deletes asynchronously the persisted transformed file.
|
void |
removeTransformedFileConfig(TransformedFileConfig transformedFileConfig,
IWebRootPortalBaseFolder webRootBaseFolder,
ITransaction transaction)
Deletes synchronously persisted transformed file.
|
void |
transformFile(SessionConfig sessionConfig,
String fileId,
FileTransformation fileTransformation,
ITransaction transaction)
Transforms a given file.
|
void |
transformFiles(Collection<FileConfig> files,
String serviceInstanceId,
ITransaction transaction)
Schedule the file transformation for the given files.
|
void |
updateFileTransformation(SessionConfig sessionConfig,
FileTransformation fileTransformation,
ITransaction transaction)
Updates a given transformation.
|
void |
updateMetadata(String transformedFileConfigId,
ITransaction transaction)
Updates metadata information from a given tranformed file
|
public FileTransformation addFileTransformation(SessionConfig sessionConfig, FileTransformation fileTransformation, ITransaction transaction) throws PortalException
IFileTransformationManager
addFileTransformation
in interface IFileTransformationManager
sessionConfig
- the current session configuration.fileTransformation
- the transformation to be added.PortalException
public Collection<FileTransformation> getFileTransformationsByServiceInstanceId(String serviceInstanceId, ITransaction transaction) throws PortalException
IFileTransformationManager
getFileTransformationsByServiceInstanceId
in interface IFileTransformationManager
serviceInstanceId
- the wished service instance id.PortalException
public void recreateTransformations(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
recreateTransformations
in interface IFileTransformationManagerSPI
sessionConfig
- the current session configuration.serviceInstanceId
- the desired serviceInstanceId.transaction
- the transaction for persistence access.PortalException
public void transformFiles(Collection<FileConfig> files, String serviceInstanceId, ITransaction transaction) throws PortalException
files
- the files.serviceInstanceId
- the service instance identifier.transaction
- the transaction.PortalException
public void removeFileTransformation(SessionConfig sessionConfig, FileTransformation fileTransformation, ITransaction transaction) throws PortalException
IFileTransformationManager
This method only schedules the removal, that will occur asynchrounsly. But the removal will only occur if the given transaction commits.
removeFileTransformation
in interface IFileTransformationManager
sessionConfig
- the current session configuration.fileTransformation
- the file transformation responsible for the file creation.transaction
- the transaction for persistence access.PortalException
public void removeFileTransformationInternal(SessionConfig sessionConfig, FileTransformation fileTransformation, IWebRootPortalBaseFolder webRoot, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
removeFileTransformationInternal
in interface IFileTransformationManagerSPI
sessionConfig
- the current session configuration.fileTransformation
- the file transformation.webRoot
- base folder for the website.transaction
- the transaction for persistence access.PortalException
public void transformFile(SessionConfig sessionConfig, String fileId, FileTransformation fileTransformation, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
transformFile
in interface IFileTransformationManagerSPI
sessionConfig
- the current session configuration.fileId
- the file to be transformed.fileTransformation
- the transformation to be user.transaction
- the current transactionPortalException
public void updateFileTransformation(SessionConfig sessionConfig, FileTransformation fileTransformation, ITransaction transaction) throws PortalException
IFileTransformationManager
updateFileTransformation
in interface IFileTransformationManager
sessionConfig
- the current session configuration.fileTransformation
- the file transformation to be updatedtransaction
- the current transactionPortalException
public void addTransformedFileConfig(TransformedFileConfig fileTransformedConfig, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
addTransformedFileConfig
in interface IFileTransformationManagerSPI
fileTransformedConfig
- the transformed file to be persistedtransaction
- the current transactionPortalException
public TransformedFileConfig getTransformedFileConfig(String transformedFileId, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
getTransformedFileConfig
in interface IFileTransformationManagerSPI
transformedFileId
- the file id of the generated file.transaction
- the current transactionPortalException
public Collection<TransformedFileConfig> getTransformedFileConfigByOriginalId(String originalFileId, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
getTransformedFileConfigByOriginalId
in interface IFileTransformationManagerSPI
originalFileId
- the original file of the transformed config persistedtransaction
- the current transactionPortalException
public void removeTransformedFileConfig(TransformedFileConfig transformedFileConfig, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
removeTransformedFileConfig
in interface IFileTransformationManagerSPI
transformedFileConfig
- the transformed file config to be deleted.transaction
- the current transactionPortalException
public void removeTransformedFileConfig(TransformedFileConfig transformedFileConfig, IWebRootPortalBaseFolder webRootBaseFolder, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
removeTransformedFileConfig
in interface IFileTransformationManagerSPI
transformedFileConfig
- the transformed file config to be deleted.webRootBaseFolder
- base folder for the website.transaction
- in which the deletion should occur.PortalException
public FileTransformation getFileTransformation(String fileTransformationId, ITransaction transaction) throws PortalException
IFileTransformationManager
getFileTransformation
in interface IFileTransformationManager
fileTransformationId
- the wished transformation id.transaction
- the transaction for persistence access.PortalException
public IFile getPortalFile(SessionConfig sessionConfig, TransformedFileConfig transformedFileConfig, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
IFile
related to the given TransformedFileConfig
.getPortalFile
in interface IFileTransformationManagerSPI
sessionConfig
- the user's session.transformedFileConfig
- the transformed file config.transaction
- the transaction.IFile
related to the given TransformedFileConfig
.PortalException
public IServiceInterfaceUrl getFileHref(SessionConfig sessionConfig, TransformedFileConfig transformedFileConfig, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
getFileHref
in interface IFileTransformationManagerSPI
sessionConfig
- user session information.transformedFileConfig
- the transformed file.transaction
- the transaction for persistence access.PortalException
public void updateMetadata(String transformedFileConfigId, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
updateMetadata
in interface IFileTransformationManagerSPI
transformedFileConfigId
- file that the metadata information will be updatedtransaction
- the transaction for persistence access.PortalException
- if any error updating occurspublic void changeFilename(SessionConfig sessionConfig, String tranformedFileId, String newFilename, ITransaction transaction) throws PortalException
IFileTransformationManagerSPI
changeFilename
in interface IFileTransformationManagerSPI
sessionConfig
- identifier for the session.tranformedFileId
- the file id.newFilename
- the new filename for the file.transaction
- the transaction for persistence access.PortalException
public void moveTransformedFiles(FileConfig fileConfig, IWebRootPortalBaseFolder oldWebRoot) throws PortalException
IFileTransformationManagerSPI
moveTransformedFiles
in interface IFileTransformationManagerSPI
fileConfig
- the file whose transformations are to be moved.oldWebRoot
- the web root folder the file was originally in, or
null
if it was not in any web root.PortalException
LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.