it.eng.spagobi.tools.importexport
Class ImportUtilities

java.lang.Object
  extended by it.eng.spagobi.tools.importexport.ImportUtilities

public class ImportUtilities
extends java.lang.Object


Field Summary
static int MAX_DEFAULT_IMPORT_FILE_SIZE
           
 
Constructor Summary
ImportUtilities()
           
 
Method Summary
static void associateWithExistingEntities(SbiDataSetConfig dataset, SbiDataSetConfig exportedDataset, org.hibernate.Session sessionCurrDB, ImporterMetadata importer, MetadataAssociations metaAss)
          Set into the dataset the datasource associated with the exported dataset.
static void associateWithExistingEntities(SbiDataSource datasource, SbiDataSource exportedDatasource, org.hibernate.Session sessionCurrDB, ImporterMetadata importer, MetadataAssociations metaAss)
          Set into the datasource the dialect type domain associated with the exported datasource.
static void associateWithExistingEntities(SbiLov lov, SbiLov exportedLov, org.hibernate.Session sessionCurrDB, ImporterMetadata importer, MetadataAssociations metaAss)
          Set into the lov the lov type domain associated with the exported lov.
static void associateWithExistingEntities(SbiObjects obj, SbiObjects exportedObj, org.hibernate.Session sessionCurrDB, ImporterMetadata importer, MetadataAssociations metaAss)
          Set into the biobject to the engine/object type/object state/datasource the entities associated with the exported biobject.
static void associateWithExistingEntities(SbiParameters parameter, SbiParameters exportedParameter, org.hibernate.Session sessionCurrDB, ImporterMetadata importer, MetadataAssociations metaAss)
          Set into the parameter to the parameter type domain associated with the exported parameter.
static void decompressArchive(java.lang.String pathImpTmpFolder, java.lang.String pathArchiveFile)
          Decompress the export compress file.
static org.hibernate.SessionFactory getHibSessionExportDB(java.lang.String pathDBFolder)
          Creates an Hibernate session factory for the exported database.
static int getImportFileMaxSize()
           
static IImportManager getImportManagerInstance()
           
static java.lang.String getImportTempFolderPath()
           
static SbiBinContents makeNewSbiBinContents(SbiBinContents obj)
          Make new sbi bin contents.
static SbiChecks makeNewSbiCheck(SbiChecks check)
          Creates a new hibernate check object.
static SbiChecks makeNewSbiCheck(SbiChecks check, java.lang.Integer id)
          Creates a new hibernate check object.
static SbiDataSetConfig makeNewSbiDataSet(SbiDataSetConfig dataset)
          Make new data set.
static SbiDataSource makeNewSbiDataSource(SbiDataSource ds)
          Make new data source.
static SbiEngines makeNewSbiEngine(SbiEngines engine)
          Creates a new hibernate engine object.
static SbiEngines makeNewSbiEngine(SbiEngines engine, java.lang.Integer id)
          Creates a new hibernate engine object.
static SbiExtRoles makeNewSbiExtRole(SbiExtRoles role)
          Creates a new hibernate role object.
static SbiExtRoles makeNewSbiExtRole(SbiExtRoles role, java.lang.Integer id)
          Creates a new hibernate role object.
static SbiFunctions makeNewSbiFunction(SbiFunctions funct)
          Creates a new hibernate functionality object.
static SbiFunctions makeNewSbiFunction(SbiFunctions funct, java.lang.Integer id)
          Creates a new hibernate functionality object.
static SbiFuncRole makeNewSbiFunctRole(SbiFuncRole functrole, java.lang.Integer newFunctid, java.lang.Integer newRoleid)
           
static SbiLov makeNewSbiLov(SbiLov lov)
          Creates a new hibernate lov object.
static SbiLov makeNewSbiLov(SbiLov lov, java.lang.Integer id)
          Creates a new hibernate lov object.
