it.eng.spagobi.tools.importexport
Class ImporterMetadata

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

public class ImporterMetadata
extends java.lang.Object

Implements methods to gather information from exported database and to make some checks into the current SpagoBI database


Constructor Summary
ImporterMetadata()
           
 
Method Summary
 java.lang.Object checkExistence(java.lang.Object unique, org.hibernate.Session sessionCurrDB, java.lang.Object hibObj)
          Check the existance of an object, based on his unique constraints, into the current SpagoBI database.
 java.lang.Object checkExistenceDomain(java.lang.String valueCd, java.lang.String domainCd, org.hibernate.Session sessionCurrDB, java.lang.Object hibObj)
          Check the existance of a domain, based on his unique constraints, into the current SpagoBI database.
 java.lang.Object checkExistenceKpiInstPeriod(java.lang.Integer newIdKpiInstance, java.lang.String periodicityLabel, org.hibernate.Session sessionCurrDB, java.lang.Object hibObj)
          Check the existance of a Kpi Instance Periodicity association, must get ids from kpi instance and periodicity
 java.lang.Object checkExistenceKpiModelAttr(java.lang.Integer newSbiDomainId, java.lang.String kpiModelAttrCd, org.hibernate.Session sessionCurrDB, java.lang.Object hibObj)
          Check the existance of a KpiModelAttr, based on his unique constraints, into the current SpagoBI database.existance means referring to the same domain and having the same label
 java.lang.Object checkExistenceKpiModelAttrVal(java.lang.Integer kpiModelAttrId, java.lang.Integer kpiModelId, org.hibernate.Session sessionCurrDB, java.lang.Object hibObj)
          Check the existance of a KpiModelAttrVal, .existance means referring to the same attribute and to the same model
 java.lang.Object checkExistenceModelResource(java.lang.String modelInstLabel, java.lang.String resourceCode, org.hibernate.Session sessionCurrDB, java.lang.Object hibObj)
          Check the existance of a ModelInstance Resource association, must get ids from model instance and resource
 java.lang.Object checkExistenceObjMetacontent(java.lang.String objLabel, java.lang.String metaLabel, org.hibernate.Session sessionCurrDB, java.lang.Object hibObj)
          Check the existance of a Metacontents association, must refer to the same object (label) and to the same metadata (label)
 java.lang.Object checkExistenceThresholdValue(java.lang.String labelThValue, java.lang.String thresholdId, org.hibernate.Session sessionCurrDB, java.lang.Object hibObj)
          Check the existance of a ThresholdValue, based on his unique constraints, into the current SpagoBI database.
 java.util.List getAllExportedEngines(org.hibernate.Session session)
          Get the list of exported hibernate engine objects.
 java.util.List getAllExportedRoles(org.hibernate.Session session)
          Get the list of exported hibernate role objects.
 java.util.List getAllExportedSbiObjects(org.hibernate.Session session, java.lang.String table, java.lang.String orderByField)
          Get the list of exported hibernate objects.
 java.util.List getFilteredExportedSbiObjects(org.hibernate.Session session, java.lang.String table, java.lang.String fieldName, java.lang.Object fieldValue)
           
 java.lang.Object getObject(java.lang.Integer id, java.lang.Class objClass, org.hibernate.Transaction tx, org.hibernate.Session session)
          Get an existing object identified by the id and the class.
 void updateDSRefs(java.util.Map associations, org.hibernate.Session session, MetadataLogger log)
          Upadates the data source name into the query lov objects based on the association defined by the user between exported and current SpagoBI data source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImporterMetadata

public ImporterMetadata()
Method Detail

getAllExportedRoles

public java.util.List getAllExportedRoles(org.hibernate.Session session)
                                   throws it.eng.spago.error.EMFUserError
Get the list of exported hibernate role objects.

Parameters:
session - Hiberante session for the exported database
Returns:
The list of exported hibernate roles
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

getAllExportedEngines

public java.util.List getAllExportedEngines(org.hibernate.Session session)
                                     throws it.eng.spago.error.EMFUserError
Get the list of exported hibernate engine objects.

