|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.orion.sdata.servlet.JDBCResourceKind
com.sage.orion.sdata.servlet.swtservice.ShortCutsResourceKind
public class ShortCutsResourceKind
This class handles the Shortcuts Resource Kind
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.sage.orion.sdata.servlet.JDBCResourceKind |
---|
JDBCResourceKind.HTTPMethodsAuthorizator, JDBCResourceKind.ResourceAuthorizator, JDBCResourceKind.ResourceDataAuthorizator |
Field Summary |
---|
Fields inherited from class com.sage.orion.sdata.servlet.JDBCResourceKind |
---|
ADD, ALTER_TABLE, AND, CLOSE_BRACE, COMMA, CONSTRAINT, DEFAULT, DEFAULT_LANGUAGE_CODE, DELETE_FROM, DROP, DROP_TABLE, FROM, NOT_NULL, OPEN_BRACE, PRIMARY_KEY, SELECT, UICONTENT_SQL_SELECT_STMT, VARCHAR_50, WHERE |
Constructor Summary | |
---|---|
ShortCutsResourceKind(java.lang.String companyID,
ApplicationContext applicationContext,
ConnectionPool connectionPool,
java.lang.String authToken)
Constructor |
Method Summary | |
---|---|
protected void |
buildCustomizedQueryFields()
Builds the customized list of fields from multiple RosourceKinds for the CUSTOMIZED_QUERY. |
protected void |
doCreateTable(java.lang.String companyID,
ApplicationContext context,
java.sql.Connection connection)
Creates the shortcuts database table if it doesn't exist yet. |
protected ResourceResponse |
doGet(SDataRequest request,
java.sql.Connection connection)
This method takes appropriate action and generates ResourceResponse based on the specified request |
protected SDataResourceElement |
fillResultSetResourceElement(java.util.List<java.lang.String> selectCriteria,
java.sql.ResultSet resultSet,
SDataRequest request)
Fills a newly created element with the tuple values got from the result set, adds the corresponding values from the portlet resource kind. |
protected java.util.List<FieldDefinition> |
getAllFields()
returns a list of FieldDefinitions in the ResourceKind |
protected java.lang.String |
getCalculateFieldValue(java.lang.String value,
SDataRequest request,
java.sql.ResultSet resultSet,
int fieldIndex)
Get the value of the calculated field, if it is a regular (non-calculated) field then the original value will be returned unchanged |
protected java.lang.String |
getCustomizedQuery()
Get the customized SQL query if need to used instead of default query build by JDBCResourceKind |
java.lang.String |
getName()
|
protected java.lang.String[] |
getPrimaryKey()
Get the primary key of the underlying JDBC table for which one JDBCResourceKindImpl is created |
protected ResourceResponse |
getResultRecordAndCreateResponse(java.sql.PreparedStatement prepareResultRecordGet,
int httpResponseCode,
SDataRequest request)
Gets a result set with the lone record as specified by the prepared statement, then creates an SData response for that lone record. |
protected static java.util.List<FieldDefinition> |
getTableFields()
Returns a list of the fields from the resource kind table |
java.lang.String |
getTableName()
Get the JDBC table name for which ResourceKindImpl is created |
boolean |
isUserSpecificResource()
Indicates whether the resource is user specific or not. |
protected boolean |
supportDelete()
Indicates whether the ResourceKind in general supports DELETE or not. |
protected boolean |
supportGet()
Indicates whether the ResourceKind in general supports GET or not. |
protected boolean |
supportPost()
Indicates whether the ResourceKind in general supports POST or not. |
protected boolean |
supportPut()
Indicates whether the ResourceKind in general supports PUT or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShortCutsResourceKind(java.lang.String companyID, ApplicationContext applicationContext, ConnectionPool connectionPool, java.lang.String authToken)
companyID
- default company IDapplicationContext
- SData application contextconnectionPool
- connection pool of the underline DBauthToken
- the authentication tokenMethod Detail |
---|
protected void buildCustomizedQueryFields()
protected void doCreateTable(java.lang.String companyID, ApplicationContext context, java.sql.Connection connection)
companyID
- string companyIDcontext
- The application context.connection
- The database connection.protected ResourceResponse doGet(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
doGet
in class JDBCResourceKind
request
- the SDataRequestconnection
- the JDBC connection object which provides a gateway to access
underlying DB
java.sql.SQLException
- SQLExceptionprotected ResourceResponse getResultRecordAndCreateResponse(java.sql.PreparedStatement prepareResultRecordGet, int httpResponseCode, SDataRequest request) throws java.sql.SQLException
Gets a result set with the lone record as specified by the prepared statement, then creates an SData response for that lone record. The response's HTTP response code and resources URL are as specified.
This is intended for use when inserting or updating a record, as the SData specification requires that the response contain the inserted or updated record (where the record includes any automatic changes such as auto-generated key fields).
getResultRecordAndCreateResponse
in class JDBCResourceKind
prepareResultRecordGet
- The prepared statement for getting that result set that contains
a single record (basically the inserted or updated record).httpResponseCode
- The HTTP response code to use.request
- The originating SData request.
java.sql.SQLException
- SQLExceptionprotected SDataResourceElement fillResultSetResourceElement(java.util.List<java.lang.String> selectCriteria, java.sql.ResultSet resultSet, SDataRequest request) throws java.sql.SQLException
fillResultSetResourceElement
in class JDBCResourceKind
selectCriteria
- the list of columns to be included (presently not supported)resultSet
- the Java's result set which exposes tuples' datarequest
- the input SDataRequest
java.sql.SQLException
- SQLExceptionprotected java.lang.String[] getPrimaryKey()
JDBCResourceKind
getPrimaryKey
in class JDBCResourceKind
public java.lang.String getTableName()
JDBCResourceKind
getTableName
in class JDBCResourceKind
public java.lang.String getName()
protected java.lang.String getCustomizedQuery()
JDBCResourceKind
JDBCResourceKind
getCustomizedQuery
in class JDBCResourceKind
protected static java.util.List<FieldDefinition> getTableFields()
protected java.util.List<FieldDefinition> getAllFields()
getAllFields
in class JDBCResourceKind
protected java.lang.String getCalculateFieldValue(java.lang.String value, SDataRequest request, java.sql.ResultSet resultSet, int fieldIndex)
getCalculateFieldValue
in class JDBCResourceKind
value
- value of the fieldrequest
- the input SDataRequestresultSet
- resultSet returned by queryfieldIndex
- fieldIndex - 0-based
public boolean isUserSpecificResource()
isUserSpecificResource
in class JDBCResourceKind
protected boolean supportDelete()
supportDelete
in class JDBCResourceKind
protected boolean supportGet()
supportGet
in class JDBCResourceKind
protected boolean supportPost()
supportPost
in class JDBCResourceKind
protected boolean supportPut()
supportPut
in class JDBCResourceKind
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |