Expresso 5-6

com.jcorporate.expresso.ext.xml.dbobj
Class ControllerXSLMap

java.lang.Object
  extended bycom.jcorporate.expresso.core.dataobjects.BaseDataObject
      extended bycom.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
          extended bycom.jcorporate.expresso.core.dbobj.DBObject
              extended bycom.jcorporate.expresso.core.dbobj.SecuredDBObject
                  extended bycom.jcorporate.expresso.ext.xml.dbobj.ControllerXSLMap
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, LookupInterface, Securable, Serializable

public class ControllerXSLMap
extends SecuredDBObject

Entries here define the mapping between a specific user and browser type and Controller combination to the correct XSL stlyesheet to be used to transform the outputs of this controller. This allows different users (by group) to see different representations of a Controller's output, allowing for personalization, and different browsers to get different XSL transformations as well. As a single combination of user/browser/controller might match more than one stylesheet potentially, there is a "sequence" in these combinations. The stylesheet with the lowest sequence that matches all of the other criteria is selected.

Author:
Michael Nash
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.jcorporate.expresso.core.dbobj.DBObject
DBObject.FieldError, DBObject.FieldUpdate
 
Field Summary
protected static org.apache.oro.text.regex.PatternCompiler compiler
          Used for regular expression compilation
protected static org.apache.oro.text.regex.PatternMatcher matcher
          Used to match compiled patterns against strings
protected static Map regExpCache
          Used to hold compiled regular expressions in an attempt to speed up pattern matching.
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
ADD, ALL_FUNCTIONS, CACHE_NAME, CACHE_TTY, DELETE, SEARCH, SYSTEM_ACCOUNT, SYSTEM_ACCOUNT_NAME, UPDATE
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.DBObject
ATTRIBUTE_ERROR, ATTRIBUTE_ERROR_MESSAGE, ATTRIBUTE_PAGE_LIMIT, BIG_DECIMAL_ZERO, EMAIL_MASK, EVENT_ADD, EVENT_DELETE, EVENT_UPDATE, FLOAT_MASK, INT_MASK, IS_CHECK_RELATIONAL_INTEGRITY, UPDATE_CHANGED_ONLY, WHERE_KEYWORD
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
anyFieldsDistinct, anyFieldsToRetrieve, appendCustomWhere, caseSensitiveQuery, customWhereClause, dbKey, distinctFields, localConnection, LONGBINARY_READ_DEFAULT_SIZE, maxRecords, myClassName, myUpdates, offsetRecord, recordSet, retrieveFields, sMetadataMap, sortKeys
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
currentStatus, globalMask
 
Fields inherited from interface com.jcorporate.expresso.core.dataobjects.DataObject
STATUS_CURRENT, STATUS_DELETED, STATUS_NEW, STATUS_UPDATED
 
Constructor Summary
ControllerXSLMap()
          Constructor
ControllerXSLMap(int uid)
          Normal DBObject Constructor
 
Method Summary
 boolean getMatch(String userName, String controllerClassParam, int userAgentId)
          wlo: This is a copy of getMatch(String, String, String).
 boolean getMatch(String userName, String controllerClassName, String userAgentString)
          Figure out which XSL map entry should match, given a username, trx class name and User-Agent string & set this db object to the appropriate object.
 DBObject getThisDBObj()
          Standard method to return a new CacheSync object
 Vector getValidValues(String fieldName)
          Override the method getValues to provide specific values for our multi-valued fields
 void setupFields()
          Define the table and fields for this object
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
add, canRequesterAdd, canRequesterDelete, canRequesterRead, canRequesterUpdate, checkAllowed, copyAttributes, count, createSecurityCache, delete, deleteAll, find, getRequestingUid, getString, getString, getString, getString, getString, getString, getSystemUid, instantiate, isAllowed, retrieve, search, searchAndRetrieveList, searchAndRetrieveList, setRequestingUid, update
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.DBObject
addDetail, addField, addField, addFieldError, addFoundKeys, addIfNeeded, addIndex, addKey, addOrUpdate, addSortKey, addTransition, addVirtualField, addVirtualField, addVirtualField, addVirtualField, average, basicAdd, cacheIsChangedComparison, checkAllReferredToBy, checkAllRefs, checkAllRefsPublic, checkDeleteDetailPerm, checkField, checkRef, checkRef, clear, clearDistinctFields, clearError, clearFieldsToRetrieve, clearSortKeys, containsWildCards, delete, deleteAll, deleteDetails, denotesRange, equals, forKey, formatDateTime, get, getAllAttributes, getAttribute, getAttributesIterator, getBooleanFieldValue, getCacheSize, getCacheStatsMap, getCacheUtil, getCheckZeroUpdate, getCustomWhereClause, getDataContext, getDataField, getDataTransferObject, getDBName, getDetails, getDistinctFieldCount, getDistinctFields, getField, getFieldBigDecimal, getFieldBoolean, getFieldByte, getFieldByteArray, getFieldData, getFieldDate, getFieldDecimalFormatted, getFieldDouble, getFieldErrorMessage, getFieldFloat, getFieldInt, getFieldLong, getFieldMetaData, getFieldShort, getFieldsToRetrieveCount, getFilterClass, getFoundCount, getFoundKeysArray, getIndexArray, getISOValuesDefault, getISOValuesDefault, getISOValuesDefault, getKey, getKeyFieldListIterator, getLength, getLengthInt, getLocalConnection, getLocale, getLogger, getLookupObject, getMax, getMax, getMaxRecords, getMyKeys, getMyUpdatesArray, getOffsetRecord, getPatternMatcher, getPrecision, getSerializedForm, getStringFilter, getThisDBbj, getValidValueDescrip, getValidValuesList, getValues, getValuesDefault, getValuesDefault, getValuesDefault, hasError, hasErrors, haveAllKeys, initialize, isCached, isChanged, isDistinct, isEmpty, isFieldDistinct, isFieldNull, isFieldsToRetrieve, isFieldToRetrieve, isMultiValued, isReadOnly, isSecret, isVirtual, loadFromConnection, logChange, max, min, newInstance, noNewLine, noQuotes, notifyListeners, populateDefaultValues, referredToBy, removeAttribute, removeFromCache, retrieveFromCache, saveBinaryField, search, set, setAttribute, setCacheSize, setCharset, setCheckZeroUpdate, setConnection, setConnection, setCustomWhereClause, setCustomWhereClause, setDataContext, setDataField, setDataTransferObject, setDefaultValue, setDescription, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setFieldData, setFieldData, setFieldDistinct, setFieldsToRetrieve, setFilterClass, setFilterClass, setKeys, setLocale, setLookupField, setLookupObject, setMask, setMaxRecords, setMultiValued, setName, setOffsetRecord, setReadOnly, setSchema, setSecret, setSortKey, setStringFilter, setStringFiltersOnAll, setTargetDbSchema, setTargetTable, sqlAggrFunction, sum, toDebugString, update, updateAll, updateAll, verify
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
addInParam, addOutParam, buildWhereClause, buildWhereClauseBuffer, checkZeroUpdate, constructNewMetaData, createAndExecuteSearch, createAndRunStoreProcedure, getConnectionPool, getCustomStringFieldValue, getDef, getDistinctFieldArrayList, getExecutor, getFieldsToRetrieveIterator, getJDBCMetaData, getJDBCUtil, getMappedDataContext, getMetaData, getQueryInterface, getSerialForm, loadFromConnection, makeLimitationStub, quoteIfNeeded, runStoredProcedure, runStoredProcedureAndRetrieveList, selectFieldString, setCaseSensitiveQuery, setDBConnectionPool, setDBName, setMappedDataContext, setOriginalDBName, setTargetStoreProcedure
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
getGlobalMask, getStatus, isGlobalMasked, setFieldsWithDefaults, setGlobalMask, setStatus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

regExpCache

protected static Map regExpCache
Used to hold compiled regular expressions in an attempt to speed up pattern matching.


compiler

protected static org.apache.oro.text.regex.PatternCompiler compiler
Used for regular expression compilation


matcher

protected static org.apache.oro.text.regex.PatternMatcher matcher
Used to match compiled patterns against strings

Constructor Detail

ControllerXSLMap

public ControllerXSLMap()
                 throws DBException
Constructor


ControllerXSLMap

public ControllerXSLMap(int uid)
                 throws DBException
Normal DBObject Constructor

Parameters:
uid - The user id of the person to have the permissions of this DBOBject
Method Detail

getMatch

public boolean getMatch(String userName,
                        String controllerClassParam,
                        int userAgentId)
                 throws DBException
wlo: This is a copy of getMatch(String, String, String). I changed the parameter for the UserAgent from 'String userAgentString' to 'int userAgentId' because this is what actually is passed by the XMLViewHandler (see changes there).

Figure out which XSL map entry should match, given a username, trx class name and User-Agent string & set this db object to the appropriate object.

Parameters:
userName - the username of the currently logged in user.
controllerClassParam - the Controller classname to match against
userAgentId - the id of the User Agent as for the User Agent table
Returns:
true if we have found a match.
Throws:
DBException - if there's an error communicating with the underlying table

getMatch

public boolean getMatch(String userName,
                        String controllerClassName,
                        String userAgentString)
                 throws DBException
Figure out which XSL map entry should match, given a username, trx class name and User-Agent string & set this db object to the appropriate object.

Parameters:
userName - the name of the user logged in
controllerClassName - the classname of the controller to check against.
userAgentString - the useragent string to check against.
Returns:
true if we have found a match
Throws:
DBException - if there's an error communicating with the underlying database

getThisDBObj

public DBObject getThisDBObj()
                      throws DBException
Standard method to return a new CacheSync object

Overrides:
getThisDBObj in class DBObject
Returns:
DBObject A new CacheSync object
Throws:
DBException - If the new object cannot be created
See Also:
DBObject.getThisDBObj()

getValidValues

public Vector getValidValues(String fieldName)
                      throws DBException
Override the method getValues to provide specific values for our multi-valued fields

Overrides:
getValidValues in class DBObject
Parameters:
fieldName - Fielname to retrieve values for
Returns:
Vector of ValidValue Value/description pairs for this field
Throws:
DBException - If the values cannot be retrieved

setupFields

public void setupFields()
                 throws DBException
Define the table and fields for this object

Overrides:
setupFields in class DBObject
Throws:
DBException - If the fields cannot be set up

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.