static SbiObjects makeNewSbiObject(SbiObjects obj)
          Creates a new hibernate biobject.
static SbiObjects makeNewSbiObject(SbiObjects obj, java.lang.Integer id)
          Creates a new hibernate biobject.
static SbiObjPar makeNewSbiObjpar(SbiObjPar objpar)
          Creates a new hibernate biobject parameter object.
static SbiObjPar makeNewSbiObjpar(SbiObjPar objpar, java.lang.Integer id)
          Creates a new hibernate biobject parameter object.
static SbiObjTemplates makeNewSbiObjTemplates(SbiObjTemplates obj)
          Make new sbi obj templates.
static SbiParameters makeNewSbiParameter(SbiParameters param)
          Creates a new hibernate parameter object.
static SbiParameters makeNewSbiParameter(SbiParameters param, java.lang.Integer id)
          Creates a new hibernate parameter object.
static SbiParuse makeNewSbiParuse(SbiParuse paruse)
          Creates a new hibernate parameter use object.
static SbiParuse makeNewSbiParuse(SbiParuse paruse, java.lang.Integer id)
          Creates a new hibernate parameter use object.
static SbiParuseCk makeNewSbiParuseCk(SbiParuseCk paruseck, java.lang.Integer newParuseid, java.lang.Integer newCheckid)
           
static SbiParuseDet makeNewSbiParuseDet(SbiParuseDet parusedet, java.lang.Integer newParuseid, java.lang.Integer newRoleid)
           
static SbiSnapshots makeNewSbiSnapshots(SbiSnapshots obj)
          Make new sbi snapshots.
static SbiSubObjects makeNewSbiSubObjects(SbiSubObjects obj)
          Make new sbi sub objects.
static SbiDataSetConfig modifyExistingSbiDataSet(SbiDataSetConfig exportedDataset, org.hibernate.Session sessionCurrDB, java.lang.Integer existingId)
          Load an existing dataset and make modifications as per the exported dataset in input
static SbiDataSource modifyExistingSbiDataSource(SbiDataSource dataSource, org.hibernate.Session sessionCurrDB, java.lang.Integer existingDatasourceId)
           
static SbiLov modifyExistingSbiLov(SbiLov exportedLov, org.hibernate.Session sessionCurrDB, java.lang.Integer existingId)
          Load an existing lov and make modifications as per the exported lov in input (existing associations with parameters are maintained).
static SbiObjects modifyExistingSbiObject(SbiObjects exportedObj, org.hibernate.Session sessionCurrDB, java.lang.Integer existingId)
          Load an existing biobject and make modifications as per the exported biobject in input (existing associations with functionalities are maintained, while existing associations with parameters are deleted).
static SbiParameters modifyExistingSbiParameter(SbiParameters exportedParameter, org.hibernate.Session sessionCurrDB, java.lang.Integer existingId)
          Load an existing parameter and make modifications as per the exported parameter in input (existing associations with biobjects are maintained, while parameter uses are deleted).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DEFAULT_IMPORT_FILE_SIZE

public static final int MAX_DEFAULT_IMPORT_FILE_SIZE
See Also:
Constant Field Values
Constructor Detail

ImportUtilities

public ImportUtilities()
Method Detail

decompressArchive

public static void decompressArchive(java.lang.String pathImpTmpFolder,
                                     java.lang.String pathArchiveFile)
                              throws it.eng.spago.error.EMFUserError
Decompress the export compress file.

Parameters:
pathImpTmpFolder - The path of the import directory
pathArchiveFile - The path of the exported archive
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

getHibSessionExportDB

public static org.hibernate.SessionFactory getHibSessionExportDB(java.lang.String pathDBFolder)
                                                          throws it.eng.spago.error.EMFUserError
Creates an Hibernate session factory for the exported database.

Parameters:
pathDBFolder - The path of the folder which contains the exported database
Returns:
The Hibernate session factory
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

makeNewSbiExtRole