Parameters:
session - Hibernate session for the exported database
Returns:
The list of exported hibernate engines
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

getAllExportedSbiObjects

public java.util.List getAllExportedSbiObjects(org.hibernate.Session session,
                                               java.lang.String table,
                                               java.lang.String orderByField)
                                        throws it.eng.spago.error.EMFUserError
Get the list of exported hibernate objects.

Parameters:
session - Hibernate session for the exported database
table - The name of the table corresponding to the hibernate objects to gather
Returns:
The list of exported hibernate objects
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

getFilteredExportedSbiObjects

public java.util.List getFilteredExportedSbiObjects(org.hibernate.Session session,
                                                    java.lang.String table,
                                                    java.lang.String fieldName,
                                                    java.lang.Object fieldValue)
                                             throws it.eng.spago.error.EMFUserError
Throws:
it.eng.spago.error.EMFUserError

getObject

public java.lang.Object getObject(java.lang.Integer id,
                                  java.lang.Class objClass,
                                  org.hibernate.Transaction tx,
                                  org.hibernate.Session session)
Get an existing object identified by the id and the class.

Parameters:
id - The Object id
objClass - The class of the object
session - Hibernate session for a database
tx - the tx
Returns:
The existing hibernate object

updateDSRefs

public void updateDSRefs(java.util.Map associations,
                         org.hibernate.Session session,
                         MetadataLogger log)
                  throws it.eng.spago.error.EMFUserError
Upadates the data source name into the query lov objects based on the association defined by the user between exported and current SpagoBI data source.

Parameters:
associations - Map of associations between exported data sources and data sources of the current SpagoBI platform
session - Hibernate session for the exported database
log - the log
Throws:
it.eng.spago.error.EMFUserError
it.eng.spago.error.EMFUserError - the EMF user error

checkExistence

public java.lang.Object checkExistence(java.lang.Object unique,
                                       org.hibernate.Session sessionCurrDB,
                                       java.lang.Object hibObj)
                                throws it.eng.spago.error.EMFUserError
Check the existance of an object, based on his unique constraints, into the current SpagoBI database.

Parameters:
unique - The object which contains the unique constraints for the object
sessionCurrDB - Hibernate session for the current SpagoBI database
hibObj - An empty object usefull to identify the kind of object to analize
Returns:
The existing Object or null if it doesn't exist
Throws:
it.eng.spago.error.EMFUserError
it.eng.spago.error.EMFUserError - the EMF user error

checkExistenceDomain

public java.lang.Object checkExistenceDomain(java.lang.String valueCd,
                                             java.lang.String domainCd,
                                             org.hibernate.Session sessionCurrDB,
                                             java.lang.Object hibObj)
                                      throws it.eng.spago.error.EMFUserError
Check the existance of a domain, based on his unique constraints, into the current SpagoBI database. Requires two labels

Parameters:
unique - The object which contains the unique constraints for the object
domainCd - domain code
sessionCurrDB - Hibernate session for the current SpagoBI database
hibObj - An empty object usefull to identify the kind of object to analize
Returns:
The existing Object or null if it doesn't exist
Throws:
it.eng.spago.error.EMFUserError
it.eng.spago.error.EMFUserError - the EMF user error

checkExistenceThresholdValue

public java.lang.Object checkExistenceThresholdValue(java.lang.String labelThValue,
                                                     java.lang.String thresholdId,
                                                     org.hibernate.Session sessionCurrDB,
                                                     java.lang.Object hibObj)
                                              throws it.eng.spago.error.EMFUserError
Check the existance of a ThresholdValue, based on his unique constraints, into the current SpagoBI database. Requires two labels

Parameters:
unique - The object which contains the unique constraints for the object
domainCd - domain code
sessionCurrDB - Hibernate session for the current SpagoBI database
hibObj - An empty object usefull to identify the kind of object to analize
Returns:
The existing Object or null if it doesn't exist
Throws:
it.eng.spago.error.EMFUserError
it.eng.spago.error.EMFUserError - the EMF user error

checkExistenceModelResource

