|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.taggercat.util.ELFunctions
public class ELFunctions
This class includes extension functions for TaggerCat's EL.
![]() |
![]() |
![]() |
| Field Summary | |
|---|---|
static long |
MILLISECONDS_PER_DAY
Number of milliseconds for 1 day (86400000). |
static long |
MILLISECONDS_PER_HOUR
Number of milliseconds for 1 hour. |
static long |
MILLISECONDS_PER_MINUTE
Number of milliseconds for 1 minute (60000). |
static long |
MILLISECONDS_PER_SECOND
Number of milliseconds for 1 second (1000). |
static long |
MILLISECONDS_PER_WEEK
Number of milliseconds for 1 week (604800000). |
| Constructor Summary | |
|---|---|
ELFunctions()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
ageAsString(java.util.Date fromDate)
Returns a string representation of the delta time. |
static java.lang.String |
autoFilterValue(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
Returns the current auto-filter on the specified DSN and property Name. |
static java.lang.Double |
avg(com.taggercat.el.ELContext elContext,
java.lang.String dsnPropertyName)
|
static java.lang.Double |
avg(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
Gets the average of properties from the named DS and property |
static java.lang.Double |
avg(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.String predicate)
Gets the average of properties from the named DS and property name that match the predicate expression. |
static java.lang.Integer |
count(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String predicate)
Gets a count of records in the data source that match the predicate expression. |
static TCEntity |
currentEntity(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
Returns the current TCEntity ( the one after the current TCEntity ) in the named ds. |
static java.lang.String |
dataFieldUID(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
|
static java.lang.String |
dataFieldUID(java.lang.String dsn,
java.lang.String propertyName)
Return the UID of the specified property and datasource; used in JSP EL Functions |
static java.lang.Object |
dataValue(TCEntity entity,
java.lang.String propertyName)
Returns the value of the named property on the specified entity. |
static DataSource |
ds(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
Returns the named data source if it exists; otherwise null. |
static java.lang.String |
dsQbfValue(com.taggercat.el.ELContext elContext,
java.lang.String dsnPropertyName)
Returns the current QBF value for the named data source and property if it exists; otherwise null. |
static java.lang.String |
dsQbfValue(java.lang.String dsnPropertyName)
Returns the current QBF value for the named data source and property if it exists; otherwise null. |
static java.lang.Boolean |
empty(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
Returns true if the named data source is empty ( has no rows ). |
static java.lang.String |
encryptPassword(java.lang.String password)
Returns the encrypted version of the specified password value. |
static java.lang.String |
extendedProperty(com.taggercat.el.ELContext elContext,
java.lang.String entityName,
java.lang.String extendedPropertyName)
Returns the extended property on the named entityName. |
static java.lang.String |
extendedProperty(com.taggercat.el.ELContext elContext,
java.lang.String entityName,
java.lang.String propertyName,
java.lang.String extendedPropertyName)
Returns the extended property on the named entityName and propertyName. |
static TCEntity |
findFirst(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String predicate)
Finds the first entity in the data source that match the predicate expression. |
static com.taggercat.el.ELContext |
getELContext()
|
static java.lang.Object |
getSQLValue(com.taggercat.el.ELContext elContext,
java.lang.String sql)
Executes an arbitrary SQL statement and returns the value from the first column of the first result row. |
static com.taggercat.metadata.MetaDataReader |
getTenantMetaData()
|
static java.lang.Object |
getTenantObject(java.lang.String key)
|
static TCEntity |
getUniqueResult(com.taggercat.el.ELContext elContext,
java.lang.String hql)
Executes an arbitrary HQL statement and returns the unique entity instance. |
static java.lang.Object |
getUserSetting(java.lang.String name)
|
static java.lang.Object |
getUserSetting(java.lang.String name,
java.lang.Object defaultValue)
|
static java.lang.Boolean |
hasPermission(com.taggercat.el.ELContext elContext,
java.lang.String dataAction,
java.lang.String entityName)
Returns true of the current user has the specified action permission on the named entity. |
static java.lang.Boolean |
hasPermission(com.taggercat.el.ELContext elContext,
java.lang.String dataAction,
java.lang.String entityName,
java.lang.String propertyName)
Returns true of the current user has the specified action permission on the named entity. |
static java.lang.Boolean |
hasUnsavedChanges(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
Returns true if there are unsaved changes on the specified data source. |
static java.lang.Boolean |
isGroupMember(com.taggercat.el.ELContext elContext,
java.lang.String groupNames)
Returns true if the current user is a member of one of the group names. |
static java.lang.Boolean |
isUserInRole(com.taggercat.el.ELContext elContext,
java.lang.String roleNames)
Returns true if the user is a member of the specified role ( group ) name. |
static java.util.List<java.lang.Object> |
list(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.String predicate)
Gets a list of properties values from the named DS and property name that match the expression. |
static java.lang.Double |
max(com.taggercat.el.ELContext elContext,
java.lang.String dsnPropertyName)
|
static java.lang.Double |
max(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
Gets the max of properties from the named DS and property |
static java.lang.Double |
max(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.String predicate)
Gets the max of property values from the named DS and property name that match the predicate expression. |
static java.lang.Double |
max(java.lang.Number a,
java.lang.Number b)
The max of the two Number values. |
static java.lang.Double |
min(com.taggercat.el.ELContext elContext,
java.lang.String dsnPropertyName)
|
static java.lang.Double |
min(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
Gets the minimum of properties from the named DS and property |
static java.lang.Double |
min(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.String predicate)
Gets the min of property values from the named DS and property name that match the predicate expression. |
static java.lang.Double |
min(java.lang.Number a,
java.lang.Number b)
The min of the two Number values. |
static TCEntity |
nextEntity(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
Returns the next TCEntity ( the one after the current TCEntity ) in the named ds. |
static double |
roundDouble(double d,
int places)
|
static java.lang.Integer |
rowCount(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
Returns the number of rows in the data source. |
static java.lang.Double |
sum(com.taggercat.el.ELContext elContext,
java.lang.String dsnPropertyName)
|
static java.lang.Double |
sum(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
Gets the sum of properties from the named DS and property |
static java.lang.Double |
sum(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.String predicate)
Gets the sum of properties from the named DS and property name that match the predicate expression. |
static java.lang.String |
tenantName()
|
static void |
updateProperty(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.Object newValue)
Sets a property on the current entity in the data source |
static long |
userId(com.taggercat.el.ELContext elContext)
Returns the current user id. |
static java.lang.String |
userName(com.taggercat.el.ELContext elContext)
Returns the current user name. |
static java.lang.Boolean |
validExpression(com.taggercat.el.ELContext elContext,
java.lang.String expression)
This function is used to validate the syntax of the expression string. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long MILLISECONDS_PER_SECOND
public static final long MILLISECONDS_PER_MINUTE
public static final long MILLISECONDS_PER_HOUR
public static final long MILLISECONDS_PER_DAY
public static final long MILLISECONDS_PER_WEEK
| Constructor Detail |
|---|
public ELFunctions()
| Method Detail |
|---|
public static DataSource ds(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - the EL contextdsn - the data source name
public static java.lang.String dsQbfValue(java.lang.String dsnPropertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptiondsnPropertyName - the dot delimited data source and property name
public static java.lang.String dsQbfValue(com.taggercat.el.ELContext elContext,
java.lang.String dsnPropertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - the EL contextdsnPropertyName - the dot delimited data source and property name
public static java.lang.Boolean empty(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - the EL contextdsn - the data source name
public static java.lang.Object dataValue(TCEntity entity,
java.lang.String propertyName)
entity - the entity instancepropertyName - the property name
public static java.lang.String dataFieldUID(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseException
public static java.lang.String dataFieldUID(java.lang.String dsn,
java.lang.String propertyName)
dsn - propertyName -
public static TCEntity currentEntity(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - the EL contextdsn - the data source name
public static TCEntity nextEntity(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - the EL contextdsn - the data source name
public static java.lang.String autoFilterValue(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - the EL contextdsn - the ds namepropertyName - the property name
public static java.lang.Object getSQLValue(com.taggercat.el.ELContext elContext,
java.lang.String sql)
throws com.taggercat.el.ParseException
Security Alert: This EL method opens up a big security hole in your application. You can close this my re-registering the same function name in you context initialization process.
com.taggercat.el.ParseExceptionelContext - the EL contextsql - the SQL statement
public static TCEntity getUniqueResult(com.taggercat.el.ELContext elContext,
java.lang.String hql)
throws com.taggercat.el.ParseException
Security Alert: This EL method opens up a big security hole in your application. You can close this my re-registering the same function name in you context initialization process.
com.taggercat.el.ParseExceptionelContext - the EL contexthql - the HQL statement
public static java.lang.Boolean hasPermission(com.taggercat.el.ELContext elContext,
java.lang.String dataAction,
java.lang.String entityName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - the EL contextdataAction - action names are one of READ, INSERT, UPDATE, or DELETEentityName -
public static java.lang.Boolean hasPermission(com.taggercat.el.ELContext elContext,
java.lang.String dataAction,
java.lang.String entityName,
java.lang.String propertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - the EL contextdataAction - action names are one of READ, INSERT, UPDATE, or DELETEentityName - propertyName -
public static java.lang.Boolean hasUnsavedChanges(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - the EL contextdsn -
public static java.lang.Boolean isUserInRole(com.taggercat.el.ELContext elContext,
java.lang.String roleNames)
elContext - the EL contextroleNames - a comma separated list of role ( group ) names.
public static java.lang.Boolean isGroupMember(com.taggercat.el.ELContext elContext,
java.lang.String groupNames)
isUserInRole() function.
elContext - groupNames - a comma separated list of group names
public static void updateProperty(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.Object newValue)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepropertyName - the property namenewValue - the value to set ( not an expression )public static java.lang.String userName(com.taggercat.el.ELContext elContext)
elContext - the EL context
public static long userId(com.taggercat.el.ELContext elContext)
elContext - the EL context
public static java.lang.String encryptPassword(java.lang.String password)
password - the password to encrypt
public static java.util.List<java.lang.Object> list(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.String predicate)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepropertyName - the property namepredicate - the expression to evaluate on each TCEntity
public static TCEntity findFirst(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String predicate)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepredicate - the expression to evaluate on each TCEntity
public static java.lang.Integer count(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String predicate)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepredicate - the expression to evaluate on each TCEntity
public static java.lang.Integer rowCount(com.taggercat.el.ELContext elContext,
java.lang.String dsn)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source name
public static java.lang.String extendedProperty(com.taggercat.el.ELContext elContext,
java.lang.String entityName,
java.lang.String extendedPropertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - entityName - the entity nameextendedPropertyName - the property name
public static java.lang.String extendedProperty(com.taggercat.el.ELContext elContext,
java.lang.String entityName,
java.lang.String propertyName,
java.lang.String extendedPropertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - entityName - the entity namepropertyName - the property nameextendedPropertyName - the property name
public static java.lang.Double avg(com.taggercat.el.ELContext elContext,
java.lang.String dsnPropertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseException
public static java.lang.Double avg(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepropertyName - the property name
public static java.lang.Double avg(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.String predicate)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepropertyName - the property namepredicate - the expression to evaluate on each TCEntity
public static java.lang.Double max(com.taggercat.el.ELContext elContext,
java.lang.String dsnPropertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseException
public static java.lang.Double max(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepropertyName - the property name
public static java.lang.Double max(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.String predicate)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepropertyName - the property namepredicate - the expression to evaluate on each TCEntity
public static java.lang.Double min(com.taggercat.el.ELContext elContext,
java.lang.String dsnPropertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseException
public static java.lang.Double min(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepropertyName - the property name
public static java.lang.Double min(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.String predicate)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepropertyName - the property namepredicate - the expression to evaluate on each TCEntity
public static java.lang.Double sum(com.taggercat.el.ELContext elContext,
java.lang.String dsnPropertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseException
public static java.lang.Double sum(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName,
java.lang.String predicate)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepropertyName - the property namepredicate - the expression to evaluate on each TCEntity
public static java.lang.Double sum(com.taggercat.el.ELContext elContext,
java.lang.String dsn,
java.lang.String propertyName)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - dsn - the data source namepropertyName - the property name
public static java.lang.Boolean validExpression(com.taggercat.el.ELContext elContext,
java.lang.String expression)
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionelContext - expression -
public static java.lang.String ageAsString(java.util.Date fromDate)
fromDate -
public static final double roundDouble(double d,
int places)
public static java.lang.Object getUserSetting(java.lang.String name)
public static java.lang.Object getUserSetting(java.lang.String name,
java.lang.Object defaultValue)
public static com.taggercat.el.ELContext getELContext()
throws com.taggercat.el.ParseException
com.taggercat.el.ParseExceptionpublic static java.lang.String tenantName()
public static com.taggercat.metadata.MetaDataReader getTenantMetaData()
public static java.lang.Object getTenantObject(java.lang.String key)
public static java.lang.Double max(java.lang.Number a,
java.lang.Number b)
a - one of the numbersb - the other number
public static java.lang.Double min(java.lang.Number a,
java.lang.Number b)
a - one of the numbersb - the other number
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||