|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.orion.sdata.servlet.JDBCResourceKind
public abstract class JDBCResourceKind
An abstract class that handles generic functionalities in favor of it's implementors. It handles the JDBC resource requests ,to avoid SQL injection attacks it uses bind variables in the Java's PreparedStatement
Nested Class Summary | |
---|---|
static class |
JDBCResourceKind.HTTPMethodsAuthorizator
The HTTPMethodsAuthorizator is used to check whether the ResourceKind supports the specific HTTP method. |
static class |
JDBCResourceKind.ResourceAuthorizator
The ResourceAuthorizator is used to check whether the user has the privilege to manipulate the ResourceKind. |
static class |
JDBCResourceKind.ResourceDataAuthorizator
The ResourceDataAuthorizator is used to check whether the user has the privilege to manipulate the specific data of the ResourceKind specified in the request. |
Field Summary | |
---|---|
protected static java.lang.String |
ADD
|
protected static java.lang.String |
ALTER_TABLE
|
protected static java.lang.String |
AND
|
protected static java.lang.String |
CLOSE_BRACE
|
protected static java.lang.String |
COMMA
|
protected static java.lang.String |
CONSTRAINT
|
protected static java.lang.String |
DEFAULT
|
static java.lang.String |
DEFAULT_LANGUAGE_CODE
|
protected static java.lang.String |
DELETE_FROM
|
protected static java.lang.String |
DROP
|
protected static java.lang.String |
DROP_TABLE
|
protected static java.lang.String |
FROM
|
protected static java.lang.String |
NOT_NULL
|
protected static java.lang.String |
OPEN_BRACE
|
protected static java.lang.String |
PRIMARY_KEY
|
protected static java.lang.String |
SELECT
|
protected static java.lang.String |
UICONTENT_SQL_SELECT_STMT
|
protected static java.lang.String |
VARCHAR_50
|
protected static java.lang.String |
WHERE
|
Constructor Summary | |
---|---|
JDBCResourceKind(ApplicationContext applicationContext,
IConnectionPool connectionPool,
java.lang.String authToken)
Constructor |
Method Summary | |
---|---|
protected void |
addCompanyIDField(java.lang.String defaultCompanyID,
java.sql.Connection connection)
Takes the set of records of the default company and creates a new sets for each company registered in Accpac |
protected void |
addRecordsForAllCompanies(java.lang.String defaultCompanyID,
java.sql.Connection connection)
Takes the set of records of the default company and creates a new sets for each company registered in Accpac |
protected java.lang.String |
buildUserFilter(java.lang.String exsitingFilter)
Returns a that contains the existing filter plus a filter by user ID if that the resource is user-specific and the user is a non-ADMIN user, or just the existing filter for all other cases. |
boolean |
canDelete(UserInfo user,
java.sql.Connection connection)
Indicates whether the user has the privilege to do DELETE against the ResourceKind. |
protected boolean |
canDeleteOnData(SDataRequest request,
java.sql.Connection connection)
Indicates whether the user has the privilege to DELETE the data specified in the request. |
boolean |
canGet(UserInfo user,
java.sql.Connection connection)
Indicates whether the user has the privilege to do GET against the ResourceKind. |
protected boolean |
canGetOnData(SDataRequest request,
java.sql.Connection connection)
Indicates whether the user has the privilege to GET the data specified in the request. |
boolean |
canPost(UserInfo user,
java.sql.Connection connection)
Indicates whether the user has the privilege to do POST against the ResourceKind. |
protected boolean |
canPostOnData(SDataRequest request,
java.sql.Connection connection)
Indicates whether the user has the privilege to POST the data specified in the request. |
boolean |
canPut(UserInfo user,
java.sql.Connection connection)
Indicates whether the user has the privilege to do PUT against the ResourceKind. |
protected boolean |
canPutOnData(SDataRequest request,
java.sql.Connection connection)
Indicates whether the user has the privilege to PUT the data specified in the request. |
protected java.sql.PreparedStatement |
createPreparedEntryGetStatement(java.sql.Connection connection,
ResourceElement finalResourceElement)
Form the prepared statement so that we can use it for entry request handling with or without navigation |
protected ResourceResponse |
doDelete(SDataRequest request,
java.sql.Connection connection)
Handles the Delete operation |
protected ResourceResponse |
doGet(SDataRequest request,
java.sql.Connection connection)
This method takes appropriate action and generates ResourceResponse based on the specified request |
protected ResourceResponse |
doPost(SDataRequest request,
java.sql.Connection connection)
Handles the POST request, which is for inserting records. |
protected ResourceResponse |
doPut(SDataRequest request,
java.sql.Connection connection)
Handles the PUT request, which is for updating records. |
protected SchemaResponse |
doSchema(SDataRequest request,
java.sql.Connection connection)
Handles the GET request for the special $schema operator. |
protected ResourceResponse |
doTemplate(SDataRequest request,
java.sql.Connection connection)
Handles the GET request for the special $template operator. |
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 |
protected java.lang.String |
findUIContentTextValueInDB(java.lang.String textId,
java.lang.String language)
Looks in the UI content table for (and returns if found) the associated text value based on the specified text ID and language and using the specified opened prepared statement, falling back to the default language if such a value was not found in the original language to search for, and returning "" if no such value was found even after fallback. |
protected void |
focusOnResultSet(ResourceElement resourceElement,
java.sql.ResultSet resultSet)
This routine focus the result set to the particular tuple specified by the key in the URL(predicateKay,Navigation) |
protected void |
freeConnection(java.sql.Connection connection)
Free the connection in connection pool. |
protected abstract java.util.List<FieldDefinition> |
getAllFields()
returns a list of FieldDefinitions in the ResourceKind |
protected ApplicationContext |
getApplicationContext()
Gets the ApplicationContext . |
protected java.lang.String |
getAuthToken()
Gets the JDBCResource kinds authentication token. |
protected abstract 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.util.Map<java.lang.String,java.lang.String> |
getCaseInsensitiveColumns()
Gets the map that contains column names in lower case as key and column names in correct case as value |
protected java.lang.String |
getColumnNamesFromList(java.util.ArrayList<java.lang.String> columnList)
This method takes an array of column names and appends them in to one string with commas separating the names. |
protected java.lang.String |
getCompanyIDField()
Gets the company id field name in the table/xml. |
protected java.lang.String |
getCompanyIDForFilter()
Gets the company id used in the filter for retrieving the data related to the current company. |
protected java.sql.Connection |
getConnection()
Gets a JDBC connection from the underlying connection pool associated with the resource kind. |
protected SDataRequest |
getCurrentRequest()
Gets the current request. |
UserInfo |
getCurrentUser()
Gets the current signed on user. |
protected java.lang.String |
getCustomizedQuery()
Get the customized SQL query if need to used instead of default query build by JDBCResourceKind |
protected JDBCDatabaseType |
getDatabaseType()
Gets the type of database that the resource kind's current connection is using. |
protected int |
getDefaultFeedCount()
Gets the default number of entries to be returned by the resource kind. |
protected 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 |
protected boolean |
getFieldSchemaIdentity(int index)
Get the identity from schema, returns an identity of the field from the resourceKind schema definition for the given index. |
protected java.lang.String |
getFieldSchemaName(int index)
Get the field name from schema, returns a name of the field from the resourceKind schema definition for the given index. |
protected FieldDataType |
getFieldSchemaType(int index)
Get the field type from schema, returns a type of the field from the resourceKind schema definition for the given index. |
protected java.util.ArrayList<java.lang.String> |
getIncludeColumns()
Get the columns of the JDBC table that needs to be included |
java.lang.String |
getInstance()
|
protected java.lang.String |
getKeyValueForKeyName(java.sql.ResultSet resultSet)
Gets the key field value for the primary key(composite keys) from the result set |
protected int |
getMaxFeedCount()
Gets the maximum number of entries to be returned by the resource kind. |
protected java.lang.String |
getOrderByClause(java.util.List<OrderByParameter> orderByParameters)
Gets a string of the form "SEG1 desc,SEG2,SEG3 desc" for the given orderByParameters |
protected java.lang.String |
getOrderByClauseForKeyField(boolean ascending)
Gets a string of the form "SEG1 desc,SEG2,SEG3 desc" for the primary key(composite key) |
protected java.sql.PreparedStatement |
getPreparedStatement(java.sql.Connection connection,
java.lang.String topRowCount,
java.lang.String columnNames,
java.lang.String filter,
java.lang.String orderBy,
BindVariables bindVariables,
int resultSetType,
int resultSetConcurrency)
Get a PreparedStatement for the SELECT query with the given criteria and set the filter bind variables of the value |
protected abstract java.lang.String[] |
getPrimaryKey()
Get the primary key of the underlying JDBC table for which one JDBCResourceKindImpl is created |
protected java.lang.String |
getQueryStringForParam(java.sql.Connection connection,
java.lang.String tableName,
java.lang.String topRowCount,
java.lang.String columnNames,
java.lang.String filter,
java.lang.String orderBy)
Get a query string that can be supplied to an RDBMS SQL query processing engine |
protected int |
getResourceKindFieldsCount()
returns a number of fields in the ResourceKind |
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 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 abstract java.lang.String |
getTableName()
Get the JDBC table name for which ResourceKindImpl is created |
protected SDataResponseEntry |
getTemplate(SDataRequest request,
java.sql.Connection connection)
Gets the SData response entry for a GET request for the special $template operator. |
protected java.lang.String |
getTransText(java.lang.String textId)
Returns translated value on the string. |
protected java.lang.String |
getUserIDField()
Gets the user id field name in the table/xml. |
protected java.lang.String |
getUserIDForFilter()
Gets the user id used in the filter for retrieving the data related to the current signed on user. |
ResourceResponse |
handleRequest(SDataRequest request,
AsyncStatusListener listener)
Handle the specified request, passing information to the listener if there is one. |
abstract boolean |
isUserSpecificResource()
Indicates whether the resource is user specific or not. |
protected void |
maintainTable(ApplicationContext context,
java.sql.Connection connection,
java.lang.String xmlFileName,
java.util.List<FieldDefinition> allTableFields,
java.lang.String defaultKeys,
java.lang.String defaultCompanyID)
maintain the database table used by this resource kind. |
protected boolean |
moveRecordPointerToKeyInURL(java.lang.String keyInURL,
java.sql.ResultSet resultSet)
|
boolean |
requiresCompanyIdInjection()
Override and return true if the companyId is required and is provided by server not clients. |
protected boolean |
requiresSignon()
Indicates whether the user needs to sign on in order to access the resource kind. |
boolean |
requiresUserIdInjection()
Override and return true if the userId is required and is provided by server not clients. |
void |
shutdown()
Shut down the resource kind. |
protected static java.lang.String[] |
splitKeyIntoSegments(java.lang.String key,
java.lang.String delimiter)
Split the key into array for the given delimiter |
static java.lang.String[] |
splitResourceSelectorKeyIntoSegments(java.lang.String key)
Form a string array say {'1','1','3'} from the input URL say (...(1;1;3)) |
protected abstract boolean |
supportDelete()
Indicates whether the ResourceKind in general supports DELETE or not. |
protected abstract boolean |
supportGet()
Indicates whether the ResourceKind in general supports GET or not. |
protected abstract boolean |
supportPost()
Indicates whether the ResourceKind in general supports POST or not. |
protected abstract 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 |
Methods inherited from interface com.sage.orion.sdata.servlet.ResourceKind |
---|
getName |
Field Detail |
---|
protected static final java.lang.String COMMA
protected static final java.lang.String DELETE_FROM
protected static final java.lang.String SELECT
protected static final java.lang.String FROM
protected static final java.lang.String WHERE
protected static final java.lang.String AND
protected static final java.lang.String ALTER_TABLE
protected static final java.lang.String ADD
protected static final java.lang.String PRIMARY_KEY
protected static final java.lang.String DROP
protected static final java.lang.String CONSTRAINT
protected static final java.lang.String OPEN_BRACE
protected static final java.lang.String CLOSE_BRACE
protected static final java.lang.String VARCHAR_50
protected static final java.lang.String DEFAULT
protected static final java.lang.String NOT_NULL
protected static final java.lang.String DROP_TABLE
public static final java.lang.String DEFAULT_LANGUAGE_CODE
protected static final java.lang.String UICONTENT_SQL_SELECT_STMT
Constructor Detail |
---|
public JDBCResourceKind(ApplicationContext applicationContext, IConnectionPool connectionPool, java.lang.String authToken)
applicationContext
- ApplicationContextconnectionPool
- ConnectionPool that is used to access the underlying DBauthToken
- the authentication token.Method Detail |
---|
public java.lang.String getInstance()
getInstance
in interface ResourceKind
public void shutdown()
ResourceKind.handleRequest(SDataRequest, AsyncStatusListener)
.
shutdown
in interface ResourceKind
protected abstract java.lang.String getTableName()
protected java.lang.String getFieldSchemaName(int index)
index
- name of the field
protected FieldDataType getFieldSchemaType(int index)
index
- index of the field
protected boolean getFieldSchemaIdentity(int index)
index
- identity of the field
protected int getResourceKindFieldsCount()
protected abstract java.util.List<FieldDefinition> getAllFields()
protected abstract java.lang.String[] getPrimaryKey()
protected abstract java.lang.String getCalculateFieldValue(java.lang.String value, SDataRequest request, java.sql.ResultSet resultSet, int fieldIndex)
value
- value of the fieldrequest
- the input SDataRequestresultSet
- resultSet returned by queryfieldIndex
- fieldIndex - 0-based
protected java.util.ArrayList<java.lang.String> getIncludeColumns()
protected java.lang.String getCustomizedQuery()
JDBCResourceKind
public ResourceResponse handleRequest(SDataRequest request, AsyncStatusListener listener)
Note that even if an implementation is not thread-safe it must allow for
the ResourceKind.shutdown()
call to execute in parallel.
handleRequest
in interface ResourceKind
request
- the request to handlelistener
- null or a listener than can be used for asynchronous tasks to
monitor progress.
ResourceResponse
to the requestprotected SchemaResponse doSchema(SDataRequest request, java.sql.Connection connection)
request
- The input SDataRequest for the GET of the special $schema
operator.connection
- The JDBC connection object which provides a gateway to access
underlying DB.
protected SDataSchema getSchema()
protected ResourceResponse doTemplate(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
request
- The input SDataRequest for the GET of the special $template
operator.connection
- The JDBC connection object which provides a gateway to access
underlying DB.
java.sql.SQLException
- SQLExceptionprotected SDataResponseEntry getTemplate(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
Gets the SData response entry for a GET request for the special $template operator.
The default implementation returns an entry whose payload contains a resource entity that has none of its properties (fields) set and does not contain a key (as the default implementation assumes that the key is not set until the insertion happens).
request
- the input SDataRequest for the GET of the special $template
operator.connection
- The JDBC connection object which provides a gateway to access
underlying DB.
java.sql.SQLException
- SQLExceptionprotected ResourceResponse doGet(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
request
- the SDataRequestconnection
- the JDBC connection object which provides a gateway to access
underlying DB
java.sql.SQLException
- SQLExceptionprotected ResourceResponse doPost(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
request
- the request Object having the entry object for the JDBC
ResourceKind Post requestconnection
- the JDBC connection object which provides a gateway to access
underlying DB
java.sql.SQLException
- SQLExceptionprotected ResourceResponse doPut(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
request
- the request Object having the entry object for the JDBC
ResourceKind Put requestconnection
- the JDBC connection object which provides a gateway to access
underlying DB
java.sql.SQLException
- SQLExceptionprotected ResourceResponse doDelete(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
request
- the request having the key for the record identityconnection
- 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).
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 java.sql.PreparedStatement createPreparedEntryGetStatement(java.sql.Connection connection, ResourceElement finalResourceElement) throws java.sql.SQLException
connection
- the JDBC connection objectfinalResourceElement
- the last resourceElement in the request URL
java.sql.SQLException
- SQLExceptionprotected void focusOnResultSet(ResourceElement resourceElement, java.sql.ResultSet resultSet) throws java.sql.SQLException
resourceElement
- the last resource elementresultSet
- the result set on which the operation is to be performed
java.sql.SQLException
- SQLExceptionprotected SDataResourceElement fillResultSetResourceElement(java.util.List<java.lang.String> selectCriteria, java.sql.ResultSet resultSet, SDataRequest request) throws java.sql.SQLException
selectCriteria
- the list of columns to be includedresultSet
- the Java's result set which exposes tuples' datarequest
- SDataRequest request
java.sql.SQLException
- SQLExceptionprotected SDataResourceElement getFieldData(SDataRequest request, java.sql.ResultSet resultSet, int fieldIndex) throws java.sql.SQLException
request
- SDataRequest requestresultSet
- the result set from which the specified field data is retrievedfieldIndex
- the index of the field
java.sql.SQLException
- SQLExceptionprotected java.lang.String buildUserFilter(java.lang.String exsitingFilter)
exsitingFilter
- The existing filter on which to add a filter by user ID for
non-ADMIN users of user-specific resources.
protected java.lang.String getUserIDForFilter()
protected java.lang.String getCompanyIDForFilter()
protected java.sql.PreparedStatement getPreparedStatement(java.sql.Connection connection, java.lang.String topRowCount, java.lang.String columnNames, java.lang.String filter, java.lang.String orderBy, BindVariables bindVariables, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
connection
- The JDBC connection which provides a JDBC connectivitytopRowCount
- the number of rows to be returned from the underlying DBcolumnNames
- the column names to be included in the SQL statementfilter
- the selection criteria of the SQL statementorderBy
- the order by clause stringbindVariables
- the variables to be bound for the filter expressionresultSetType
- the type of the result set which determines the navigable
capability, sensitivity of changes of the result set returned by
preparedStament's executeQuery methodresultSetConcurrency
- the result set's concurrency whether it is read
only,updateable,etc
java.sql.SQLException
- SQLExceptionprotected java.lang.String getQueryStringForParam(java.sql.Connection connection, java.lang.String tableName, java.lang.String topRowCount, java.lang.String columnNames, java.lang.String filter, java.lang.String orderBy) throws java.sql.SQLException
connection
- The JDBC connection which provides a JDBC connectivitytableName
- the JDBC table nametopRowCount
- the maximum number of records to be returned for the criteriacolumnNames
- the table column to be included in the SQL statementfilter
- the criteria(WHERE clause string of SQL statement)orderBy
- the order by clause
java.sql.SQLException
- SQLExceptionprotected java.lang.String getColumnNamesFromList(java.util.ArrayList<java.lang.String> columnList)
columnList
- The list of columns that is to be projected
protected java.lang.String getOrderByClause(java.util.List<OrderByParameter> orderByParameters)
orderByParameters
- list of order by parameters
protected java.lang.String getOrderByClauseForKeyField(boolean ascending)
ascending
- the direction of order by columns
protected static java.lang.String[] splitKeyIntoSegments(java.lang.String key, java.lang.String delimiter)
key
- key stringdelimiter
- delimiting string
public static java.lang.String[] splitResourceSelectorKeyIntoSegments(java.lang.String key)
key
- the input key string in the URL
protected boolean moveRecordPointerToKeyInURL(java.lang.String keyInURL, java.sql.ResultSet resultSet) throws java.sql.SQLException
keyInURL
- keyInURL stringresultSet
- ResultSet
java.sql.SQLException
- SQLExceptionprotected java.lang.String getKeyValueForKeyName(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- the result set from which the keys value are extracted
java.sql.SQLException
- SQLExceptionprotected java.util.Map<java.lang.String,java.lang.String> getCaseInsensitiveColumns()
protected int getDefaultFeedCount()
protected int getMaxFeedCount()
protected JDBCDatabaseType getDatabaseType()
protected java.sql.Connection getConnection()
Gets a JDBC connection from the underlying connection pool associated with the resource kind.
NOTE: The caller (most likely a subclass) is responsible for freeing the
connection by calling freeConnection
.
protected void freeConnection(java.sql.Connection connection)
connection
- Current JDBC connectionprotected java.lang.String getAuthToken()
protected java.lang.String findUIContentTextValueInDB(java.lang.String textId, java.lang.String language)
Looks in the UI content table for (and returns if found) the associated text value based on the specified text ID and language and using the specified opened prepared statement, falling back to the default language if such a value was not found in the original language to search for, and returning "" if no such value was found even after fallback.
NOTE: This method never returns null, though it may return "" (including for the case where the text ID is null or empty).
NOTE: It's very important that any resource kind that calls this method must have already ensured that the UI content table and cache were created and populated (usually by having a call in that resource kind's constructor that calls the UI content resource kind's static "table" creation method)
textId
- The ID of the text that we want to search for - if this ID is
null or empty, "" will be returned (as a text ID is not
required).language
- The lower-cased language to start the search with - if the text
ID is not found in that language and it is not the default
langage ("eng"), we will fall back and try the search using the
default language.
protected java.lang.String getTransText(java.lang.String textId)
Returns translated value on the string.
NOTE: It's very important that any resource kind that calls this method must have already ensured that the UI content table and cache were created and populated (usually by having a call in that resource kind's constructor that calls the UI content resource kind's static "table" creation method)
textId
- transText string with all (but language)information for
retrieving the translated value from UIContent
protected abstract boolean supportGet()
protected abstract boolean supportPut()
protected abstract boolean supportPost()
protected abstract boolean supportDelete()
public boolean canGet(UserInfo user, java.sql.Connection connection)
user
- The signed on user.connection
- The database connection.
public boolean canPut(UserInfo user, java.sql.Connection connection)
user
- The signed on user.connection
- The database connection.
public boolean canPost(UserInfo user, java.sql.Connection connection)
user
- The signed on user.connection
- The database connection.
public boolean canDelete(UserInfo user, java.sql.Connection connection)
user
- The signed on user.connection
- The database connection.
protected boolean canGetOnData(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
request
- The GET request.connection
- The database connection.
java.sql.SQLException
- SQLExceptionprotected boolean canPutOnData(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
request
- The PUT request.connection
- The database connection.
java.sql.SQLException
- SQLExceptionprotected boolean canPostOnData(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
request
- The POST request.connection
- The database connection.
java.sql.SQLException
- SQLExceptionprotected boolean canDeleteOnData(SDataRequest request, java.sql.Connection connection) throws java.sql.SQLException
request
- The DELETE request.connection
- The database connection.
java.sql.SQLException
- SQLExceptionprotected java.lang.String getUserIDField()
protected java.lang.String getCompanyIDField()
public abstract boolean isUserSpecificResource()
protected boolean requiresSignon()
public UserInfo getCurrentUser()
public boolean requiresUserIdInjection()
public boolean requiresCompanyIdInjection()
protected SDataRequest getCurrentRequest()
protected ApplicationContext getApplicationContext()
ApplicationContext
.
ApplicationContext
.protected void maintainTable(ApplicationContext context, java.sql.Connection connection, java.lang.String xmlFileName, java.util.List<FieldDefinition> allTableFields, java.lang.String defaultKeys, java.lang.String defaultCompanyID)
context
- the application context in which we are workingconnection
- a connection we can usexmlFileName
- the (partial) name of the xml file that contains initialization
data.allTableFields
- all the table fieldsdefaultKeys
- the default keysdefaultCompanyID
- the default company ID to use if upgrading, or null if the table
should not have a company ID added during upgradeprotected void addCompanyIDField(java.lang.String defaultCompanyID, java.sql.Connection connection)
defaultCompanyID
- name of the default companyconnection
- a connection we can useprotected void addRecordsForAllCompanies(java.lang.String defaultCompanyID, java.sql.Connection connection)
defaultCompanyID
- name of the default companyconnection
- a connection we can use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |