org.pentaho.platform.dataaccess.datasource.wizard.service.gwt
Interface IDatasourceService

All Known Subinterfaces:
IGwtDatasourceService
All Known Implementing Classes:
DatasourceDebugGwtServlet, DatasourceServiceImpl, InMemoryDatasourceServiceImpl

public interface IDatasourceService


Method Summary
 boolean deleteLogicalModel(String domainId, String modelName)
          Delete the Logical Mode identified by the Domain ID and the Model Name
 SerializedResultSet doPreview(String connectionName, String query, String previewLimit)
          Returns the serialized version of SQL ResultSet.
 BusinessData generateInlineEtlLogicalModel(String modelName, String relativeFilePath, boolean headersPresent, String delimeter, String enclosure)
          Returns the generated csv based logical model along with the sample data for the given connection name and query
 BusinessData generateLogicalModel(String modelName, String connectionName, String query, String previewLimit)
          Returns the generated relational based logical model along with the sample data for the given connection name and query
 List<LogicalModelSummary> getLogicalModels()
          Returns the list of Logical Models.
 BogoPojo gwtWorkaround(BogoPojo pojo)
          This is a method for the Gwt workaround.
 boolean hasPermission()
          Returns whether the current user has the authority to create/edit/delete datasources
 BusinessData loadBusinessData(String domainId, String modelId)
          Returns the save logical model for a given Domain ID and Model ID
 boolean saveLogicalModel(org.pentaho.metadata.model.Domain domain, boolean overwrite)
          Save the generated model.
 

Method Detail

getLogicalModels

List<LogicalModelSummary> getLogicalModels()
                                           throws DatasourceServiceException
Returns the list of Logical Models. This method is used by the client app to display list of models

Returns:
List of LogicalModelSummary.
Throws:
DatasourceServiceException

deleteLogicalModel

boolean deleteLogicalModel(String domainId,
                           String modelName)
                           throws DatasourceServiceException
Delete the Logical Mode identified by the Domain ID and the Model Name

Returns:
true if the deletion of model was successful otherwise false.
Throws:
DatasourceServiceException

doPreview

SerializedResultSet doPreview(String connectionName,
                              String query,
                              String previewLimit)
                              throws DatasourceServiceException
Returns the serialized version of SQL ResultSet.

Parameters:
connectionName - - Name of the connection
query - - Query which needs to be executed
previewLimit - - Number of row which needs to be returned for this query
Returns:
SerializedResultSet - This object contains the data, column name and column types
Throws:
DatasourceServiceException

generateLogicalModel

BusinessData generateLogicalModel(String modelName,
                                  String connectionName,
                                  String query,
                                  String previewLimit)
                                  throws DatasourceServiceException
Returns the generated relational based logical model along with the sample data for the given connection name and query

Parameters:
modelName - - Name of the model to be generated
connectionName - - Name of the connection
query - - Query which needs to be executed
previewLimit - - Number of row which needs to be returned for this query
Returns:
BusinessData - This object contains the data, column name, column types and sample data
Throws:
DatasourceServiceException

saveLogicalModel

boolean saveLogicalModel(org.pentaho.metadata.model.Domain domain,
                         boolean overwrite)
                         throws DatasourceServiceException
Save the generated model. This could be either Relational or CSV based model

Parameters:
domain - - generated Domain
overwrite - - should the domain be overwritten or not
Returns:
true if the model was saved successfully otherwise false
Throws:
DatasourceServiceException

generateInlineEtlLogicalModel

BusinessData generateInlineEtlLogicalModel(String modelName,
                                           String relativeFilePath,
                                           boolean headersPresent,
                                           String delimeter,
                                           String enclosure)
                                           throws DatasourceServiceException
Returns the generated csv based logical model along with the sample data for the given connection name and query

Parameters:
modelName - - Name of the model to be generated
relativeFilePath - - Relative path to the file that needs to be uploaded
headersPresent - - Are headers present in the file or not
delimeter - - Delimiter that was used in the file
enclosure - - Enclosure that was used in the file
Returns:
BusinessData - This object contains the data, column name, column types and sample data
Throws:
DatasourceServiceException

hasPermission

boolean hasPermission()
Returns whether the current user has the authority to create/edit/delete datasources

Returns:
true if the user has permission otherwise false
Throws:
DatasourceServiceException

gwtWorkaround

BogoPojo gwtWorkaround(BogoPojo pojo)
This is a method for the Gwt workaround. This should not be used by any client at all

Returns:
BogoPojo

loadBusinessData

BusinessData loadBusinessData(String domainId,
                              String modelId)
                              throws DatasourceServiceException
Returns the save logical model for a given Domain ID and Model ID

Parameters:
domainId - - ID of the domain to be generated
modelId - - ID of the model to be generated
Returns:
BusinessData - This object contains the data, column name, column types and sample data
Throws:
DatasourceServiceException