com.sage.orion.sdata.servlet.swtservice
Class UIContentResourceKind

java.lang.Object
  extended by com.sage.orion.sdata.servlet.JDBCResourceKind
      extended by com.sage.orion.sdata.servlet.swtservice.UIContentResourceKind
All Implemented Interfaces:
ResourceKind

public class UIContentResourceKind
extends JDBCResourceKind

This class handles the UIContent 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
static java.lang.String DEFAULT_APPWIDE_CATEGORY
           
static java.lang.String RESOURCE_KIND_TABLE_NAME
           
 
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, FROM, NOT_NULL, OPEN_BRACE, PRIMARY_KEY, SELECT, UICONTENT_SQL_SELECT_STMT, VARCHAR_50, WHERE
 
Constructor Summary
UIContentResourceKind(ApplicationContext context, ConnectionPool connectionPool, java.lang.String authToken)
          Constructor
 
Method Summary
protected static void doCreateTable(ApplicationContext context, java.sql.Connection connection, JDBCDatabaseType databaseType)
          If table does not exist in the underlying database then create the table and populate it with data from UIContent xml files.
 void freeConnection(java.sql.Connection connection)
          Free the connection in connection pool.
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
 java.sql.Connection getConnection()
          Gets a JDBC connection from the underlying connection pool associated with the resource kind.
 SDataResourceElement getFieldData(SDataRequest request, java.sql.ResultSet resultSet, int fieldIndex)
          Get the specified field's data from the resultSet and packs the data in SDataResourceElement
 java.lang.String getKeyValueForKeyName(java.sql.ResultSet resultSet)
          returns the key value based on the primary key
protected  int getMaxFeedCount()
          Gets the maximum number of entries to be returned by the resource kind.
 java.lang.String getName()
           
 java.lang.String[] getPrimaryKey()
          Get the primary key of the underlying JDBC table for which one JDBCResourceKindImpl is created
 SDataSchema getSchema()
          Get the SDataSchema which has the functionality to convert the underlying JDBC table's meta data into text(xml) form so that it can be transmitted over wire
protected  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 requiresSignon()
          Indicates whether the user needs to sign on in order to access the resource kind.
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 com.sage.orion.sdata.servlet.JDBCResourceKind
addCompanyIDField, addRecordsForAllCompanies, buildUserFilter, canDelete, canDeleteOnData, canGet, canGetOnData, canPost, canPostOnData, canPut, canPutOnData, createPreparedEntryGetStatement, doDelete, doGet, doPost, doPut, doSchema, doTemplate, fillResultSetResourceElement, findUIContentTextValueInDB, focusOnResultSet, getApplicationContext, getAuthToken, getCaseInsensitiveColumns, getColumnNamesFromList, getCompanyIDField, getCompanyIDForFilter, getCurrentRequest, getCurrentUser, getCustomizedQuery, getDatabaseType, getDefaultFeedCount, getFieldSchemaIdentity, getFieldSchemaName, getFieldSchemaType, getIncludeColumns, getInstance, getOrderByClause, getOrderByClauseForKeyField, getPreparedStatement, getQueryStringForParam, getResourceKindFieldsCount, getResultRecordAndCreateResponse, getTemplate, getTransText, getUserIDField, getUserIDForFilter, handleRequest, maintainTable, moveRecordPointerToKeyInURL, requiresCompanyIdInjection, requiresUserIdInjection, shutdown, splitKeyIntoSegments, splitResourceSelectorKeyIntoSegments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sage.orion.sdata.servlet.ResourceKind
getInstance, handleRequest, shutdown
 

Field Detail

RESOURCE_KIND_TABLE_NAME

public static final java.lang.String RESOURCE_KIND_TABLE_NAME
See Also:
Constant Field Values

DEFAULT_APPWIDE_CATEGORY

public static final java.lang.String DEFAULT_APPWIDE_CATEGORY
See Also:
Constant Field Values
Constructor Detail

UIContentResourceKind

public UIContentResourceKind(ApplicationContext context,
                             ConnectionPool connectionPool,
                             java.lang.String authToken)
Constructor

Parameters:
context - SData application context
connectionPool - connectionPool of the underline DB
authToken - the authentication token
Method Detail

doCreateTable

protected static void doCreateTable(ApplicationContext context,
                                    java.sql.Connection connection,
                                    JDBCDatabaseType databaseType)
If table does not exist in the underlying database then create the table and populate it with data from UIContent xml files. If table exists then perform the table updates if required.

Parameters:
context - SData application context
connection - The database connection.
databaseType - JDBC database type

