lumis.portal.file.transformation
Class FileTransformationManager

Package class diagram package FileTransformationManager
java.lang.Object
  extended by lumis.portal.file.transformation.FileTransformationManager
All Implemented Interfaces:
IFileTransformationManager, IFileTransformationManagerSPI

public class FileTransformationManager
extends Object
implements IFileTransformationManagerSPI

Manager responsible for file transformations. Implementation of IFileTransformationManager

Since:
6.1.0

Constructor Summary
FileTransformationManager()
           
 
Method Summary
 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.
 File getFile(SessionConfig sessionConfig, TransformedFileConfig transformedFileConfig, ITransaction transaction)
          Returns a file based on the TransformedFileConfig indicated.
 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.
 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 recreateFiles(SessionConfig sessionConfig, FileTransformation fileTransformation, ITransaction transaction)
          Recreates all derived files of a given transformation.
 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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTransformationManager

public FileTransformationManager()
Method Detail

addFileTransformation

public FileTransformation addFileTransformation(SessionConfig sessionConfig,
                                                FileTransformation fileTransformation,
                                                ITransaction transaction)
                                         throws PortalException
Description copied from interface: IFileTransformationManager
Persist a FileTransformation for a serviceInstance.

Specified by:
addFileTransformation in interface IFileTransformationManager
Parameters:
sessionConfig - the current session configuration.
fileTransformation - the transformation to be added.
Returns:
the added file transformation.
Throws:
PortalException

getFileTransformationsByServiceInstanceId

public Collection<FileTransformation> getFileTransformationsByServiceInstanceId(String serviceInstanceId,
                                                                                ITransaction transaction)
                                                                         throws PortalException
Description copied from interface: IFileTransformationManager
Returns all transformations for the given service instance.

Specified by:
getFileTransformationsByServiceInstanceId in interface IFileTransformationManager
Parameters:
serviceInstanceId - the wished service instance id.
Returns:
all transformations for the given service instance.
Throws:
PortalException

recreateFiles

public void recreateFiles(SessionConfig sessionConfig,
                          FileTransformation fileTransformation,
                          ITransaction transaction)
                   throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Recreates all derived files of a given transformation.

Specified by:
recreateFiles in interface IFileTransformationManagerSPI
Parameters:
sessionConfig - the current session configuration.
fileTransformation - the file transformation
transaction - the transaction for persistence access.
Throws:
PortalException

recreateTransformations

public void recreateTransformations(SessionConfig sessionConfig,
                                    String serviceInstanceId,
                                    ITransaction transaction)
                             throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Recreates all transformations of a given file.

Specified by:
recreateTransformations in interface IFileTransformationManagerSPI
Parameters:
sessionConfig - the current session configuration.
serviceInstanceId - the desired serviceInstanceId.
transaction - the transaction for persistence access.
Throws:
PortalException

removeFileTransformation

public void removeFileTransformation(SessionConfig sessionConfig,
                                     FileTransformation fileTransformation,
                                     ITransaction transaction)
                              throws PortalException
Description copied from interface: IFileTransformationManager
Removes the specified transformation and its related files.

This method only schedules the removal, that will occur asynchrounsly. But the removal will only occur if the given transaction commits.

Specified by:
removeFileTransformation in interface IFileTransformationManager
Parameters:
sessionConfig - the current session configuration.
fileTransformation - the file transformation responsible for the file creation.
transaction - the transaction for persistence access.
Throws:
PortalException

removeFileTransformationInternal

public void removeFileTransformationInternal(SessionConfig sessionConfig,
                                             FileTransformation fileTransformation,
                                             IWebRootPortalBaseFolder webRoot,
                                             ITransaction transaction)
                                      throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Removes the specified transformation and all related files.

Specified by:
removeFileTransformationInternal in interface IFileTransformationManagerSPI
Parameters:
sessionConfig - the current session configuration.
fileTransformation - the file transformation.
webRoot - base folder for the website.
transaction - the transaction for persistence access.
Throws:
PortalException

transformFile

public void transformFile(SessionConfig sessionConfig,
                          String fileId,
                          FileTransformation fileTransformation,
                          ITransaction transaction)
                   throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Transforms a given file.

Specified by:
transformFile in interface IFileTransformationManagerSPI
Parameters:
sessionConfig - the current session configuration.
fileId - the file to be transformed.
fileTransformation - the transformation to be user.
transaction - the current transaction
Throws:
PortalException

updateFileTransformation

public void updateFileTransformation(SessionConfig sessionConfig,
                                     FileTransformation fileTransformation,
                                     ITransaction transaction)
                              throws PortalException
Description copied from interface: IFileTransformationManager
Updates a given transformation.

Specified by:
updateFileTransformation in interface IFileTransformationManager
Parameters:
sessionConfig - the current session configuration.
fileTransformation - the file transformation to be updated
transaction - the current transaction
Throws:
PortalException

addTransformedFileConfig

public void addTransformedFileConfig(TransformedFileConfig fileTransformedConfig,
                                     ITransaction transaction)
                              throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Persists a transformed file.

Specified by:
addTransformedFileConfig in interface IFileTransformationManagerSPI
Parameters:
fileTransformedConfig - the transformed file to be persisted
transaction - the current transaction
Throws:
PortalException

getTransformedFileConfig

public TransformedFileConfig getTransformedFileConfig(String transformedFileId,
                                                      ITransaction transaction)
                                               throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Returns the persisted generated file.

Specified by:
getTransformedFileConfig in interface IFileTransformationManagerSPI
Parameters:
transformedFileId - the file id of the generated file.
transaction - the current transaction
Throws:
PortalException

getTransformedFileConfigByOriginalId

public Collection<TransformedFileConfig> getTransformedFileConfigByOriginalId(String originalFileId,
                                                                              ITransaction transaction)
                                                                       throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Returns all transformed files by the original file.

Specified by:
getTransformedFileConfigByOriginalId in interface IFileTransformationManagerSPI
Parameters:
originalFileId - the original file of the transformed config persisted
transaction - the current transaction
Returns:
the file transformation persisted
Throws:
PortalException

removeTransformedFileConfig

public void removeTransformedFileConfig(TransformedFileConfig transformedFileConfig,
                                        ITransaction transaction)
                                 throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Deletes asynchronously the persisted transformed file.

Specified by:
removeTransformedFileConfig in interface IFileTransformationManagerSPI
Parameters:
transformedFileConfig - the transformed file config to be deleted.
transaction - the current transaction
Throws:
PortalException

removeTransformedFileConfig

public void removeTransformedFileConfig(TransformedFileConfig transformedFileConfig,
                                        IWebRootPortalBaseFolder webRootBaseFolder,
                                        ITransaction transaction)
                                 throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Deletes synchronously persisted transformed file.

Specified by:
removeTransformedFileConfig in interface IFileTransformationManagerSPI
Parameters:
transformedFileConfig - the transformed file config to be deleted.
webRootBaseFolder - base folder for the website.
transaction - in which the deletion should occur.
Throws:
PortalException

getFileTransformation

public FileTransformation getFileTransformation(String fileTransformationId,
                                                ITransaction transaction)
                                         throws PortalException
Description copied from interface: IFileTransformationManager
Return a given persisted transformation.

Specified by:
getFileTransformation in interface IFileTransformationManager
Parameters:
fileTransformationId - the wished transformation id.
transaction - the transaction for persistence access.
Returns:
the found transformation
Throws:
PortalException

getFile

public File getFile(SessionConfig sessionConfig,
                    TransformedFileConfig transformedFileConfig,
                    ITransaction transaction)
             throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Returns a file based on the TransformedFileConfig indicated.

Specified by:
getFile in interface IFileTransformationManagerSPI
Parameters:
sessionConfig - identifier for the session.
transformedFileConfig - the transformedfileConfig of the asked file.
transaction - the transaction for persistence access.
Returns:
the File object for accessing the corresponding file in the filesystem.
Throws:
PortalException

getFileHref

public IServiceInterfaceUrl getFileHref(SessionConfig sessionConfig,
                                        TransformedFileConfig transformedFileConfig,
                                        ITransaction transaction)
                                 throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Returns the href for linking to the given transformed file in a portal's page.

Specified by:
getFileHref in interface IFileTransformationManagerSPI
Parameters:
sessionConfig - user session information.
transformedFileConfig - the transformed file.
transaction - the transaction for persistence access.
Returns:
the href.
Throws:
PortalException

updateMetadata

public void updateMetadata(String transformedFileConfigId,
                           ITransaction transaction)
                    throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Updates metadata information from a given tranformed file

Specified by:
updateMetadata in interface IFileTransformationManagerSPI
Parameters:
transformedFileConfigId - file that the metadata information will be updated
transaction - the transaction for persistence access.
Throws:
PortalException - if any error updating occurs

changeFilename

public void changeFilename(SessionConfig sessionConfig,
                           String tranformedFileId,
                           String newFilename,
                           ITransaction transaction)
                    throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Changes the filename of a tranformed file.

Specified by:
changeFilename in interface IFileTransformationManagerSPI
Parameters:
sessionConfig - identifier for the session.
tranformedFileId - the file id.
newFilename - the new filename for the file.
transaction - the transaction for persistence access.
Throws:
PortalException

moveTransformedFiles

public void moveTransformedFiles(FileConfig fileConfig,
                                 IWebRootPortalBaseFolder oldWebRoot)
                          throws PortalException
Description copied from interface: IFileTransformationManagerSPI
Moves the transformed public files from the old web root to the current.

Specified by:
moveTransformedFiles in interface IFileTransformationManagerSPI
Parameters:
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.
Throws:
PortalException


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.