|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<java.lang.String,DataSource>
com.taggercat.model.Model
public class Model
Model encapsulates the Hibernate model objects, and contains the collection of data source instances associated with the current user's session. Since it implements the HttpSessionBindingListener interface, it will be notified when the bound HttpSession expires or is invalidated. The model object needs to be fully serializable so that it can be restored from a persisted state.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
Model()
A public empty constructor for using the model as a JavaBean. |
|
Model(LoginInfo loginInfo)
Creates a model instance for the current user. |
|
| Method Summary | |
|---|---|
static void |
addApplicationScopeDataSource(DataSource dataSource)
Adds a application scope data source |
void |
addDataSource(DataSource dataSource)
Adds a DataSource to the Model. |
void |
addFormatter(java.lang.String dsn,
java.lang.String propertyName,
java.text.Format formatter)
Adds a Formatter to the Model for the specified DSN and field name. |
static void |
addPropertyErrorMessage(javax.servlet.http.HttpServletRequest request,
java.lang.String dsn,
java.lang.String rowId,
java.lang.String propertyName,
java.lang.String errorMessage)
Adds an error messages specific to a property to the List attribute on the request object. |
void |
addRepeatingRegionSize(java.lang.String pageName,
java.lang.String dsn,
java.lang.Integer regionSize)
Adds a RepeatingRegion size for the named page, and data source name. |
void |
clearQBFSearchValues(java.lang.String dataSourceName,
boolean executeQuery)
Clears QBF search values on the named DataSource instance(s). |
void |
closeRequestScopeDatasources()
Close all requestScope data sources. |
void |
delete(java.lang.String dataSourceName)
Deletes the current tcEntity from the named DataSource
instance. |
void |
deleteSelected(java.lang.String dataSourceName)
Deletes selected rows from the named DataSource
instance. |
void |
disconnect()
A clean up method that is called when the user's session is closed. |
void |
executeQuery(java.lang.String dataSourceName)
Re-executes the data source's query. |
DataSource |
get(java.lang.Object dataSourceName)
|
static java.util.List<java.lang.String> |
getAdminRoles()
|
AuditInterceptor |
getAuditInterceptor()
|
static org.hibernate.Session |
getCurrentHibernateSession()
Returns the current Hibernate session, not the HTTPSession. |
javax.servlet.http.HttpServletRequest |
getCurrentRequest()
Gets the current request being processed by the controller. |
DataSource |
getDataSource(java.lang.String dataSourceName)
Returns the named DataSource instance, and additionally
executes the data source's query if the data source mode is "deferred" and it
has not been executed. |
DataSource |
getDataSource(java.lang.String dataSourceName,
boolean executeDeferred)
Returns the named DataSource instance and
optionally executes the data source's query if the data source
mode is "deferred" and it has not been executed. |
DataSource |
getDataSourceByEntityName(java.lang.String entityName)
Gets the datasource for the named entity. |
static java.lang.String |
getDataSourceName(java.lang.String parameter)
Gets the data source name from a parameter, where DataSource name is assumed to be the first token in the parameter, delimited by the '.' |
java.lang.Integer |
getEntityPermissions(java.lang.String entityName,
java.lang.String groupIds)
Returns a bit mask of the permissions that the user has for the named entity |
static Environment |
getEnvironment()
Gets this applications environment object. |
java.lang.Object |
getFieldValue(java.lang.String dsn,
java.lang.String propertyName)
Gets the value of the named field from the current tcEntity in the data source. |
java.text.Format |
getFormatter(java.lang.String dsn,
java.lang.String propertyName)
Returns the Formatter used to display ( and parse ) the specified property. |
java.util.Locale |
getLocale()
Returns this user's locale |
java.lang.String |
getLoggingUserName()
Gets the current user's name for logging, it is prefixed with "[user]=". |
LoginInfo |
getLoginInfo()
|
com.taggercat.metadata.MetaDataReader |
getMetaData()
|
com.taggercat.metadata.MetaProperty |
getMetaProperty(java.lang.String dsn,
java.lang.String propertyName)
|
static java.lang.String |
getMultiValueParameter(javax.servlet.http.HttpServletRequest request,
java.lang.String paramName)
|
PermissionReader |
getPermissionReader()
|
java.lang.Integer |
getPropertyPermissions(java.lang.String dsn,
java.lang.String propertyName,
java.lang.String groupIds)
Returns a bitmask of the users permissions for the specified fieldName on the ds |
int |
getRepeatingRegionSize(java.lang.String pageName,
java.lang.String dsn)
Gets a RepeatingRegion size. |
org.hibernate.SessionFactory |
getSessionFactory()
|
static int |
getUserCount()
|
java.lang.Long |
getUserId()
Gets the current user's ID. |
java.lang.String |
getUserName()
Gets the current user's name. |
boolean |
hasDataSourcePermission(java.lang.String dsn,
int permissionType)
Returns true if the user has the specified permission on this ds. |
boolean |
hasPagePermission(java.lang.String responsePage)
Return true if the user has the entity permission for the corresponding default search or edit page name. |
boolean |
hasPropertyPermission(java.lang.String dsn,
java.lang.String propertyName,
int permissionType)
Returns true if the user has the specified permission for the dsn and field name |
void |
insert(java.lang.String dataSourceName)
Inserts a tcEntity into the the named DataSource instance. |
boolean |
isUserInRole(java.util.List<java.lang.String> roleNames)
|
boolean |
isUserInRole(java.lang.String roleName)
|
void |
listDatasources()
A convenience method to list all active data sources to the logger as INFO level messages. |
void |
reloadCurrentEntity(java.lang.String dataSourceName)
|
void |
removeDataSource(java.lang.String dataSourceName)
Closes and removes the named DataSource. |
void |
removeDataSources(java.util.List<java.lang.String> closeNamesList,
java.util.List<java.lang.String> exceptNamesList,
boolean resultSetOnly)
Closes and removes the named DataSource. |
void |
save(java.lang.String dataSourceName)
Saves pending changes in the named DataSource instance. |
void |
saveAll()
Saves pending changes in all DataSource instances. |
static void |
setAdminRoles(java.util.List<java.lang.String> adminRoles)
|
void |
setDataSourcePosition(java.lang.String dataSourceName,
java.lang.String position,
int size)
Sets the current tcEntity in the named DataSource's resultset to the
named position argument. |
boolean |
setDatasourceValues(javax.servlet.http.HttpServletRequest request)
Updates data values for each data source referenced in request. |
void |
setLocale(java.util.Locale locale)
|
void |
setLoginInfo(LoginInfo loginInfo)
|
void |
sortDataSource(java.lang.String dataSourceName,
java.lang.String propertyName)
Re-executes the data source's query to display it in a sorted order. |
java.util.Date |
toDate(java.lang.String dateStr,
java.lang.String dsn,
java.lang.String propertyName)
Parses a date string using the Display formatter for the specified field. |
java.util.Date |
toDateTime(java.lang.String dateStr,
java.lang.String dsn,
java.lang.String propertyName)
Parses a date string using the Display formatter for the specified propertyName. |
java.lang.Number |
toNumber(java.lang.String numberStr,
java.lang.String dsn,
java.lang.String propertyName)
Parses a number string using the Display formatter for the specified field. |
void |
undo(java.lang.String dataSourceName)
Undoing pending changes in the named DataSource instance. |
void |
undoAll()
Undoes any pending changes in all DataSource instances. |
boolean |
updateQBFData(javax.servlet.http.HttpServletRequest request)
Updates QBF where clause(s) on DataSource instance(s). |
boolean |
updateSelectedRowIds(javax.servlet.http.HttpServletRequest request)
Updates selected tcEntity IDs for each data source referenced in request. |
void |
updateUserSettings(javax.servlet.http.HttpServletRequest request)
Sets any user settings; where a parameter name prefix of tcUserSetting. |
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent event)
Notification that this Model is being bound to the HttpSession. |
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
Notification that this Model is being unbound from the HttpSession. |
| Methods inherited from class java.util.concurrent.ConcurrentHashMap |
|---|
clear, contains, containsKey, containsValue, elements, entrySet, isEmpty, keys, keySet, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public Model()
public Model(LoginInfo loginInfo)
loginInfo - loginInfo| Method Detail |
|---|
public void addDataSource(DataSource dataSource)
DataSource to the Model. If there is an existing
DataSource of the same name already present in the
Model, the existing DataSource is closed and removed
before the new DataSource is added.
If the DataSource is an Application scope data source,
then it is added to the application scope, and not the user's model object.
dataSource - DataSource instance to be addedpublic static void addApplicationScopeDataSource(DataSource dataSource)
dataSource - the data source
public static void addPropertyErrorMessage(javax.servlet.http.HttpServletRequest request,
java.lang.String dsn,
java.lang.String rowId,
java.lang.String propertyName,
java.lang.String errorMessage)
request - the request object to add the field name todsn - the data source namepropertyName - the field nameerrorMessage - the errorMessageDataFieldCaptionTag
public void addFormatter(java.lang.String dsn,
java.lang.String propertyName,
java.text.Format formatter)
dsn - the name of the ds the formatter applies topropertyName - the field name the formatter applies toformatter - the formatter
public void addRepeatingRegionSize(java.lang.String pageName,
java.lang.String dsn,
java.lang.Integer regionSize)
pageName - the page name where the repeating region occursdsn - the dsn for the repeating regionregionSize - the region size
public int getRepeatingRegionSize(java.lang.String pageName,
java.lang.String dsn)
pageName - the page name where the repeating region occursdsn - the dsn for the repeating region
public java.text.Format getFormatter(java.lang.String dsn,
java.lang.String propertyName)
dsn - the name of the data source the formatter applies topropertyName - the field name the formatter applies to
public void clearQBFSearchValues(java.lang.String dataSourceName,
boolean executeQuery)
throws java.lang.Exception
DataSource instance(s).
java.lang.ExceptiondataSourceName - Name of the DataSource to clear search fields on.executeQuery - If true, re-execute the datasource's query after the fields are cleared.public javax.servlet.http.HttpServletRequest getCurrentRequest()
public void closeRequestScopeDatasources()
public void listDatasources()
public void delete(java.lang.String dataSourceName)
throws java.lang.Exception
DataSource
instance.
java.lang.ExceptiondataSourceName - the name of the DataSource from which
to delete current tcEntity.
public void deleteSelected(java.lang.String dataSourceName)
throws java.lang.Exception
DataSource
instance.
java.lang.ExceptiondataSourceName - Name of the DataSource from which
to delete selected rows.public DataSource get(java.lang.Object dataSourceName)
get in interface java.util.Map<java.lang.String,DataSource>get in class java.util.concurrent.ConcurrentHashMap<java.lang.String,DataSource>
public DataSource getDataSource(java.lang.String dataSourceName)
throws java.lang.Exception
DataSource instance, and additionally
executes the data source's query if the data source mode is "deferred" and it
has not been executed.
java.lang.ExceptiondataSourceName - Name of the DataSource to be
returned.
DataSource instance, or null if not
found in Model.public DataSource getDataSourceByEntityName(java.lang.String entityName)
entityName -
public DataSource getDataSource(java.lang.String dataSourceName,
boolean executeDeferred)
throws java.lang.Exception
DataSource instance and
optionally executes the data source's query if the data source
mode is "deferred" and it has not been executed.
java.lang.Exception - ModelExceptiondataSourceName - Name of the DataSource to be
returned.executeDeferred - if true then the deferred query is executed if needed
DataSource instance, or null if not
found in Model.public static java.lang.String getDataSourceName(java.lang.String parameter)
parameter - the parameter from which to extract the data source name.
public org.hibernate.SessionFactory getSessionFactory()
public java.lang.String getUserName()
public java.lang.Long getUserId()
public java.lang.String getLoggingUserName()
public void insert(java.lang.String dataSourceName)
throws java.lang.Exception
DataSource instance.
java.lang.Exception - if the insert failsdataSourceName - Name of the DataSource into which
to insert.public void removeDataSource(java.lang.String dataSourceName)
DataSource.
The data source name can include wildcard characters to form a pattern.
The patterns roughly follows DOS wildcard patterns, where a ? matches any character,
and a * matches to the end of the string. The match is not case sensitive.
dataSourceName - Name of the instance to be removed.
public void removeDataSources(java.util.List<java.lang.String> closeNamesList,
java.util.List<java.lang.String> exceptNamesList,
boolean resultSetOnly)
DataSource.
The data source name can include wildcard characters to form a pattern.
The patterns roughly follows DOS wildcard patterns, where a ? matches any character,
and a * matches to the end of the string. The match is not case sensitive.
closeNamesList - Name of the instance to be removed.exceptNamesList - Name of the instance to NOT be removed.
public void save(java.lang.String dataSourceName)
throws java.lang.Exception
DataSource instance.
java.lang.ExceptiondataSourceName - Name of the DataSource to be
saved.
public void saveAll()
throws java.lang.Exception
DataSource instances.
This method starts a Hibernate Session and Transaction.
java.lang.Exception
public void sortDataSource(java.lang.String dataSourceName,
java.lang.String propertyName)
throws java.lang.Exception
java.lang.Exception - if the sort action (query) is raising an exceptiondataSourceName - the name of the DataSource to sortpropertyName - the field name to sort on
public void executeQuery(java.lang.String dataSourceName)
throws java.lang.Exception
java.lang.Exception - if the query throws an exceptiondataSourceName - the name of the DataSource to query
public void setDataSourcePosition(java.lang.String dataSourceName,
java.lang.String position,
int size)
throws java.lang.Exception
DataSource's resultset to the
named position argument.
java.lang.Exception - if the action faileddataSourceName - the name of the DataSource to scrollposition - the position to change tosize - the number of rows to scroll ( applies to goNext, or goPrevious )
public boolean updateSelectedRowIds(javax.servlet.http.HttpServletRequest request)
throws java.lang.Exception
java.lang.Exception - ModelExceptionrequest - the current HttpServletRequest instance
public void undoAll()
throws java.lang.Exception
DataSource instances.
java.lang.Exception - ModelException
public void undo(java.lang.String dataSourceName)
throws java.lang.Exception
DataSource instance.
java.lang.Exception - ModelExceptiondataSourceName - the data source name to apply the undo action to
public java.util.Date toDate(java.lang.String dateStr,
java.lang.String dsn,
java.lang.String propertyName)
dateStr - the date stringdsn - the data source name to parse forpropertyName - the field name to parse for
public java.util.Date toDateTime(java.lang.String dateStr,
java.lang.String dsn,
java.lang.String propertyName)
dateStr - the date stringdsn - the data source name to parse forpropertyName - the field name to parse for
public java.lang.Number toNumber(java.lang.String numberStr,
java.lang.String dsn,
java.lang.String propertyName)
numberStr - the number stringdsn - the data source name to parse forpropertyName - the field name to parse for
public boolean setDatasourceValues(javax.servlet.http.HttpServletRequest request)
throws java.lang.Exception
java.lang.Exceptionrequest - The current HttpServletRequest instance.
public static java.lang.String getMultiValueParameter(javax.servlet.http.HttpServletRequest request,
java.lang.String paramName)
public boolean updateQBFData(javax.servlet.http.HttpServletRequest request)
throws java.lang.Exception
DataSource instance(s).
java.lang.Exception - ModelExceptionrequest - HttpServletRequest instance.
public void updateUserSettings(javax.servlet.http.HttpServletRequest request)
tcUserSetting. n denotes a user setting.
request - the HttpServletRequestpublic void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
valueBound in interface javax.servlet.http.HttpSessionBindingListenerevent - HttpSessionBindingEvent instance.public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
valueUnbound in interface javax.servlet.http.HttpSessionBindingListenerevent - HttpSessionBindingEvent instance.
public java.lang.Object getFieldValue(java.lang.String dsn,
java.lang.String propertyName)
throws java.lang.IllegalArgumentException,
ModelException
java.lang.IllegalArgumentException
ModelExceptiondsn - the data source namepropertyName - the propertyName
public static Environment getEnvironment()
public AuditInterceptor getAuditInterceptor()
throws java.lang.Exception
java.lang.Exception
public void reloadCurrentEntity(java.lang.String dataSourceName)
throws java.lang.Exception
java.lang.Exceptionpublic static int getUserCount()
public boolean isUserInRole(java.util.List<java.lang.String> roleNames)
public boolean isUserInRole(java.lang.String roleName)
public com.taggercat.metadata.MetaDataReader getMetaData()
public void disconnect()
public boolean hasDataSourcePermission(java.lang.String dsn,
int permissionType)
throws java.lang.Exception
java.lang.Exceptiondsn - permissionType -
public java.lang.Integer getEntityPermissions(java.lang.String entityName,
java.lang.String groupIds)
throws java.lang.Exception
java.lang.ExceptionentityName - the entity namegroupIds - the comma separated list of group names this user is a member of
public java.lang.Integer getPropertyPermissions(java.lang.String dsn,
java.lang.String propertyName,
java.lang.String groupIds)
throws java.lang.Exception
java.lang.Exceptiondsn - the data source name, NOT the entity namepropertyName - the propertyNamegroupIds - to user's group IDs,
public boolean hasPropertyPermission(java.lang.String dsn,
java.lang.String propertyName,
int permissionType)
throws java.lang.Exception
java.lang.Exceptiondsn - the data source name, NOT the entity namepropertyName - the propertyNamepermissionType - the permission type to check
public boolean hasPagePermission(java.lang.String responsePage)
throws java.lang.Exception
java.lang.ExceptionresponsePage -
public com.taggercat.metadata.MetaProperty getMetaProperty(java.lang.String dsn,
java.lang.String propertyName)
throws java.lang.Exception
java.lang.Exceptionpublic void setLocale(java.util.Locale locale)
public LoginInfo getLoginInfo()
public void setLoginInfo(LoginInfo loginInfo)
public java.util.Locale getLocale()
public static org.hibernate.Session getCurrentHibernateSession()
public PermissionReader getPermissionReader()
public static java.util.List<java.lang.String> getAdminRoles()
public static void setAdminRoles(java.util.List<java.lang.String> adminRoles)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||