public static SbiExtRoles makeNewSbiExtRole(SbiExtRoles role)
Creates a new hibernate role object.

Parameters:
role - old hibernate role object
Returns:
the new hibernate role object

makeNewSbiExtRole

public static SbiExtRoles makeNewSbiExtRole(SbiExtRoles role,
                                            java.lang.Integer id)
Creates a new hibernate role object.

Parameters:
role - old hibernate role object
id - the id
Returns:
the new hibernate role object

makeNewSbiEngine

public static SbiEngines makeNewSbiEngine(SbiEngines engine)
Creates a new hibernate engine object.

Parameters:
engine - old hibernate engine object
Returns:
the new hibernate engine object

makeNewSbiDataSource

public static SbiDataSource makeNewSbiDataSource(SbiDataSource ds)
Make new data source.

Parameters:
ds - the ds
Returns:
the sbi data source

modifyExistingSbiDataSource

public static SbiDataSource modifyExistingSbiDataSource(SbiDataSource dataSource,
                                                        org.hibernate.Session sessionCurrDB,
                                                        java.lang.Integer existingDatasourceId)

makeNewSbiDataSet

public static SbiDataSetConfig makeNewSbiDataSet(SbiDataSetConfig dataset)
Make new data set.

Parameters:
dataProxy - the ds
Returns:
the sbi data set

makeNewSbiEngine

public static SbiEngines makeNewSbiEngine(SbiEngines engine,
                                          java.lang.Integer id)
Creates a new hibernate engine object.

Parameters:
engine - old hibernate engine object
id - the id
Returns:
the new hibernate engine object

makeNewSbiFunction

public static SbiFunctions makeNewSbiFunction(SbiFunctions funct)
Creates a new hibernate functionality object.

Parameters:
funct - the funct
Returns:
the new hibernate functionality object

makeNewSbiFunction

public static SbiFunctions makeNewSbiFunction(SbiFunctions funct,
                                              java.lang.Integer id)
Creates a new hibernate functionality object.

Parameters:
funct - the funct
id - the id
Returns:
the new hibernate functionality object

makeNewSbiLov

public static SbiLov makeNewSbiLov(SbiLov lov)
Creates a new hibernate lov object.

Parameters:
lov - old hibernate lov object
Returns:
the new hibernate lov object

makeNewSbiLov

public static SbiLov makeNewSbiLov(SbiLov lov,
                                   java.lang.Integer id)
Creates a new hibernate lov object.

Parameters:
lov - old hibernate lov object
id - the id
Returns:
the new hibernate lov object

makeNewSbiCheck

public static SbiChecks makeNewSbiCheck(SbiChecks check)
Creates a new hibernate check object.

Parameters:
check - old hibernate check object
Returns:
the new hibernate check object

makeNewSbiCheck

public static SbiChecks makeNewSbiCheck(SbiChecks check,
                                        java.lang.Integer id)
Creates a new hibernate check object.

Parameters:
check - old hibernate check object
id - the id
Returns:
the new hibernate check object

makeNewSbiParameter

public static SbiParameters makeNewSbiParameter(SbiParameters param)
Creates a new hibernate parameter object.

Parameters:
param - the param
Returns:
the new hibernate parameter object

makeNewSbiParameter

public static SbiParameters makeNewSbiParameter(SbiParameters param,
                                                java.lang.Integer id)
Creates a new hibernate parameter object.

Parameters:
param - the param
id - the id
Returns:
the new hibernate parameter object

makeNewSbiParuse

public static SbiParuse makeNewSbiParuse(SbiParuse paruse)
Creates a new hibernate parameter use object.

Parameters:
paruse - the paruse
Returns:
the new hibernate parameter use object

makeNewSbiParuse

public static SbiParuse makeNewSbiParuse(SbiParuse paruse,
                                         java.lang.Integer id)
Creates a new hibernate parameter use object.

Parameters:
paruse - the paruse
id - the id
Returns:
the new hibernate parameter use object

makeNewSbiObject

public static SbiObjects makeNewSbiObject(SbiObjects obj)
Creates a new hibernate biobject.

Parameters:
obj - old hibernate biobject
Returns:
the new hibernate biobject

makeNewSbiSnapshots

public static SbiSnapshots makeNewSbiSnapshots(SbiSnapshots obj)
Make new sbi snapshots.

Parameters:
obj - the obj
Returns:
the sbi snapshots

makeNewSbiSubObjects

public static SbiSubObjects makeNewSbiSubObjects(SbiSubObjects obj)
Make new sbi sub objects.

Parameters:
obj - the obj
Returns:
the sbi sub objects

makeNewSbiObjTemplates

public static SbiObjTemplates makeNewSbiObjTemplates(SbiObjTemplates obj)
Make new sbi obj templates.

Parameters:
obj - the obj
Returns:
the sbi obj templates

makeNewSbiBinContents

public static SbiBinContents makeNewSbiBinContents(SbiBinContents obj)
Make new sbi bin contents.

Parameters:
obj - the obj
Returns:
the sbi bin contents

makeNewSbiObject

public static SbiObjects makeNewSbiObject(SbiObjects obj,
                                          java.lang.Integer id)
Creates a new hibernate biobject.

Parameters:
obj - old hibernate biobject
id - the id
Returns:
the new hibernate biobject

modifyExistingSbiObject

public static SbiObjects modifyExistingSbiObject(SbiObjects exportedObj,
                                                 org.hibernate.Session sessionCurrDB,
                                                 java.lang.Integer existingId)
                                          throws it.eng.spago.error.EMFUserError
Load an existing biobject and make modifications as per the exported biobject in input (existing associations with functionalities are maintained, while existing associations with parameters are deleted).

Parameters:
exportedObj - the exported obj
sessionCurrDB - the session curr db
existingId - the existing id
Returns:
the existing biobject modified as per the exported biobject in input
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

modifyExistingSbiParameter

public static SbiParameters modifyExistingSbiParameter(SbiParameters exportedParameter,
                                                       org.hibernate.Session sessionCurrDB,
                                                       java.lang.Integer existingId)
                                                throws it.eng.spago.error.EMFUserError
Load an existing parameter and make modifications as per the exported parameter in input (existing associations with biobjects are maintained, while parameter uses are deleted).

Parameters:
exportedParameter - the exported parameter
sessionCurrDB - the session curr db
existingId - the existing id
Returns:
the existing parameter modified as per the exported parameter in input
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

makeNewSbiObjpar

public static SbiObjPar makeNewSbiObjpar(SbiObjPar objpar)
Creates a new hibernate biobject parameter object.

Parameters:
objpar - the objpar
Returns:
the sbi obj par

makeNewSbiObjpar

public static SbiObjPar makeNewSbiObjpar(SbiObjPar objpar,
                                         java.lang.Integer id)
Creates a new hibernate biobject parameter object.

Parameters:
objpar - the objpar
id - the id
Returns:
the sbi obj par

associateWithExistingEntities

public static void associateWithExistingEntities(SbiObjects obj,
                                                 SbiObjects exportedObj,
                                                 org.hibernate.Session sessionCurrDB,
                                                 ImporterMetadata importer,
                                                 MetadataAssociations metaAss)
                                          throws it.eng.spago.error.EMFUserError
Set into the biobject to the engine/object type/object state/datasource the entities associated with the exported biobject.

Parameters:
obj - the obj
exportedObj - the exported obj
sessionCurrDB - the session curr db
importer - the importer
metaAss - the meta ass
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

associateWithExistingEntities

public static void associateWithExistingEntities(SbiParameters parameter,
                                                 SbiParameters exportedParameter,
                                                 org.hibernate.Session sessionCurrDB,
                                                 ImporterMetadata importer,
                                                 MetadataAssociations metaAss)
                                          throws it.eng.spago.error.EMFUserError