getPrimaryKey

public java.lang.String[] getPrimaryKey()
Description copied from class: JDBCResourceKind
Get the primary key of the underlying JDBC table for which one JDBCResourceKindImpl is created

Specified by:
getPrimaryKey in class JDBCResourceKind
Returns:
the primary key

getTableName

protected java.lang.String getTableName()
Description copied from class: JDBCResourceKind
Get the JDBC table name for which ResourceKindImpl is created

Specified by:
getTableName in class JDBCResourceKind
Returns:
the JDBC table name

getName

public java.lang.String getName()
Specified by:
getName in interface ResourceKind

getAllFields

protected java.util.List<FieldDefinition> getAllFields()
returns a list of FieldDefinitions in the ResourceKind

Specified by:
getAllFields in class JDBCResourceKind
Returns:
FieldDefinition list

getCalculateFieldValue

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

Specified by:
getCalculateFieldValue in class JDBCResourceKind
Parameters:
value - value of the field
request - the input SDataRequest
resultSet - resultSet returned by query
fieldIndex - fieldIndex - 0-based
Returns:
the value of the field

getMaxFeedCount

protected int getMaxFeedCount()
Gets the maximum number of entries to be returned by the resource kind.

Overrides:
getMaxFeedCount in class JDBCResourceKind
Returns:
the maximum feed size

isUserSpecificResource

public boolean isUserSpecificResource()
Indicates whether the resource is user specific or not. If the resource is user specific, it generally requires user sign on.

Specified by:
isUserSpecificResource in class JDBCResourceKind
Returns:
True if the resource is user specific, false otherwise.

requiresSignon

protected boolean requiresSignon()
Indicates whether the user needs to sign on in order to access the resource kind.

Overrides:
requiresSignon in class JDBCResourceKind
Returns:
True if the user needs to sign on in order to access the resource kind, false otherwise.

supportDelete

protected boolean supportDelete()
Indicates whether the ResourceKind in general supports DELETE or not.

Specified by:
supportDelete in class JDBCResourceKind
Returns:
True if the ResourceKind supports DELETE, false otherwise.

supportGet

protected boolean supportGet()
Indicates whether the ResourceKind in general supports GET or not.

Specified by:
supportGet in class JDBCResourceKind
Returns:
True if the ResourceKind supports GET, false otherwise.

supportPost

protected boolean supportPost()
Indicates whether the ResourceKind in general supports POST or not.

Specified by:
supportPost in class JDBCResourceKind
Returns:
True if the ResourceKind supports POST, false otherwise.

supportPut

protected boolean supportPut()
Indicates whether the ResourceKind in general supports PUT or not.

Specified by:
supportPut in class JDBCResourceKind
Returns:
True if the ResourceKind supports PUT, false otherwise.

getFieldData

public SDataResourceElement getFieldData(SDataRequest request,
                                         java.sql.ResultSet resultSet,
                                         int fieldIndex)
                                  throws java.sql.SQLException
Description copied from class: JDBCResourceKind
Get the specified field's data from the resultSet and packs the data in SDataResourceElement

Overrides:
getFieldData in class JDBCResourceKind
Parameters:
request - SDataRequest request
resultSet - the result set from which the specified field data is retrieved
fieldIndex - the index of the field
Returns:
An SDataResourceElement for the specified field index
Throws:
java.sql.SQLException - SQLException

getSchema

public SDataSchema getSchema()
Get the SDataSchema which has the functionality to convert the underlying JDBC table's meta data into text(xml) form so that it can be transmitted over wire

Overrides:
getSchema in class JDBCResourceKind
Returns:
A SDataSchema object

getConnection

public java.sql.Connection getConnection()
Gets a JDBC connection from the underlying connection pool associated with the resource kind.

Overrides:
getConnection in class JDBCResourceKind
Returns:
A JDBC Connection object which is got from available connection pool, and which the caller is responsible for freeing.

freeConnection

public void freeConnection(java.sql.Connection connection)
Free the connection in connection pool.

Overrides:
freeConnection in class JDBCResourceKind
Parameters:
connection - Current JDBC connection

getKeyValueForKeyName

public java.lang.String getKeyValueForKeyName(java.sql.ResultSet resultSet)
                                       throws java.sql.SQLException
returns the key value based on the primary key

Overrides:
getKeyValueForKeyName in class JDBCResourceKind
Parameters:
resultSet - ResultSet
Returns:
the key values string delimited by the specified segment separator
Throws:
java.sql.SQLException - SQLException


Copyright © 2011 Sage Software, Inc. All rights reserved.