it.eng.spagobi.importexport
Class ExportManager

java.lang.Object
  extended by it.eng.spagobi.importexport.ExportManager
All Implemented Interfaces:
IExportManager

public class ExportManager
extends java.lang.Object
implements IExportManager

Implements the interface which defines methods for managing the export requests


Field Summary
(package private)  it.eng.spago.base.SourceBean connections
           
private  ExporterMetadata exporter
           
private  boolean exportSubObjects
           
private  java.lang.String nameExportFile
           
private  java.lang.String pathBaseFolder
           
private  java.lang.String pathContentFolder
           
private  java.lang.String pathDBFolder
           
private  java.lang.String pathExportFolder
           
private  org.hibernate.Session session
           
private  org.hibernate.SessionFactory sessionFactory
           
 
Constructor Summary
ExportManager()
           
 
Method Summary
private  void checkConnection(ModalitiesValue lov, it.eng.spago.base.SourceBean conns)
          Checks if a list of value object is a query type and in this case exports the name of the SpagoBI connection pool associated to the query
 void cleanExportEnvironment()
          Clean the export environment (close sessions and delete temporary files)
private  void closeSession()
          Close hibernate session and session factory relative to the export database
private  void compressFolder(java.lang.String pathFolder, java.util.zip.ZipOutputStream out)
          Compress contents of a folder into an output stream
private  java.lang.String createExportArchive()
          Creates the compress export file
private  void deleteTmpFolder()
          Delete the temporary folder created for export purpose
private  void exportBIParamsBIObj(java.util.List biparams, BIObject biobj)
          Exports the BIParameters of a BIObject
private  void exportConnectionFile(it.eng.spago.base.SourceBean conns)
          Creates the file describing the connections expoted
private  void exportDomains()
          Exports SpagoBI Domain Objects
private  void exportFunctionalities(java.lang.String path)
          Export a single functionality
private  void exportFunctRoles(java.util.List roles, LowFunctionality funct, java.lang.String state)
          Export an association between a functionality and a list of roles
 java.lang.String exportObjects(java.util.List objIds)
          Exports objects and creates the archive export file
private  void exportParUses(java.util.List paruses)
          Export a list ot Parameter use Objects
private  void exportPropertiesFile()
          Creates the export properties file
private  void exportRoles(java.util.List roles)
          Export a list of SpagoBI roles
private  void exportSingleObj(java.lang.String idObj)
          Export A single SpagoBI BiObject
private  void exportTemplate(BIObject biobj)
          Export the template of a single SpagoBI Object
 void prepareExport(java.lang.String pathExpFold, java.lang.String nameExpFile, boolean expSubObj)
          Prepare the environment for export
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameExportFile

private java.lang.String nameExportFile

pathExportFolder

private java.lang.String pathExportFolder

pathBaseFolder

private java.lang.String pathBaseFolder

pathDBFolder

private java.lang.String pathDBFolder

pathContentFolder

private java.lang.String pathContentFolder

sessionFactory

private org.hibernate.SessionFactory sessionFactory

session

private org.hibernate.Session session

exporter

private ExporterMetadata exporter

exportSubObjects

private boolean exportSubObjects

connections

it.eng.spago.base.SourceBean connections
Constructor Detail

ExportManager

public ExportManager()
Method Detail

prepareExport

public void prepareExport(java.lang.String pathExpFold,
                          java.lang.String nameExpFile,
                          boolean expSubObj)
                   throws EMFUserError
Prepare the environment for export

Specified by:
prepareExport in interface IExportManager
Parameters:
pathExpFold - Path of the export folder
nameExpFile - the name to give to the exported file
expSubObj - Flag which tells if it's necessary to export subobjects
Throws:
EMFUserError

exportObjects

public java.lang.String exportObjects(java.util.List objIds)
                               throws EMFUserError
Exports objects and creates the archive export file

Specified by:
exportObjects in interface IExportManager
Parameters:
objPaths - List of path of the objects to export
Throws:
EMFUserError

deleteTmpFolder

private void deleteTmpFolder()
Delete the temporary folder created for export purpose


createExportArchive

private java.lang.String createExportArchive()
                                      throws EMFUserError
Creates the compress export file

Returns:
The path of the exported compress file
Throws:
EMFUserError

compressFolder

private void compressFolder(java.lang.String pathFolder,
                            java.util.zip.ZipOutputStream out)
                     throws EMFUserError
Compress contents of a folder into an output stream

Parameters:
pathFolder - The path of the folder to compress
out - The Compress output stream
Throws:
EMFUserError

exportPropertiesFile

private void exportPropertiesFile()
                           throws EMFUserError
Creates the export properties file

Throws:
EMFUserError

exportDomains

private void exportDomains()
                    throws EMFUserError
Exports SpagoBI Domain Objects

Throws:
EMFUserError

exportSingleObj

private void exportSingleObj(java.lang.String idObj)
                      throws EMFUserError
Export A single SpagoBI BiObject

Parameters:
path - The path of the biobject to export
Throws:
EMFUserError

exportTemplate

private void exportTemplate(BIObject biobj)
                     throws EMFUserError
Export the template of a single SpagoBI Object

Parameters:
biobj - The BIObject to which the template belongs
Throws:
EMFUserError

exportBIParamsBIObj

private void exportBIParamsBIObj(java.util.List biparams,
                                 BIObject biobj)
                          throws EMFUserError
Exports the BIParameters of a BIObject

Parameters:
biparams - List ot the BIParameters belonging to the BIObject
biobj - The BIObject to which the parametes belong
Throws:
EMFUserError

exportParUses

private void exportParUses(java.util.List paruses)
                    throws EMFUserError
Export a list ot Parameter use Objects

Parameters:
paruses - The list of parameter use objects
Throws:
EMFUserError

checkConnection

private void checkConnection(ModalitiesValue lov,
                             it.eng.spago.base.SourceBean conns)
                      throws EMFUserError
Checks if a list of value object is a query type and in this case exports the name of the SpagoBI connection pool associated to the query

Parameters:
lov - List of values Object
conns - SourceBean that defines the connection pools of the current SpagoBI platform
Throws:
EMFUserError

exportFunctionalities

private void exportFunctionalities(java.lang.String path)
                            throws EMFUserError
Export a single functionality

Parameters:
path - The path of the fuctionality to export
Throws:
EMFUserError

exportFunctRoles

private void exportFunctRoles(java.util.List roles,
                              LowFunctionality funct,
                              java.lang.String state)
                       throws EMFUserError
Export an association between a functionality and a list of roles

Parameters:
roles - The list of roles to associate to the functionality
funct - The functionality which is part of the association
state - The state of the association
Throws:
EMFUserError

exportRoles

private void exportRoles(java.util.List roles)
                  throws EMFUserError
Export a list of SpagoBI roles

Parameters:
roles - The list of roles to export
Throws:
EMFUserError

exportConnectionFile

private void exportConnectionFile(it.eng.spago.base.SourceBean conns)
                           throws EMFUserError
Creates the file describing the connections expoted

Parameters:
conns - SourceBean describing the connections to export
Throws:
EMFUserError

closeSession

private void closeSession()
Close hibernate session and session factory relative to the export database


cleanExportEnvironment

public void cleanExportEnvironment()
Clean the export environment (close sessions and delete temporary files)

Specified by:
cleanExportEnvironment in interface IExportManager