it.eng.spagobi.tools.importexport
Interface IImportManager

All Known Implementing Classes:
ImportManager

public interface IImportManager


Field Summary
static java.lang.String IMPORT_ASS_DEFAULT_MODE
           
static java.lang.String IMPORT_ASS_PREDEFINED_MODE
           
 
Method Summary
 boolean associateAllExportedDataSourcesByUserAssociation()
          Tries to associate all exported data sources using the user associations; returns true is some data sources associations is required, false otherwise.
 boolean associateAllExportedEnginesByUserAssociation()
          Tries to associate all exported engines using the user associations; returns true is some engines associations is required, false otherwise.
 boolean associateAllExportedRolesByUserAssociation()
          Tries to associate all exported roles using the user associations; returns true is some roles associations is required, false otherwise.
 void checkExistingMetadata()
          Check the existance of the exported metadata into the current system metadata and insert their associations into the association object MeatadataAssociation.
 void checkRoleReferences(java.util.Map roleAssociations)
          checks if two or more exported roles are associate to the same current role.
 void closeSession()
          Close session to exported and current databases.
 ImportResultInfo commitAllChanges()
          Commits all changes made on exported and current databases.
 AssociationFile getAssociationFile()
          Returns the AssociationFile involved in the current import operation, if any.
 java.lang.String getCurrentVersion()
          Gets the current SpagobI version.
 java.lang.Object getExistingObject(java.lang.Integer id, java.lang.Class objClass)
          Get an existing object identified by the id and the class.
 java.util.List getExportedDataSources()
          Gets the list of exported data sources.
 java.util.List getExportedEngines()
          Gets the list of all exported engines.
 java.lang.Object getExportedObject(java.lang.Integer id, java.lang.Class objClass)
          Get an exported object identified by the id and the class.
 java.util.List getExportedRoles()
          Gets the list of all exported roles.
 java.lang.String getExportVersion()
          Gets the SpagoBI version of the exported file.
 java.lang.String getImpAssMode()
          Gets the import association mode.
 MetadataAssociations getMetadataAssociation()
          Gets the object which contains the association between exported metadata and the current system metadata.
 UserAssociationsKeeper getUserAssociation()
          Gets the object which contains only the association set by user between exported metadata and the current system metadata.
 void importObjects(boolean overwrite)
          Imports the exported objects.
 void init(java.lang.String pathImportTmpFold, java.lang.String archiveName, byte[] archiveContent)
          Prepare the environment for the import procedure.
 void openSession()
          Open session to exported and current databases.
 void setAssociationFile(AssociationFile associationFile)
          Sets the AssociationFile involved in the current import operation.
 void setImpAssMode(java.lang.String impAssMode)
          Sets the import association mode.
 void stopImport()
          Ends the import procedure.
 

Field Detail

IMPORT_ASS_PREDEFINED_MODE

static final java.lang.String IMPORT_ASS_PREDEFINED_MODE
See Also:
Constant Field Values

IMPORT_ASS_DEFAULT_MODE

static final java.lang.String IMPORT_ASS_DEFAULT_MODE
See Also:
Constant Field Values
Method Detail

init

void init(java.lang.String pathImportTmpFold,
          java.lang.String archiveName,
          byte[] archiveContent)
          throws it.eng.spago.error.EMFUserError
Prepare the environment for the import procedure. This method must be invoked first.

Parameters:
archiveName - the name of the compress exported file
archiveContent - the bytes of the compress exported file
pathImportTmpFold - the path import tmp fold
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

openSession

void openSession()
                 throws it.eng.spago.error.EMFUserError
Open session to exported and current databases. This method must be invoked before any operation.

Throws:
it.eng.spago.error.EMFUserError - the EMF user error

closeSession

void closeSession()
Close session to exported and current databases. This method must be invoked when all needed operation are performed.

Throws:
it.eng.spago.error.EMFUserError - the EMF user error

getExportVersion

java.lang.String getExportVersion()
Gets the SpagoBI version of the exported file.

Returns:
The SpagoBI version of the exported file

getCurrentVersion

java.lang.String getCurrentVersion()
Gets the current SpagobI version.

Returns:
The current SpagoBI version

importObjects

