org.pentaho.platform.dataaccess.datasource.wizard.models
Class DatasourceModel

java.lang.Object
  extended by org.pentaho.ui.xul.XulEventSourceAdapter
      extended by org.pentaho.platform.dataaccess.datasource.wizard.models.DatasourceModel
All Implemented Interfaces:
IModelInfoValidationListener, IRelationalModelValidationListener, IWizardModel, org.pentaho.ui.xul.XulEventSource

public class DatasourceModel
extends org.pentaho.ui.xul.XulEventSourceAdapter
implements IWizardModel, IRelationalModelValidationListener, IModelInfoValidationListener


Constructor Summary
DatasourceModel()
           
 
Method Summary
 void clearModel()
           
 void copyOverMetadata(org.pentaho.metadata.model.Domain oldDomain, org.pentaho.metadata.model.Domain newDomain)
          This is a utility method that looks into an old domain for the same column ids, and then copies over the old metadata into the new.
 String generateTableName()
          Strips all non-alphanumeric characters from the datasourceName, replaces spaces with underscores, and finally lowercases the string for return making it valid for use as a table name
 String getDatasourceName()
           
 DatasourceType getDatasourceType()
           
 org.pentaho.metadata.model.Domain getDomain()
           
 GuiStateModel getGuiStateModel()
           
 ModelInfo getModelInfo()
           
 String getQuery()
           
 IConnection getSelectedRelationalConnection()
           
 boolean isValidated()
           
 void onCsvInValid()
           
 void onCsvModelInValid()
           
 void onCsvModelValid()
           
 void onCsvValid()
           
 void onModelInfoInvalid()
           
 void onModelInfoValid()
           
 void onRelationalModelInValid()
          Fired when the the model is valid
 void onRelationalModelValid()
          Fired when the the model is valid
 void setDatasourceName(String datasourceName)
           
 void setDatasourceType(DatasourceType datasourceType)
           
 void setDomain(org.pentaho.metadata.model.Domain domain)
           
 void setGuiStateModel(GuiStateModel guiStateModel)
           
 void setModelInfo(ModelInfo modelInfo)
           
 void setQuery(String value)
           
 void setSelectedRelationalConnection(IConnection value)
           
 void validate()
           
 
Methods inherited from class org.pentaho.ui.xul.XulEventSourceAdapter
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatasourceModel

public DatasourceModel()
Method Detail

getGuiStateModel

public GuiStateModel getGuiStateModel()

setGuiStateModel

public void setGuiStateModel(GuiStateModel guiStateModel)

getDatasourceName

public String getDatasourceName()

setDatasourceName

public void setDatasourceName(String datasourceName)

getSelectedRelationalConnection

public IConnection getSelectedRelationalConnection()

setSelectedRelationalConnection

public void setSelectedRelationalConnection(IConnection value)

getQuery

public String getQuery()

setQuery

public void setQuery(String value)

getDomain

public org.pentaho.metadata.model.Domain getDomain()

setDomain

public void setDomain(org.pentaho.metadata.model.Domain domain)

getModelInfo

public ModelInfo getModelInfo()

setModelInfo

public void setModelInfo(ModelInfo modelInfo)

isValidated

public boolean isValidated()
Specified by:
isValidated in interface IWizardModel

getDatasourceType

public DatasourceType getDatasourceType()

setDatasourceType

public void setDatasourceType(DatasourceType datasourceType)

validate

public void validate()

clearModel

public void clearModel()
Specified by:
clearModel in interface IWizardModel

onRelationalModelInValid

public void onRelationalModelInValid()
Description copied from interface: IRelationalModelValidationListener
Fired when the the model is valid

Specified by:
onRelationalModelInValid in interface IRelationalModelValidationListener

onRelationalModelValid

public void onRelationalModelValid()
Description copied from interface: IRelationalModelValidationListener
Fired when the the model is valid

Specified by:
onRelationalModelValid in interface IRelationalModelValidationListener

onCsvModelInValid

public void onCsvModelInValid()

onCsvModelValid

public void onCsvModelValid()

copyOverMetadata

public void copyOverMetadata(org.pentaho.metadata.model.Domain oldDomain,
                             org.pentaho.metadata.model.Domain newDomain)
This is a utility method that looks into an old domain for the same column ids, and then copies over the old metadata into the new.

Parameters:
oldDomain -
newDomain -

onModelInfoInvalid

public void onModelInfoInvalid()
Specified by:
onModelInfoInvalid in interface IModelInfoValidationListener

onModelInfoValid

public void onModelInfoValid()
Specified by:
onModelInfoValid in interface IModelInfoValidationListener

generateTableName

public String generateTableName()
Strips all non-alphanumeric characters from the datasourceName, replaces spaces with underscores, and finally lowercases the string for return making it valid for use as a table name

Returns:

onCsvInValid

public void onCsvInValid()
Specified by:
onCsvInValid in interface IModelInfoValidationListener

onCsvValid

public void onCsvValid()
Specified by:
onCsvValid in interface IModelInfoValidationListener