public java.lang.Object checkExistenceModelResource(java.lang.String modelInstLabel,
                                                    java.lang.String resourceCode,
                                                    org.hibernate.Session sessionCurrDB,
                                                    java.lang.Object hibObj)
                                             throws it.eng.spago.error.EMFUserError
Check the existance of a ModelInstance Resource association, must get ids from model instance and resource

Parameters:
modelInstLabel - model instance label
resourceLabel - resource Label
sessionCurrDB - Hibernate session for the current SpagoBI database
hibObj - An empty object usefull to identify the kind of object to analize
Returns:
The existing Object or null if it doesn't exist
Throws:
it.eng.spago.error.EMFUserError
it.eng.spago.error.EMFUserError - the EMF user error

checkExistenceObjMetacontent

public java.lang.Object checkExistenceObjMetacontent(java.lang.String objLabel,
                                                     java.lang.String metaLabel,
                                                     org.hibernate.Session sessionCurrDB,
                                                     java.lang.Object hibObj)
                                              throws it.eng.spago.error.EMFUserError
Check the existance of a Metacontents association, must refer to the same object (label) and to the same metadata (label)

Parameters:
objLabel - label of the SbiObject
metaLabel - label of metadata
sessionCurrDB - Hibernate session for the current SpagoBI database
hibObj - An empty object usefull to identify the kind of object to analize
Returns:
The existing Object or null if it doesn't exist
Throws:
it.eng.spago.error.EMFUserError
it.eng.spago.error.EMFUserError - the EMF user error

checkExistenceKpiInstPeriod

public java.lang.Object checkExistenceKpiInstPeriod(java.lang.Integer newIdKpiInstance,
                                                    java.lang.String periodicityLabel,
                                                    org.hibernate.Session sessionCurrDB,
                                                    java.lang.Object hibObj)
                                             throws it.eng.spago.error.EMFUserError
Check the existance of a Kpi Instance Periodicity association, must get ids from kpi instance and periodicity

Parameters:
modInstLabel - modelInstanceLabel
periodicityLabel - periodicity Label
sessionCurrDB - Hibernate session for the current SpagoBI database
hibObj - An empty object usefull to identify the kind of object to analize
Returns:
The existing Object or null if it doesn't exist
Throws:
it.eng.spago.error.EMFUserError
it.eng.spago.error.EMFUserError - the EMF user error

checkExistenceKpiModelAttr

public java.lang.Object checkExistenceKpiModelAttr(java.lang.Integer newSbiDomainId,
                                                   java.lang.String kpiModelAttrCd,
                                                   org.hibernate.Session sessionCurrDB,
                                                   java.lang.Object hibObj)
                                            throws it.eng.spago.error.EMFUserError
Check the existance of a KpiModelAttr, based on his unique constraints, into the current SpagoBI database.existance means referring to the same domain and having the same label

Parameters:
unique - The object which contains the unique constraints for the object
domainCd - domain code
sessionCurrDB - Hibernate session for the current SpagoBI database
hibObj - An empty object usefull to identify the kind of object to analize
Returns:
The existing Object or null if it doesn't exist
Throws:
it.eng.spago.error.EMFUserError
it.eng.spago.error.EMFUserError - the EMF user error

checkExistenceKpiModelAttrVal

public java.lang.Object checkExistenceKpiModelAttrVal(java.lang.Integer kpiModelAttrId,
                                                      java.lang.Integer kpiModelId,
                                                      org.hibernate.Session sessionCurrDB,
                                                      java.lang.Object hibObj)
                                               throws it.eng.spago.error.EMFUserError
Check the existance of a KpiModelAttrVal, .existance means referring to the same attribute and to the same model

Parameters:
kpiModelAttrId - The id of the attribute referred
KpiModelID - id of the model referred
sessionCurrDB - Hibernate session for the current SpagoBI database
hibObj - An empty object usefull to identify the kind of object to analize
Returns:
The existing Object or null if it doesn't exist
Throws:
it.eng.spago.error.EMFUserError
it.eng.spago.error.EMFUserError - the EMF user error