Set into the parameter to the parameter type domain associated with the exported parameter.

Parameters:
parameter - the parameter
exportedParameter - the exported parameter
sessionCurrDB - the session curr db
importer - the importer
metaAss - the meta ass
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

modifyExistingSbiDataSet

public static SbiDataSetConfig modifyExistingSbiDataSet(SbiDataSetConfig exportedDataset,
                                                        org.hibernate.Session sessionCurrDB,
                                                        java.lang.Integer existingId)
Load an existing dataset and make modifications as per the exported dataset in input

Parameters:
exportedDataset - the exported dataset
sessionCurrDB - the session curr db
existingId - the existing id
Returns:
the existing dataset modified as per the exported dataset in input
Throws:
it.eng.spago.error.EMFUserError

modifyExistingSbiLov

public static SbiLov modifyExistingSbiLov(SbiLov exportedLov,
                                          org.hibernate.Session sessionCurrDB,
                                          java.lang.Integer existingId)
Load an existing lov and make modifications as per the exported lov in input (existing associations with parameters are maintained).

Parameters:
exportedLov - the exported lov
sessionCurrDB - the session curr db
existingId - the existing id
Returns:
the existing lov modified as per the exported lov in input
Throws:
it.eng.spago.error.EMFUserError

associateWithExistingEntities

public static void associateWithExistingEntities(SbiLov lov,
                                                 SbiLov exportedLov,
                                                 org.hibernate.Session sessionCurrDB,
                                                 ImporterMetadata importer,
                                                 MetadataAssociations metaAss)
                                          throws it.eng.spago.error.EMFUserError
Set into the lov the lov type domain associated with the exported lov.

Parameters:
lov - the lov
exportedLov - the exported lov
sessionCurrDB - the session curr db
importer - the importer
metaAss - the meta ass
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

associateWithExistingEntities

public static void associateWithExistingEntities(SbiDataSource datasource,
                                                 SbiDataSource exportedDatasource,
                                                 org.hibernate.Session sessionCurrDB,
                                                 ImporterMetadata importer,
                                                 MetadataAssociations metaAss)
                                          throws it.eng.spago.error.EMFUserError
Set into the datasource the dialect type domain associated with the exported datasource.

Parameters:
datasource - the datasource
exportedDatasource - the exported lov
sessionCurrDB - the session curr db
importer - the importer
metaAss - the meta ass
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

associateWithExistingEntities

public static void associateWithExistingEntities(SbiDataSetConfig dataset,
                                                 SbiDataSetConfig exportedDataset,
                                                 org.hibernate.Session sessionCurrDB,
                                                 ImporterMetadata importer,
                                                 MetadataAssociations metaAss)
                                          throws it.eng.spago.error.EMFUserError
Set into the dataset the datasource associated with the exported dataset.

Parameters:
dataset - the dataset
exportedDataset - the exported dataset
sessionCurrDB - the session curr db
importer - the importer
metaAss - the meta ass
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

makeNewSbiParuseDet

public static SbiParuseDet makeNewSbiParuseDet(SbiParuseDet parusedet,
                                               java.lang.Integer newParuseid,
                                               java.lang.Integer newRoleid)

makeNewSbiParuseCk

public static SbiParuseCk makeNewSbiParuseCk(SbiParuseCk paruseck,
                                             java.lang.Integer newParuseid,
                                             java.lang.Integer newCheckid)

makeNewSbiFunctRole

public static SbiFuncRole makeNewSbiFunctRole(SbiFuncRole functrole,
                                              java.lang.Integer newFunctid,
                                              java.lang.Integer newRoleid)

getImportFileMaxSize

public static int getImportFileMaxSize()

getImportTempFolderPath

public static java.lang.String getImportTempFolderPath()

getImportManagerInstance

public static IImportManager getImportManagerInstance()
                                               throws java.lang.Exception
Throws:
java.lang.Exception