org.pentaho.platform.dataaccess.datasource.wizard.service.gwt
Class DatasourceDebugGwtServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
              extended by com.google.gwt.user.server.rpc.RemoteServiceServlet
                  extended by org.pentaho.platform.dataaccess.datasource.wizard.service.gwt.DatasourceDebugGwtServlet
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, IDatasourceService, IGwtDatasourceService

public class DatasourceDebugGwtServlet
extends com.google.gwt.user.server.rpc.RemoteServiceServlet
implements IGwtDatasourceService

See Also:
Serialized Form

Constructor Summary
DatasourceDebugGwtServlet()
           
 
Method Summary
 boolean deleteLogicalModel(String domainId, String modelName)
          Delete the Logical Mode identified by the Domain ID and the Model Name
 DatasourceDTO deSerializeModelState(String dtoStr)
          Returns a DatasourceDTO from a serialized string.
 SerializedResultSet doPreview(String connectionName, String query, String previewLimit)
          Returns the serialized version of SQL ResultSet.
 BusinessData generateLogicalModel(String modelName, String connectionName, String dbType, 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 modelName, boolean overwrite)
          Save the generated model.
 String serializeModelState(DatasourceDTO dto)
          Returns a serialized version of the DatasourceDTO class.
 
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
getSerializationPolicy, processCall, processPost
 
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost
 
Methods inherited from class javax.servlet.http.HttpServlet
service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatasourceDebugGwtServlet

public DatasourceDebugGwtServlet()
Method Detail

doPreview

public SerializedResultSet doPreview(String connectionName,
                                     String query,
                                     String previewLimit)
                              throws DatasourceServiceException
Description copied from interface: IDatasourceService
Returns the serialized version of SQL ResultSet.

Specified by:
doPreview in interface IDatasourceService
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

public BusinessData generateLogicalModel(String modelName,
                                         String connectionName,
                                         String dbType,
                                         String query,
                                         String previewLimit)
                                  throws DatasourceServiceException
Description copied from interface: IDatasourceService
Returns the generated relational based logical model along with the sample data for the given connection name and query

Specified by:
generateLogicalModel in interface IDatasourceService
Parameters:
modelName - - Name of the model to be generated
connectionName - - Name of the connection
dbType - - Dialect type
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

public boolean saveLogicalModel(org.pentaho.metadata.model.Domain modelName,
                                boolean overwrite)
                         throws DatasourceServiceException
Description copied from interface: IDatasourceService
Save the generated model. This could be either Relational or CSV based model

Specified by:
saveLogicalModel in interface IDatasourceService
Parameters:
modelName - - generated Domain
overwrite - - should the domain be overwritten or not
Returns:
true if the model was saved successfully otherwise false
Throws:
DatasourceServiceException

gwtWorkaround

public BogoPojo gwtWorkaround(BogoPojo pojo)
Description copied from interface: IDatasourceService
This is a method for the Gwt workaround. This should not be used by any client at all

Specified by:
gwtWorkaround in interface IDatasourceService
Returns:
BogoPojo

hasPermission

public boolean hasPermission()
Description copied from interface: IDatasourceService
Returns whether the current user has the authority to create/edit/delete datasources

Specified by:
hasPermission in interface IDatasourceService
Returns:
true if the user has permission otherwise false

deleteLogicalModel

public boolean deleteLogicalModel(String domainId,
                                  String modelName)
                           throws DatasourceServiceException
Description copied from interface: IDatasourceService
Delete the Logical Mode identified by the Domain ID and the Model Name

Specified by:
deleteLogicalModel in interface IDatasourceService
Returns:
true if the deletion of model was successful otherwise false.
Throws:
DatasourceServiceException

getLogicalModels

public List<LogicalModelSummary> getLogicalModels()
                                           throws DatasourceServiceException
Description copied from interface: IDatasourceService
Returns the list of Logical Models. This method is used by the client app to display list of models

Specified by:
getLogicalModels in interface IDatasourceService
Returns:
List of LogicalModelSummary.
Throws:
DatasourceServiceException

loadBusinessData

public BusinessData loadBusinessData(String domainId,
                                     String modelId)
                              throws DatasourceServiceException
Description copied from interface: IDatasourceService
Returns the save logical model for a given Domain ID and Model ID

Specified by:
loadBusinessData in interface IDatasourceService
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

serializeModelState

public String serializeModelState(DatasourceDTO dto)
                           throws DatasourceServiceException
Description copied from interface: IDatasourceService
Returns a serialized version of the DatasourceDTO class.

Specified by:
serializeModelState in interface IDatasourceService
Parameters:
dto - - Datasource data transfer object to serialize
Throws:
DatasourceServiceException

deSerializeModelState

public DatasourceDTO deSerializeModelState(String dtoStr)
                                    throws DatasourceServiceException
Description copied from interface: IDatasourceService
Returns a DatasourceDTO from a serialized string.

Specified by:
deSerializeModelState in interface IDatasourceService
Parameters:
dtoStr - - Datasource data transfer object to serialize
Throws:
DatasourceServiceException