| com.xoetrope.service.data.DataRetrievalService
DataRetrievalService | public class DataRetrievalService extends ServiceProxy (Code) | | ServiceProxy class which needs to be subclassed in order to retrieve a
specified or generated query on a database connection.
Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
the GNU Public License (GPL), please see license.txt for more details. If
you make commercial use of this software you must purchase a commercial
license from Xoetrope.
$Revision: 1.17 $
|
Method Summary | |
protected void | addChildren(Element ele, ServiceProxyArgs args, String dataitemName) Returns the standard end of element text. | public Object | call(String method, ServiceContext context) | protected void | closeConnection(ConnectionObject conn) | protected String | fixId(String id) Provided for overloading. | protected String | fixSql(ServiceProxyArgs args, String sql) Provided for overloading, this is called when this ServiceProxy has
finished generating the SQL. | protected Element | generateDataset(Element parentEle, ServiceProxyArgs args, String sql, String datasetId, String datasetName, String dataitemName) | protected ConnectionObject | getConnection() | protected String | getGeneratedWhereClauses(ServiceProxyArgs args, XModel queryMdl) | protected String | getProvidedWhereClauses(ServiceProxyArgs args, String modelStr) Creates the where clause for the provided arguments. | protected String | getSql(ServiceProxyArgs args, String queryName, String modelStr) | protected Statement | getStatement(ConnectionObject connObj) | public void | loadResults(String resultSet, XModel model) Load the returned data into the model. | protected void | recordStarted(ResultSet rs, Element ele) | public void | setAttributes(Hashtable attribs) Set the attributes for this service proxy. |
ARG_NAME_MODEL_RESTORE_PATH | final public static String ARG_NAME_MODEL_RESTORE_PATH(Code) | | This parameter should be concatenated with the zero based index of the
parameter being set
|
ARG_NAME_QUERYFIELDS | final public static String ARG_NAME_QUERYFIELDS(Code) | | This parameter stores the contents of the query fields
|
ARG_NAME_QUERYNAME | final public static String ARG_NAME_QUERYNAME(Code) | | This parameter stores the name of the query which is to be called or generated
|
ARG_NAME_RESULTSET | final public static String ARG_NAME_RESULTSET(Code) | | This parameter stores the contents of the resultset
|
TYPE_GENERATED | final public static String TYPE_GENERATED(Code) | | |
currentProject | protected XProject currentProject(Code) | | |
quote | protected char quote(Code) | | |
rootModel | protected XModel rootModel(Code) | | |
DataRetrievalService | public DataRetrievalService()(Code) | | Constructor gets a reference to the root model.
|
addChildren | protected void addChildren(Element ele, ServiceProxyArgs args, String dataitemName)(Code) | | Returns the standard end of element text. Overload this function if subitems
need to be added to the returned dataset.
Parameters: args - the arguments passed to the ServiceProxy Parameters: dataitemName - the name of the dataitem which need to be used if overloaded the record ending String |
call | public Object call(String method, ServiceContext context) throws ServiceProxyException(Code) | | Call this proxy with the specified arguments
the result of the call Parameters: context - The ServiceContext contain pass and return parameters Parameters: method - the name of the service being called throws: net.xoetrope.optional.service.ServiceProxyException - Throw an exception if there is a problem with the call |
closeConnection | protected void closeConnection(ConnectionObject conn)(Code) | | |
fixId | protected String fixId(String id)(Code) | | Provided for overloading. Used to 'fix' the names of the database fields so
that they do not have to be exposed on the client. For example 'name'
might be fixed to 'accounts.account_name'.
Parameters: id - the id of the field which was passed from the client the fixed id |
fixSql | protected String fixSql(ServiceProxyArgs args, String sql)(Code) | | Provided for overloading, this is called when this ServiceProxy has
finished generating the SQL. Overload to make final changes to the SQL
before being executed
Parameters: args - the arguments which have been passed to the ServiceProxy Parameters: sql - the SQL statement when this ServiceProxy has finished generating the fixed SQL statement |
generateDataset | protected Element generateDataset(Element parentEle, ServiceProxyArgs args, String sql, String datasetId, String datasetName, String dataitemName)(Code) | | Executes the generated SQL statement and returns the results dataset
Parameters: args - the arguments passed to the ServiceProxy Parameters: sql - the SQL statement which will be executed Parameters: datasetId - the name of the dataset tag Parameters: datasetName - the name to be given to the dataset Parameters: dataitemName - the name to be given to the dataset sub items |
getConnection | protected ConnectionObject getConnection()(Code) | | |
getGeneratedWhereClauses | protected String getGeneratedWhereClauses(ServiceProxyArgs args, XModel queryMdl)(Code) | | Retrieves the where clause provided by a generated query if there is one
Parameters: args - the arguments passed to the Service Parameters: queryMdl - the query model created from the passed query dataset the generated where clause if there is one |
getProvidedWhereClauses | protected String getProvidedWhereClauses(ServiceProxyArgs args, String modelStr)(Code) | | Creates the where clause for the provided arguments.
Parameters: args - the ServiceProxyArgs object which has been sent to this Service Parameters: modelStr - the where clause dataset which has been passed to the Service the formatted Where clause |
getSql | protected String getSql(ServiceProxyArgs args, String queryName, String modelStr)(Code) | | Generate the SQL statement for retrieving data
Parameters: args - the arguments passed to the ServiceProxy Parameters: queryName - the name of the query to be invoked Parameters: modelStr - the query fields dataset passed to the query the formatted SQL statement |
getStatement | protected Statement getStatement(ConnectionObject connObj)(Code) | | Create a statment for the query
|
loadResults | public void loadResults(String resultSet, XModel model)(Code) | | Load the returned data into the model.
Parameters: resultSet - the returned XML data |
recordStarted | protected void recordStarted(ResultSet rs, Element ele)(Code) | | Passes the ResultSet when a new record has its cursor set
Parameters: rs - the ResultSet which is being iterated |
setAttributes | public void setAttributes(Hashtable attribs)(Code) | | Set the attributes for this service proxy. This class can set attribute
for 'connectionname'.
Parameters: attribs - The Hashtable of attributes as found in the XML declaration |
|
|