void importObjects(boolean overwrite)
                   throws it.eng.spago.error.EMFUserError
Imports the exported objects.

Parameters:
overwrite - the overwrite
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

getExportedRoles

java.util.List getExportedRoles()
                                throws it.eng.spago.error.EMFUserError
Gets the list of all exported roles.

Returns:
The list of exported roles
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

getExportedEngines

java.util.List getExportedEngines()
                                  throws it.eng.spago.error.EMFUserError
Gets the list of all exported engines.

Returns:
The list of exported engines
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

getExportedDataSources

java.util.List getExportedDataSources()
                                      throws it.eng.spago.error.EMFUserError
Gets the list of exported data sources.

Returns:
List of the exported data sources
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

commitAllChanges

ImportResultInfo commitAllChanges()
                                  throws it.eng.spago.error.EMFUserError
Commits all changes made on exported and current databases.

Returns:
String, the path of the log file
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

checkExistingMetadata

void checkExistingMetadata()
                           throws it.eng.spago.error.EMFUserError
Check the existance of the exported metadata into the current system metadata and insert their associations into the association object MeatadataAssociation.

Throws:
it.eng.spago.error.EMFUserError - the EMF user error

stopImport

void stopImport()
Ends the import procedure.


getMetadataAssociation

MetadataAssociations getMetadataAssociation()
Gets the object which contains the association between exported metadata and the current system metadata.

Returns:
MetadataAssociation the object which contains the association between exported metadata and the current system metadata

getUserAssociation

UserAssociationsKeeper getUserAssociation()
Gets the object which contains only the association set by user between exported metadata and the current system metadata.

Returns:
MetadataAssociation the object which contains the association, set by user, between exported metadata and the current system metadata

getAssociationFile

AssociationFile getAssociationFile()
Returns the AssociationFile involved in the current import operation, if any.

Returns:
the AssociationFile involved in the current import operation, if any

setAssociationFile

void setAssociationFile(AssociationFile associationFile)
Sets the AssociationFile involved in the current import operation.

Parameters:
associationFile - the association file

checkRoleReferences

void checkRoleReferences(java.util.Map roleAssociations)
                         throws it.eng.spago.error.EMFUserError
checks if two or more exported roles are associate to the same current role.

Parameters:
roleAssociations - Map of association between exported roles and roles of the portal in use
Throws:
it.eng.spago.error.EMFUserError - if two ore more exported roles are associate to the same current role

getExistingObject

java.lang.Object getExistingObject(java.lang.Integer id,
                                   java.lang.Class objClass)
Get an existing object identified by the id and the class.

Parameters:
id - The Object id
objClass - The class of the object
Returns:
The existing hibernate object

getExportedObject

java.lang.Object getExportedObject(java.lang.Integer id,
                                   java.lang.Class objClass)
Get an exported object identified by the id and the class.

Parameters:
id - The Object id
objClass - The class of the object
Returns:
The existing hibernate object

getImpAssMode

java.lang.String getImpAssMode()
Gets the import association mode.

Returns:
the association mode

setImpAssMode

void setImpAssMode(java.lang.String impAssMode)
Sets the import association mode.

Parameters:
impAssMode - The import association mode

associateAllExportedRolesByUserAssociation

boolean associateAllExportedRolesByUserAssociation()
                                                   throws it.eng.spago.error.EMFUserError
Tries to associate all exported roles using the user associations; returns true is some roles associations is required, false otherwise.

Returns:
true is some roles associations is required, false otherwise
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

associateAllExportedEnginesByUserAssociation

boolean associateAllExportedEnginesByUserAssociation()
                                                     throws it.eng.spago.error.EMFUserError
Tries to associate all exported engines using the user associations; returns true is some engines associations is required, false otherwise.

Returns:
true is some engines associations is required, false otherwise
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

associateAllExportedDataSourcesByUserAssociation

boolean associateAllExportedDataSourcesByUserAssociation()
                                                         throws it.eng.spago.error.EMFUserError
Tries to associate all exported data sources using the user associations; returns true is some data sources associations is required, false otherwise.

Returns:
true is some data sources associations is required, false otherwise
Throws:
it.eng.spago.error.EMFUserError - the EMF user error