Class: Aws::WAFV2::Types::RateBasedStatement
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Struct
|
|
|
Instance Chain:
self,
::Aws::Structure ,
Struct
|
|
| Inherits: |
Struct
|
| Defined in: | gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb |
Overview
A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate. The rule categorizes requests according to your aggregation criteria, collects them into aggregation instances, and counts and rate limits the requests for each instance.
You can specify individual aggregation keys, like IP address or HTTP method. You can also specify aggregation key combinations, like IP address and HTTP method, or HTTP method, query argument, and cookie.
Each unique set of values for the aggregation keys that you specify is a separate aggregation instance, with the value from each key contributing to the aggregation instance definition.
For example, assume the rule evaluates web requests with the following IP address and HTTP method values:
IP address <IP_ADDRESS>, HTTP method POST
IP address <IP_ADDRESS>, HTTP method GET
IP address <IP_ADDRESS>, HTTP method POST
IP address <IP_ADDRESS>, HTTP method GET
The rule would create different aggregation instances according to your aggregation criteria, for example:
If the aggregation criteria is just the IP address, then each individual address is an aggregation instance, and WAF counts requests separately for each. The aggregation instances and request counts for our example would be the following:
- IP address <IP_ADDRESS>: count 3
- IP address <IP_ADDRESS>: count 1
If the aggregation criteria is HTTP method, then each individual HTTP method is an aggregation instance. The aggregation instances and request counts for our example would be the following:
- HTTP method POST: count 2
- HTTP method GET: count 2
If the aggregation criteria is IP address and HTTP method, then each IP address and each HTTP method would contribute to the combined aggregation instance. The aggregation instances and request counts for our example would be the following:
- IP address <IP_ADDRESS>, HTTP method POST: count 1
- IP address <IP_ADDRESS>, HTTP method GET: count 2
- IP address <IP_ADDRESS>, HTTP method POST: count 1
For any n-tuple of aggregation keys, each unique combination of values
for the keys defines a separate aggregation instance, which ::Aws::WAF
counts
and rate-limits individually.
You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts and rate limits requests that match the nested statement. You can use this nested scope-down statement in conjunction with your aggregation key specifications or you can just count and rate limit all requests that match the scope-down statement, without additional aggregation. When you choose to just manage all requests that match a scope-down statement, the aggregation instance is singular for the rule.
You cannot nest a RateBasedStatement
inside another statement, for
example inside a NotStatement
or OrStatement
. You can define a
RateBasedStatement
inside a web ACL and inside a rule group.
For additional information about the options, see Rate limiting web requests using rate-based rules in the WAF Developer Guide.
If you only aggregate on the individual IP address or forwarded IP
address, you can retrieve the list of IP addresses that ::Aws::WAF
is
currently rate limiting for a rule through the API call
GetRateBasedStatementManagedKeys
. This option is not available for
other aggregation configurations.
::Aws::WAF
tracks and manages web requests separately for each instance of a
rate-based rule that you use. For example, if you provide the same
rate-based rule settings in two web ACLs, each of the two rule
statements represents a separate instance of the rate-based rule and
gets its own tracking and management by ::Aws::WAF
. If you define a
rate-based rule inside a rule group, and then use that rule group in
multiple places, each use creates a separate instance of the
rate-based rule that gets its own tracking and management by ::Aws::WAF
.
Constant Summary
Instance Attribute Summary
-
#aggregate_key_type ⇒ String
rw
Setting that indicates how to aggregate the request counts.
-
#custom_keys ⇒ Array<Types::RateBasedStatementCustomKey>
rw
Specifies the aggregate keys to use in a rate-base rule.
-
#forwarded_ip_config ⇒ Types::ForwardedIPConfig
rw
The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin.
-
#limit ⇒ Integer
rw
The limit on requests per 5-minute period for a single aggregation instance for the rate-based rule.
-
#scope_down_statement ⇒ Types::Statement
rw
An optional nested statement that narrows the scope of the web requests that are evaluated and managed by the rate-based statement.
Instance Method Summary
::Aws::Structure
- Included
| #to_hash | Alias for Structure#to_h. |
Instance Attribute Details
#aggregate_key_type ⇒ String
(rw)
Setting that indicates how to aggregate the request counts.
CONSTANT
- Count and limit the requests that match the rate-based rule's scope-down statement. With this option, the counted requests aren't further aggregated. The scope-down statement is the only specification used. When the count of all requests that satisfy the scope-down statement goes over the limit, WAF applies the rule action to all requests that satisfy the scope-down statement.
With this option, you must configure the ScopeDownStatement
property.
CUSTOM_KEYS
- Aggregate the request counts using one or more web request components as the aggregate keys.
With this option, you must specify the aggregate keys in the
CustomKeys
property.
To aggregate on only the IP address or only the forwarded IP
address, don't use custom keys. Instead, set the aggregate key
type to IP
or FORWARDED_IP
.
FORWARDED_IP
- Aggregate the request counts on the first IP address in an HTTP header.
With this option, you must specify the header to use in the
ForwardedIPConfig
property.
To aggregate on a combination of the forwarded IP address with
other aggregate keys, use CUSTOM_KEYS
.
IP
- Aggregate the request counts on the IP address from the web request origin.
To aggregate on a combination of the IP address with other
aggregate keys, use CUSTOM_KEYS
.
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 6064
class RateBasedStatement < Struct.new( :limit, :aggregate_key_type, :scope_down_statement, :forwarded_ip_config, :custom_keys) SENSITIVE = [] include Aws::Structure end
#custom_keys ⇒ Array
<Types::RateBasedStatementCustomKey> (rw)
Specifies the aggregate keys to use in a rate-base rule.
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 6064
class RateBasedStatement < Struct.new( :limit, :aggregate_key_type, :scope_down_statement, :forwarded_ip_config, :custom_keys) SENSITIVE = [] include Aws::Structure end
#forwarded_ip_config ⇒ Types::ForwardedIPConfig (rw)
The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name.
::Aws::WAF
doesn't
apply the rule to the web request at all.
This is required if you specify a forwarded IP in the rule's aggregate key settings.
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 6064
class RateBasedStatement < Struct.new( :limit, :aggregate_key_type, :scope_down_statement, :forwarded_ip_config, :custom_keys) SENSITIVE = [] include Aws::Structure end
#limit ⇒ Integer
(rw)
The limit on requests per 5-minute period for a single aggregation
instance for the rate-based rule. If the rate-based statement
includes a ScopeDownStatement
, this limit is applied only to the
requests that match the statement.
Examples:
If you aggregate on just the IP address, this is the limit on requests from any single IP address.
If you aggregate on the HTTP method and the query argument name "city", then this is the limit on requests for any single method, city pair.
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 6064
class RateBasedStatement < Struct.new( :limit, :aggregate_key_type, :scope_down_statement, :forwarded_ip_config, :custom_keys) SENSITIVE = [] include Aws::Structure end
#scope_down_statement ⇒ Types::Statement (rw)
An optional nested statement that narrows the scope of the web
requests that are evaluated and managed by the rate-based statement.
When you use a scope-down statement, the rate-based rule only tracks
and rate limits requests that match the scope-down statement. You
can use any nestable Statement
in the scope-down statement, and you
can nest statements at any level, the same as you can for a rule
statement.
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 6064
class RateBasedStatement < Struct.new( :limit, :aggregate_key_type, :scope_down_statement, :forwarded_ip_config, :custom_keys) SENSITIVE = [] include Aws::Structure end


World countries list
Calculation of countries number
Sort by Name
A->Z
Z->A
Sort by Capital
Sort by Population


|
GPGPU-Sim
|
#include <memory.h>
Public Member Functions | |
| memory_space_impl (std::string name, unsigned hash_size) | |
| virtual void | write (mem_addr_t addr, size_t length, const void *data, ptx_thread_info *thd, const ptx_instruction *pI) |
| virtual void | read (mem_addr_t addr, size_t length, void *data) const |
| virtual void | print (const char *format, FILE *fout) const |
| virtual void | set_watch (addr_t addr, unsigned watchpoint) |
| Public Member Functions inherited from memory_space | |
| virtual | ~memory_space () |
Private Types | |
| typedef mem_map< mem_addr_t, mem_storage< BSIZE > > | map_t |
Private Member Functions | |
| void | read_single_block (mem_addr_t blk_idx, mem_addr_t addr, size_t length, void *data) const |
Private Attributes | |
| std::string | m_name |
| unsigned | m_log2_block_size |
| map_t | m_data |
| std::map< unsigned, mem_addr_t > | m_watchpoints |
|
private |
| memory_space_impl< BSIZE >::memory_space_impl | ( | std::string | name, |
| unsigned | hash_size | ||
| ) |
|
virtual |
Implements memory_space.
|
virtual |
Implements memory_space.
|
private |
|
virtual |
Implements memory_space.
|
virtual |
Implements memory_space.
|
private |
|
private |
|
private |
|
private |


|
|
def | __init__ |
| |
|
def | name |
| |
|
def | set_name |
| |
|
def | clear_name |
| |
|
def | has_name |
| |
|
def | start |
| |
|
def | set_start |
| |
|
def | clear_start |
| |
|
def | has_start |
| |
|
def | end |
| |
|
def | set_end |
| |
|
def | clear_end |
| |
|
def | has_end |
| |
|
def | MergeFrom |
| |
|
def | Equals |
| |
|
def | IsInitialized |
| |
|
def | ByteSize |
| |
|
def | ByteSizePartial |
| |
|
def | Clear |
| |
|
def | OutputUnchecked |
| |
|
def | OutputPartial |
| |
|
def | TryMerge |
| |
|
def | __str__ |
| |
|
|
| has_name_ |
| |
|
| name_ |
| |
|
| has_start_ |
| |
|
| start_ |
| |
|
| has_end_ |
| |
|
| end_ |
| |
|
|
int | has_name_ = 0 |
| |
|
string | name_ = "" |
| |
|
int | has_start_ = 0 |
| |
|
string | start_ = "" |
| |
|
int | has_end_ = 0 |
| |
|
string | end_ = "" |
| |
|
int | kname = 1 |
| |
|
int | kstart = 2 |
| |
|
int | kend = 3 |
| |
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/api/search/search_service_pb.py


Savegame Editor
for The legend of Zelda: BOTW
by
Marc Robledo
See on GitHub
Donate
|
Add item
|
Close file
Save changes
Rupees
Rupees
Mons
Horses
Edit horse 0
Edit horse 1
Edit horse 2
Edit horse 3
Edit horse 4
Edit untamed horse
Completionism
Korok counter
Unlock all
Missing locations
See
Modifier flag
Value
Save chages
Name
Saddles
Reins
Type
Change horse


|
|
def | __init__ (self, params) |
| |
|
def | numNodes (self) |
| |
|
def | numSwitches (self) |
| |
|
def | defaultEpFxn (self, nodeID) |
| |
|
def | buildSwitches (self) |
| |
|
def | buildEndpoints (self, epFxn) |
| |
|
def | latency (self, params) |
| |
|
def | connectSwitches (self) |
| |
|
def | connectEndpoints (self) |
| |
|
def | buildLogPNetwork (self) |
| |
|
def | buildFull (self, epFxn) |
| |
|
def | buildLogP (self, epFxn) |
| |
|
def | build (self, epFxn=None) |
| |
|
|
| params |
| |
|
| system |
| |
|
| num_nodes |
| |
|
| num_switches |
| |
|
| switches |
| |
|
| nodes |
| |
The documentation for this class was generated from the following file:


Expression Listener
Expression listener are used to listen to variable expressions from the Variable API.
This module uses the same terminology as Variables, so please read these
documentation pages first.
Currently there are thee different listener types implemented:
- expressionlistener_class listens to an expression and adds or removes
a class to the current DOM Element: If the expression evaluates to true,
the given class name is added, otherwise the given class name plus the appendix
“_off” is added.
- expressionlistener_focus listens to an expression and sets the focus
to the current DOM Element if the expression turns true.
- expressionlistener_set sets a variable (in the context of the current DOM
Element) to a given expression whenever the listened expression changes its value.
JavaScript
-
Plugins.fn.expressionlistener_class(element_class, expression)
Add or remove a the element_class from the current element depending on the
expression‘s value as described above.
| Arguments: |
- element_class (string) – The class name.
- expression (string) – A preprocessed expression (evaluated in the context of
the current element).
|
| Returns: | An object providing enable and disable functions.
|
-
Plugins.fn.expressionlistener_focus(expression)
Sets the focus to the current element whenever the expression turns from
false to true.
| Arguments: |
- expression (string) – A preprocessed expression (evaluated in the context of
the current element).
|
| Returns: | An object providing enable and disable functions.
|
-
Plugins.fn.expressionlistener_set(expression, key, value_expression)
Applys value_expression to key whenever the expression‘s value changes.
| Arguments: |
- expression (string) – A preprocessed expression (evaluated in the context of
the current element). It’s the one to listen to.
- key (string) – A comma-seperated list of preprocessed keys (refering to the
context of the current element).
- value_expression (string) – A preprocessed expression (evaluated in the context of
the current element). It’s the one that is applied to key.
|
| Returns: | An object providing enable and disable functions.
|


Discrete-Event Simulator: Conway's Game of Life
Game of life will restart randomly every 40 seconds :)


About Me
I am a Full Stack Web Developer in Sacramento, CA, certified in both front-end and back-end technologies. I am passionate about science, nature, and the arts with my favorite hobbies being backpacking and camping. I have a Certificate of Completion from U.C. Davis's Coding Bootcamp and a B.A. from Baylor University in Texas. I am excited to contribute to new projects as well as furthter improve my knowledge of programming languages. In the long-term, I would love to combine my passions for both nature and technology to begin working with GIS Systems to help find topographical and regional solutions to combat the climate crisis.
Technologies:
- JavaScript
- React
- MongoDB & Mongoose
- Node & Express
- MySQL
- HTML & CSS


Card Matching Game
Created By: Teresa Rosinski
October 10th, 2021
Attempts
Reset Game
Matches Remaining


Before Change
// We"re going to handle multi-batch indexing with a try-catch loop
// This way - in the default case, we can avoid doing expansions of x1 which can be timely
except IndexError:
if isinstance(batch_indices, slice):
x1 = x1.expand(1, *self.x1.shape[-2:])[(*batch_indices, row_index, dim_index)]
elif isinstance(batch_indices, tuple):
if any(not isinstance(bi, slice) for bi in batch_indices):
After Change
f"Attempting to tensor index a non-batch matrix"s batch dimensions. "
"Got batch index {batch_indices} but my shape was {self.shape}"
)
x1 = x1.expand(*([1] * (len(batch_indices) - self.x1.dim() + 2)), *self.x1.shape)
x1 = x1[(*batch_indices, row_index, dim_index)]
// Call x2[*batch_indices, col_index, :]


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.phoenixbioinformatics.proxy.model.SubscribeGroup
public class SubscribeGroup
A Faces managed bean that manages the model information for a group of TAIR users being subscribed at once for a discount.
| Field Summary | |
|---|---|
private boolean |
autorenew
autorenew setting for the group, defaults to true |
private static java.lang.String |
BAD_LOGGED_IN_USER
message for problem with initializing user |
private java.lang.String |
institutionName
the institution name for the group |
private java.math.BigInteger |
loggedInPersonId
|
private static org.apache.log4j.Logger |
logger
the logger for this class |
private java.util.List<Registration> |
members
the list of subscription objects for the group members |
private static java.lang.String |
NO_ACTION
message that nothing was done for some internal reason |
private static java.lang.String |
NO_COMMUNITY
|
private static java.lang.String |
PASSWORD2
Faces component name for password-2 field |
private PayPalPayment |
payment
|
private static long |
serialVersionUID
serial version UID |
private static java.lang.String |
SUBSCRIBED_AND_REGISTERED
message about successfully registering and subscribing |
private Subscription |
subscription
subscription |
| Constructor Summary | |
|---|---|
SubscribeGroup()
Create a SubscribeRegistered object. |
| Method Summary | |
|---|---|
void |
addGroupPersonLinks(org.tair.bs.community.PersonDelegate delegate,
org.tair.bs.community.BsPerson subscribingPi,
org.tair.bs.community.BsSubscribedGroup group,
java.util.List<java.math.BigInteger> personIds)
|
java.lang.String |
addMember()
Add a group member to the list of members. |
void |
checkAllMembers(org.tair.bs.community.PersonDelegate delegate)
Loop through all the members, attempting all of them and setting the error state on any that have problems. |
void |
checkNewPerson(Registration subscription,
org.tair.bs.community.PersonDelegate delegate)
Check an unregistered person for the various preconditions required to register the person. |
java.lang.String |
clearForm()
Clear the form and set the default values. |
int |
countMembers()
Count the number of lab members in the members list. |
void |
createBlankMember(org.tair.bs.community.PersonDelegate delegate)
Create a blank member subscription in the list of member subscriptions. |
java.lang.String |
deleteMember(Registration member)
Remove a group member from the member list. |
java.lang.String |
getInstitutionName()
Get the institution name. |
java.util.List<Registration> |
getMembers()
Get the subscription objects for the group members. |
java.math.BigInteger |
getNextGroupNumber(org.tair.bs.community.BsPerson pi)
Get the next group number to use as part of the composite key for group. |
PayPalPayment |
getPayment()
Get the payment. |
private org.tair.bs.community.BsPerson |
getSubscribingPi()
Get the subscribing PI. |
Subscription.Term |
getTerm()
Get the subscription term. |
java.util.Map<java.lang.String,Subscription.Term> |
getTerms()
Get the terms map. |
void |
initForm(org.tair.bs.community.PersonDelegate delegate)
Initialize the form fields based on login status. |
boolean |
isAutorenew()
Get the autorenew. |
boolean |
isLoggedIn()
Is there an active login? Is the person using this managed bean logged into the paywall? |
java.lang.String |
registerAndSubscribeAllMembers(org.tair.bs.community.PersonDelegate delegate,
java.lang.String product)
Register and subscribe all members. |
org.tair.bs.community.BsPerson |
registerAndSubscribeMember(org.tair.bs.community.PersonDelegate delegate,
org.tair.bs.community.BsPerson subscribingPi,
java.util.List<java.math.BigInteger> personIds,
Registration reg)
Register and subscribe a person. |
void |
setAutorenew(boolean autorenew)
Set the autorenew. |
void |
setInstitutionName(java.lang.String institutionName)
Set the institution name. |
private void |
setItemName(java.lang.String product,
java.math.BigInteger groupNo)
Set the payment item name in the payment object, a string that appears in the invoice/payment statement that identifies the people, term, autorenew status, and subscription type. |
void |
setLoginId()
Set the logged-in user id from the external target. |
void |
setMembers(java.util.List<Registration> subscriptions)
Set the list of group member subscriptions. |
void |
setPayment(PayPalPayment payment)
Set the payment. |
private void |
setPaymentAmount()
Set the total amount of the payment in the payment object. |
void |
setTerm(Subscription.Term term)
Set the subscription term. |
private void |
setUpMembersFromPerson(org.tair.bs.community.PersonDelegate delegate,
org.tair.bs.community.BsPerson person)
Set up all non-subscribed members affiliated with the organizations of the logged in person. |
java.lang.String |
setUpPayment(java.lang.String productName,
java.math.BigInteger groupNo)
Set up the payment object and navigate to the next UI page. |
java.lang.String |
subscribeTair()
Subscribe the user to TAIR. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private static final java.lang.String BAD_LOGGED_IN_USER
private static final java.lang.String NO_COMMUNITY
private static final org.apache.log4j.Logger logger
private PayPalPayment payment
private java.util.List<Registration> members
private java.math.BigInteger loggedInPersonId
private java.lang.String institutionName
private boolean autorenew
private Subscription subscription
private static final java.lang.String SUBSCRIBED_AND_REGISTERED
private static final java.lang.String NO_ACTION
private static final java.lang.String PASSWORD2
| Constructor Detail |
|---|
public SubscribeGroup()
| Method Detail |
|---|
public void initForm(org.tair.bs.community.PersonDelegate delegate)
delegate
- the business delegatepublic void setLoginId()
public void createBlankMember(org.tair.bs.community.PersonDelegate delegate)
delegate
- the person business delegatepublic java.lang.String clearForm()
private void setUpMembersFromPerson(org.tair.bs.community.PersonDelegate delegate, org.tair.bs.community.BsPerson person)
delegate
- the current Person delegateperson
- the logged-in person objectpublic java.util.List<Registration> getMembers()
public void setMembers(java.util.List<Registration> subscriptions)
subscriptions
- a list of subscriptionspublic java.lang.String addMember()
public java.lang.String deleteMember(Registration member)
member
- the member to remove
public java.util.Map<java.lang.String,Subscription.Term> getTerms()
public PayPalPayment getPayment()
public void setPayment(PayPalPayment payment)
payment
- a paymentpublic boolean isAutorenew()
public void setAutorenew(boolean autorenew)
autorenew
- a autorenewpublic Subscription.Term getTerm()
public void setTerm(Subscription.Term term)
term
- a termpublic java.lang.String getInstitutionName()
public void setInstitutionName(java.lang.String institutionName)
institutionName
- a institutionNamepublic java.lang.String subscribeTair()
public java.lang.String registerAndSubscribeAllMembers(org.tair.bs.community.PersonDelegate delegate, java.lang.String product)
delegate
- the business delegateproduct
- the name of the product
public void addGroupPersonLinks(org.tair.bs.community.PersonDelegate delegate, org.tair.bs.community.BsPerson subscribingPi, org.tair.bs.community.BsSubscribedGroup group, java.util.List<java.math.BigInteger> personIds) throws java.sql.SQLException
delegate
- subscribingPi
- group
- personIds
-
java.sql.SQLException
public org.tair.bs.community.BsPerson registerAndSubscribeMember(org.tair.bs.community.PersonDelegate delegate, org.tair.bs.community.BsPerson subscribingPi, java.util.List<java.math.BigInteger> personIds, Registration reg)
delegate
- the person business delegatesubscribingPi
- the subscribing PI personpersonIds
- the accumulating list of person idsreg
- the registration information for the person
public java.lang.String setUpPayment(java.lang.String productName, java.math.BigInteger groupNo)
productName
- the name of the productgroupNo
- the group number, part of the primary key for the group
public void checkAllMembers(org.tair.bs.community.PersonDelegate delegate)
delegate
- the business delegatepublic void checkNewPerson(Registration subscription, org.tair.bs.community.PersonDelegate delegate)
subscription
- the subscription being checkeddelegate
- the business delegateprivate org.tair.bs.community.BsPerson getSubscribingPi()
private void setPaymentAmount()
public int countMembers()
private void setItemName(java.lang.String product, java.math.BigInteger groupNo)
product
- the name of the product for the itemgroupNo
- the group number, part of the primary key for the grouppublic java.math.BigInteger getNextGroupNumber(org.tair.bs.community.BsPerson pi) throws java.sql.SQLException
pi
- the principal investigator owning the group
java.sql.SQLException
public boolean isLoggedIn()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Please click on the following links to refer the technical documentaion.
|
Note
|
More to Come
Please keep checking this section frequently for more updates.
|
Introduction
The following sections outlines the different options available while configuring an application.
View Config Annotations
| Component | Description | Attributes | Notes |
|---|---|---|---|
Page |
Used to create a view page |
Type - Home,Details,Form,Static |
Default value will be Home. |
Tile |
Used to create a view Tile |
Size - XSmall,Small,Medium,Large |
Default value will be Large. |
Section |
Used to create a view Section. A section is encapsulated in a tile |
Size - XSmall,Small,Medium,Large |
Default value will be Large. |
Form |
Used to create a view Form to capture user responses. A forn is encapsulated in a section |
ViewParamBehavior component is used to define an ANNOTATION_TYPE level annotation that is used with all most of the annotations described below.
@Retention(RetentionPolicy.RUNTIME)
@Target(value={ElementType.ANNOTATION_TYPE})
@Inherited
public @interface ViewStyle {
}
|
Note
|
The above code is the definition if ViewStyle component. As you can see, ElementType.ANNOTATION_TYPE determines that this annotation can only be used in other annotations. |
Here is an example: -
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@ViewStyle
public @interface ViewRoot {
String alias() default "root";
String layout() default "";
}
Accordion
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
Accordion |
cannot be changed |
cssClass |
String |
css class override where default is 'panel-default' |
@Accordion
private VASectionA_Questionnaire vaSectionA_Questionnaire;
|
Note
|
Accordion is supported only in a form |
AccordionGroup
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
AccordionGroup |
cannot be changed |
cssClass |
String |
panel-default |
css class override where default is 'panel-default' |
Button
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
Button |
cannot be changed |
url |
String |
source url of the button element |
|
b |
String |
$execute |
b |
method |
String |
GET |
HTTP method that will be executed |
imgSrc |
String |
source path/ url of the image |
|
type |
enum |
Type.Plain |
type of button |
payload |
String |
payload |
|
cssClass |
String |
btn btn-primary |
class used to style the section |
formReset |
boolean |
true |
reset the form |
@Config(url="/pageAddEditGoal/tileEditGoal/sectionEditGoal/goalDetailsForm/_nav?pageId=pageCarePlanSummary")
@Button(type = Button.Type.DESTRUCTIVE)
private String delete;
|
Note
|
The possible enum values for size are PRIMARY, SECONDARY, PLAIN, DESTRUCTIVE Please read @Config for information regarding @Config annotation. |
ButtonGroup
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
ButtonGroup |
cannot be changed |
cssClass |
String |
text-sm-right |
class used to style the section |
@ButtonGroup
private FormGoalsButtonGroup formGoalsButtonGroup;
CardDetail
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
CardDetail |
cannot be changed |
cssClass |
String |
contentBox right-gutter bg-light mt-1 |
class used to style the CardDetail |
imgSrc |
String |
source path/ url of the image |
|
editable |
boolean |
false |
make the component editable |
modelPath |
String |
specify the model path for CardDetail |
|
title |
String |
specify the title of the CardDetail |
|
draggable |
boolean |
false |
determine of the CardDetailsGrid is draggable |
@CardDetail(title="Member Overview", cssClass="contentBox right-gutter bg-alternate mt-0")
private CardDetailMember cardDetailMember;
|
Note
|
contentBox right-gutter bg-alternate mt-0 overrides the default cssClass specified for the CardDetail |
CardDetail Children Components
CardDetail has several children components that nested level components can utilize to break the component into logical sections.
@Model
@Getter @Setter
public static class MyCard {
@CardDetail.Header
MyCardDetailTag myCardTag;
@CardDetail.Body
MyCardDetailBody myCardBody;
}
@Model
@Getter @Setter
public static class MyCardDetailTag { ... }
@Model
@Getter @Setter
public static class MyCardDetailBody { ... }
CardDetail.Body
See the available CardDetail children components below:
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
CardDetailsBody |
cannot be changed |
cssClass |
String |
class used to style the component |
CardDetail.Footer
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
CardDetailsFooter |
cannot be changed |
cssClass |
String |
class used to style the component |
CardDetail.Header
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
CardDetailsHeader |
cannot be changed |
cssClass |
String |
class used to style the component |
CardDetail.Tag
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
CardDetailsTag |
cannot be changed |
cssClass |
String |
class used to style the component |
CardDetailsGrid
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
CardDetailsGrid |
cannot be changed |
editUrl |
String |
||
draggable |
boolean |
false |
determine of the CardDetailsGrid is draggable |
onLoad |
boolean |
false |
specify the behaviour of CardDetailsGrid during page load |
@CardDetailsGrid(onLoad=true, draggable=true)
@Config(url="/pageHealthConcerns/tileHealthConcerns/sectionConcerns/concernsCards.m/_process?fn=_set&url=/p/cmcase/_search?fn=query&where=cmcase.id.eq('<!/.m/id!>')&project=/healthProblemsEnclosed")
@Path(linked=false)
private List<CardDetailConcerns> concernsCards;
|
Note
|
onLoad=true and draggable=true will override the default false values for onLoad and draggable respectively. For information regarding @Config, please read View Configuration Annotations section |
CheckBox
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
CheckBox |
cannot be changed |
cssClass |
String |
class used to style the CheckBox |
|
labelClass |
String |
anthem-label |
class used to style the CheckBox label |
postEventOnChange |
boolean |
false |
post the value to the server onblur |
controlId |
String |
currently not in use except for assessments where this signifies the question number |
|
help |
String |
help text that will be displayed in tooltip component |
@CheckBox(postEventOnChange=true)
private boolean admin;
|
Note
|
postEventOnChange=true will override the default false value of postEventOnChange. |
CheckBoxGroup
CheckBoxGroup can be used for multi-select checkboxes.
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
CheckBoxGroup |
cannot be changed |
cssClass |
String |
class used to style the CheckBox |
|
labelClass |
String |
anthem-label |
class used to style the CheckBox label |
postEventOnChange |
boolean |
false |
post the value to the server onblur |
controlId |
String |
||
help |
String |
help text that will be displayed in tooltip component |
@CheckBoxGroup(postEventOnChange=true)
private String[] days;
|
Note
|
postEventOnChange=true will override the default false value of postEventOnChange. DataType for checkboxgroup attribute should be String[] to hold multiple values. |
ComboBox
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
ComboBox |
cannot be changed |
readOnly |
boolean |
false |
make the component readonly |
labelClass |
String |
anthem-label |
class used to style the label |
postEventOnChange |
boolean |
false |
post the value to the server onblur |
controlId |
String |
currently not in use except for assessments where this signifies the question number |
|
help |
String |
help text that will be displayed in tooltip component |
@Path
@Model.Param.Values(url="~/client/orgname/staticCodeValue/_search?fn=lookup&where=staticCodeValue.paramCode.eq('/goalCategory')")
@ComboBox
private String goalCategory;
|
Note
|
Please refer @Model in the core config annotations section. |
Domain
| Name | Type | Default | Description |
|---|---|---|---|
value |
String |
||
lifecycle |
String |
||
includeListeners |
enum |
||
onLoad |
boolean |
false |
specify the behaviour of CardDetailsGrid during page load |
|
Note
|
The possible enum values for includeListeners are ListenerType.none, ListenerType.websocket, ListenerType.persistent, ListenerType.update |
@Domain component is a part of view config as well as core config annotations.
The difference between the two is that @Domain annotation of view config does not persist any data
while @Domain annotation of core config persists data in MongoDB.
View configuration @Domain annotation does not persist any data.
value=Database.rep_none of @Repo specifies that a class with @Domain annotation does
not persist any data in database.
For information about @Domain in core config, please refer to Core Config Annotations section.
@Domain(value = "cmcaseview",includeListeners={ListenerType.websocket})
@MapsTo.Type(CMCase.class)
@Repo(value=Database.rep_none, cache=Cache.rep_device)
@Getter @Setter
public class VRCmCase {
}
FieldValue
A simple field which holds a value. Has the ability to become an in place edit field with several configurable properties.
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
FieldValue |
cannot be changed |
cols |
String |
1 |
the number of columns to display |
cssClass |
String |
class used to style the component |
|
iconField |
String |
adds a class 'iconField' and the value of iconField to the css class for this component |
|
imgSrc |
String |
source path/url of the image |
|
inPlaceEdit |
boolean |
false |
whether or not to configure this field as able to be edited in place |
inPlaceEditType |
String |
set the Type of the in place edit component |
|
showName |
boolean |
true |
whether or not to show the label for this component |
value |
Enum (Type) |
Type.Field |
classification of the link useful for determining functional behavior |
url |
String |
source url to operate on |
@MapsTo.Type(CMGoal.class)
@Getter @Setter
public static class VCHeaderGoal {
@FieldValue(showName=false, cols="2")
@MapsTo.Path("/description")
private String description;
@FieldValue(showName=false, iconField="date")
@MapsTo.Path("/targetDate")
private LocalDate targetDate;
@FieldValue(showName=false, iconField="planned")
@MapsTo.Path("/status")
private String goalStatus;
}
FileUpload
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
FileUpload |
Cannot be changed |
type |
String |
.pdf,.png |
comma separated list of file types user is allowed to upload |
@FileUpload(type=".png,.pdf")
private String fileUpload;
The above configuration allows only ".png" and ".pdf" to be uploaded by the users. If they try to upload other file types, an error is thrown.
FilterButton
A collection of buttons to operate with a configurable filter
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
FilterButton |
cannot be changed |
b |
String |
$execute |
behavior to use |
cssClass |
String |
btn btn-primary |
class used to style the component |
imgSrc |
String |
source path/url of the image |
|
method |
String |
GET |
HTTP method that will be executed |
url |
String |
source url to operate on |
@FilterButton
private VFbAllTasks vFbAllTasks;
@Model @Getter @Setter
public static class VFbAllTasks {
@Config(url="/vpHome/vtTasks/vsTasks/tasks.m/_process?fn=_set&url=/p/task/_search?fn=query&where=task.status.eq('Open')")
@Button(cssClass="btn btn-secondary btn-badge")
private String vbOpenTasks;
}
|
Tip
|
Decorate complex classes with @FilterButton to define behavior for child elements (e.g. vbOpenTasks in the example above.) |
Form
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
Form |
cannot be changed |
submitUrl |
String |
url that will be hit after submit |
|
b |
String |
b |
|
cssClass |
String |
class used to style the section |
|
submitButton |
boolean |
true |
form will be submitted |
navLink |
String |
navigation link |
@Form(cssClass="twoColumn")
@Path(linked=false, state=State.External)
private FormGoalDetails goalDetailsForm;
Grid
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
Grid |
cannot be changed |
onLoad |
boolean |
false |
specify the behaviour of CardDetailsGrid during page load |
isTransient |
boolean |
false |
specify the behaviour of CardDetailsGrid during page load |
url |
String |
specify url for the Grid |
|
rowSelection |
boolean |
false |
determine if row selection is enabled on the Grid |
pageSize |
String |
10 |
specify the page size for the Grid |
pagination |
boolean |
true |
determine if pagination is enabled on the Grid |
postButton |
boolean |
false |
determine if post Button is enabled on the Grid |
postButtonUrl |
String |
specify the url of post button for the Grid |
|
postButtonTargetPath |
String |
Target path for the multi select rows on the grid. The payload for the selections will be created based on this path. |
|
postButtonAlias |
String |
Button name alias for the multiselect action on the grid |
|
postEventOnChange |
boolean |
false |
post the value to the server onblur |
@Grid
@MapsTo.Path(linked=false,state=State.External)
private List<SearchPatient> patientResult;
Provide the postButtonUrl based on the config.
@Grid(rowSelection=true,
postButtonUrl="/view/page/tile/section/remove",
postButton=true,
postButtonTargetPath="temp_ids",
postButtonAlias="Remove")
@Path("/members")
private List<VGGroupView> vgGroupList;
@Configs({
@Config(url="/page/tile/section/vsRemoveList/_replace"),
@Config(url="/page/tile/section/vgGroupList/<!col!>/.m/_process?fn=_setByRule&rule=updategroup", col="<!/vsRemoveList/temp_ids!>"),
@Config(url="<!#this!>/../vgGroupList.m/_process?fn=_set&url=/p/group/_search?fn=query&project=/members")
})
private String remove;
private VSRemoveList vsRemoveList;
@Getter @Setter
public static class VSRemoveList {
private List<String> temp_ids;
}
GridColumn
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
GridColumn |
cannot be changed |
hidden |
boolean |
false |
Setting this to true will hide the column in the grid |
sortable |
boolean |
false |
Enables sorting on the column |
filter |
boolean |
false |
Setting this to true will enable a explicit filter component(Input TextBox) on the UI |
filterValue |
String |
Default filterValue for a particular column.Can be used without setting filter attribute to restrict user from providing any other filter value. |
|
filterMode |
String |
equals |
Mode to filter data within the column. It is defaulted to 'equals'.Current filter modes supported by the Grid component are listed as enum values - equals,contains,endsWith,in |
@GridColumn(hidden=true,filterValue="false")
@Path private boolean active;
Image
An image component used for displaying images.
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
Image |
cannot be changed |
imgSrc |
String |
source path/ url of the image |
@Image(imgSrc="/resources/img.png")
private String title;
InputDate
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
InputDate |
cannot be changed |
readOnly |
boolean |
false |
hide/show the component |
labelClass |
String |
anthem-label |
class used to style the label |
type |
String |
date |
type of input date |
postEventOnChange |
boolean |
false |
post the value to the server onblur |
controlId |
String |
currently not in use except for assessments where this signifies the question number |
|
help |
String |
help text that will be displayed in tooltip component |
@Path
@InputDate private LocalDate startDate;
InPlaceEdit
A component which allows for in-line editing of a particular field.
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
InPlaceEdit |
cannot be changed |
type |
String |
text |
the type of field being configured. Supported types are Text, Textarea, and ComboBox |
Label
A label component used to output descriptive text.
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
Label |
cannot be changed |
@Label
private String title;
Link
A hyperlink component used for navigation or user interaction of text.
Links can currently be used under the following components:
-
CardDetail
-
Menu
-
Section
| Name | Type | Default | Description |
|---|---|---|---|
altText |
String |
alternate text to be used |
|
b |
String |
$executeAnd$nav |
behavior to use |
cssClass |
String |
class used to style the component |
|
imgSrc |
String |
source path/ url of the image |
|
method |
String |
GET |
HTTP method that will be executed |
rel |
String |
the HTML rel attribute |
|
target |
String |
the HTML target attribute |
|
url |
String |
source url to operate on |
|
value |
Enum (Type) |
Type.Default |
classification of the link useful for determining functional behavior |
|
Note
|
Type.java
The possible enum values for value are: DEFAULT, EXTERNAL, MENU.
|
// UI Navigation to page vpHome under domain petclinic
@Link(url="/h/petclinic/vpHome")
private String linkToHome;
// Executes a request against _subscribe, and sets the image
@Link(url="/notifications/_subscribe:{id}/_process", b="$executeAnd$configAnd$nav" , method="POST")
private String subscribeToEmailNotifications;
// Creates an external link, as in a link navigating outside of the context of the Nimbus framework.
@Link(url="https://www.mywebsite.com", value = Link.Type.EXTERNAL, target="_new", rel="nofollow")
private String myWebsiteLink;
Menu
A section intended to contain other navigation components.
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
cannot be changed |
|
cssClass |
String |
class used to style the component |
|
value |
Enum (Type) |
Type.CONTEXT |
classification of the link useful for determining functional behavior |
|
Note
|
Type.java
The possible enum values for value are: CONTEXT.
|
// Defines a menu with elements home and signup
@Menu
private SideMenu sideMenu;
@Model @Getter @Setter
public static class SideMenu {
@Link(url="#")
private String home;
@Link(url="#")
private String signup;
}
|
Tip
|
Decorate complex classes with @Menu to define behavior for child elements (e.g. home and signup in the example above.) |
Modal
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
alias |
String |
Modal |
Y |
Cannot be changed. |
closable |
boolean |
false |
Y |
Specify whether the modal window can be closed. |
context |
ParamContext |
@ParamContext(enabled = true, visible = false) |
N |
Specify the default contextual properties. |
cssClass |
String |
N |
Override default class. |
|
title |
String |
N |
Title for the Modal window. |
|
type |
Type |
Type.dialog |
Y |
Types of modal can be a dialog or a slider. |
width |
String |
500 |
Y |
Width of the modal window |
@Modal
private VMMyTasks vmMyTasks;
|
Note
|
Modal is supported only in a tile |
Setting @Modal to be displayed by default
Modal makes use of @ParamContext to by default render it’s visible property to false during initialization. We can override this functionality by providing our own unique @ParamContext values as a parameter of @Modal.
public static class SampleView { @Modal(context = @ParamContext(enabled=true, visible=true)) private MyModal myModal; public static class MyModal { ... } }
In this example, we are creating a modal myModal who’s visible property will be true on initialization, and hence will be displayed when the corresponding page is rendered.
MultiSelect
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
MultiSelect |
cannot be changed |
labelClass |
String |
anthem-label |
class used to style the picklist label |
postEventOnChange |
boolean |
false |
post the value to the server onblur |
help |
String |
help text that will be displayed in tooltip component |
@MultiSelect
@Model.Param.Values(url="Anthem/fep/icr/p/clientusergroup/_search?fn=lookup&projection.mapsTo=code:id,label:displayName")
@MapsTo.Path(value="/userGroups", colElemPath="/ownerId")
private List<String> userGroups;
MultiGrid
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
MultiGrid |
cannot be changed |
level |
String |
0 |
class used to style the picklist label |
header |
String |
test |
make the component readonly |
cssClass |
String |
question-header |
class used to style the picklist |
postEventOnChange |
boolean |
false |
post the value to the server onblur |
MultiSelectCard
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
MultiSelectCard |
cannot be changed |
@MultiSelectCard @NotNull
@Model.Param.Values(url="~/client/orgname/cmprogram/_search?fn=lookup&projection.mapsTo=code:id,label:programName")
@Path(value="/programReferred", colElemPath="/programName")
private List<String> cmProgramList;
|
Note
|
@NotNull indicates that the component cannot be null. |
Page
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
alias |
String |
Page |
Y |
Cannot be changed. |
title |
String |
N |
Specify the page title to be displayed on top of the page. |
|
cssClass |
String |
Y |
Custom class used to style the page. |
|
defaultPage |
boolean |
false |
Y |
Determine if the page will be the default page. Default page loads first in a flow. |
route |
String |
N |
Specify route of the page. |
|
Note
|
The possible enum values for type are HOME, DETAILS, FORM, STATIC |
@Page(route="cmcaseR/assignmenttaskview", defaultPage=true)
private Page_AssignmentTask pageAssignmentTask;
|
Note
|
defaultPage=true will override the default false value of defaultPage. |
PickList
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
PickList |
cannot be changed |
labelClass |
String |
anthem-label |
class used to style the picklist label |
readOnly |
boolean |
false |
make the component readonly |
cssClass |
String |
class used to style the picklist |
|
postEventOnChange |
boolean |
false |
post the value to the server onblur |
sourceHeader |
String |
SourceList |
specify the source header for the picklist |
targetHeader |
String |
TargetList |
specify the target header for the picklist |
help |
String |
help text that will be displayed in tooltip component |
Radio
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
Radio |
cannot be changed |
labelClass |
String |
anthem-label |
class used to style the radio label |
level |
String |
0 |
determine the level of radio group |
cssClass |
String |
class used to style the radio |
|
postEventOnChange |
boolean |
false |
post the value to the server onblur |
controlId |
String |
currently not in use except for assessments where this signifies the question number |
|
help |
String |
help text that will be displayed in tooltip component |
@Model.Param.Values(url="~/client/orgname/staticCodeValue/_search?fn=lookup&where=staticCodeValue.paramCode.eq('/thisIsParentQuestion14')")
@MapsTo.Path()
@Radio(postEventOnChange=true, controlId = "27")
private String thisIsParentQuestion14;
|
Note
|
postEventOnChange=true will override the default false value of postEventOnChange. controlId is used because in this particular case, there is a question number (27) that is associated with an assessment. Please refer Core Config Annotations section for @MapsTo |
Section
| Name | Type | Default | Description |
|---|---|---|---|
value |
enum |
Type.Default |
section type |
alias |
String |
Section |
cannot be changed |
imgSrc |
String |
source path/ url of the image |
|
cssClass |
String |
class used to style the section |
|
defaultFlow |
String |
flow of the section |
@Section
@Path(linked=false)
private SectionEditGoal sectionEditGoal;
|
Note
|
The possible enum values for size are HEADER, FOOTER, LEFTBAR, RIGHTBAR, BODY, DEFAULT defaultFlow attribute is applicable to section Type.Body only. Please read @Path for more information on @Path. |
StaticText
Directly outputs a raw html content/text value to the view. May use this to bind unsafe HTML directly onto the page. Use wisely.
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
StaticText |
cannot be changed |
controlId |
String |
currently not in use except for assessments where this signifies the question number |
@StaticText
private String description;
SubHeader
A header component intended to flow beneath a parent header.
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
SubHeader |
cannot be changed |
cssClass |
String |
col-sm-6 align-top |
class used to style the component |
TextBox
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
TextBox |
cannot be changed |
hidden |
boolean |
false |
hide/show the component |
readOnly |
boolean |
false |
make the component readonly |
help |
String |
help text that will be displayed in tooltip component |
|
labelClass |
String |
anthem-label |
class used to style the label |
type |
String |
text |
type of input |
postEventOnChange |
boolean |
false |
post the value to the server onblur |
controlId |
String |
currently not in use except for assessments where this signifies the question number |
@TextBox(hidden=true)
private String goalId;
|
Tip
|
In the above example, the default false value of hidden property will be overriden and the textbox will be hidden. Similarly, other properties can be overriden by specifying the properties and its values along with @Textbox. |
TextArea
A text input component that allows for a specified number of rows.
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
TextArea |
cannot be changed |
controlId |
String |
currently not in use except for assessments where this signifies the question number |
|
help |
String |
help text that will be displayed in tooltip component |
|
hidden |
boolean |
false |
hide/show the component |
labelClass |
String |
anthem-label |
class used to style the label |
postEventOnChange |
boolean |
false |
post the value to the server onblur |
readOnly |
boolean |
false |
make the component readonly |
rows |
String |
5 |
type of input |
type |
String |
textarea |
type of input |
@TextArea
private String description;
Tile
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
alias |
String |
Tile |
Y |
Cannot be changed. |
imgSrc |
String |
N |
Source path/ url of the image. |
|
title |
String |
N |
Title displayed on top of the tile. |
|
size |
enum |
Size.Large |
Y |
Size of the tile width on the page. |
@Tile(size=Tile.Size.Large)
private TileEditGoal tileEditGoal;
|
Note
|
The possible enum values for size are XSmall, Small, Medium, Large |
ViewRoot
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
root |
cannot be changed |
layout |
String |
"" |
determine layout of root |
@Domain(value = "cmcaseview", includeListeners={ListenerType.websocket}, lifecycle="cmcaseview")
@MapsTo.Type(CMCase.class)
@Repo(value=Database.rep_none, cache=Cache.rep_device)
@ViewRoot(layout = "caseoverviewlayout")
@Getter @Setter
public class VRCmCase {
}
|
Note
|
layout of caseoverviewlayout is leveraged here. |
Similar to ViewStyle component, ViewParamBehavior component is used to define an ANNOTATION_TYPE level annotation that is used with few view config annotations,
as follows: -
-
@Hints
-
@Initialize
-
@Mode
-
@PageHeader
-
@PageFooter
@Retention(RetentionPolicy.RUNTIME)
@Target(value={ElementType.ANNOTATION_TYPE})
@Inherited
public @interface ViewParamBehavior {
}
Here is an example: -
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
@ViewParamBehavior
public @interface Initialize {
String alias() default "initialize";
}
PageFooter
| Name | Type | Default | Description |
|---|---|---|---|
value |
enum |
Property.Default |
property of PageFooter |
@PageFooter(Property.VERSION)
private String appVersion;
|
Note
|
The possible Property enum values for value are DEFAULT, TOU, VERSION, COPYRIGHT, SSLCERT, PRIVACY |
PageHeader
| Name | Type | Default | Description |
|---|---|---|---|
value |
enum |
Property.Default |
property of PageHeader |
@PageHeader(Property.USERNAME)
private String fullName;
|
Note
|
The possible Property enum values for value are DEFAULT, LOGO, APPTITLE, SUBTITLE, USERNAME, USERROLE, SUBHEADER, MENU |
Initialize
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
initialize |
cannot be changed |
@Section
@Initialize
@Config(url="/vpAdvancedMemberSearch/vtAdvancedMemberSearch/vsMemberSearchCriteria/vfAdvMemberSearch/_process?fn=_setByRule&rule=updateadvmbrsearchcriteria")
private VSMemberSearchCriteria vsMemberSearchCriteria;
Mode
| Name | Type | Default | Description |
|---|---|---|---|
value |
enum |
Options.INHERIT |
OPtions of Mode |
|
Note
|
The possible Property enum values for value are INHERIT, READONLY, HIDDEN |
Hints
| Name | Type | Default | Description |
|---|---|---|---|
value |
enum |
AlignOptions.Inherit |
Align optinons of Hints |
@Link(url="/#/h/cmdashboard/vpDashboard", imgSrc="anthem-rev.svg")
@Hints(AlignOptions.Left)
@PageHeader(Property.LOGO)
private String linkHomeLogo;
|
Note
|
The possible Property enum values for value are INHERIT, LEFT, RIGHT, CENTER |
Similar to ViewStyle component, DomainMeta component is used to define an ANNOTATION_TYPE level annotation that is used with few view config annotations,
as follows: -
-
@ConceptId
@Retention(RetentionPolicy.RUNTIME)
@Target(value={ElementType.ANNOTATION_TYPE})
@Inherited
public @interface DomainMeta {
}
Here is an example: -
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
@DomainMeta
public @interface ConceptId {
String value() default "";
}
ConceptId
| Name | Type | Default | Description |
|---|---|---|---|
value |
String |
"" |
possible value for conceptId |
@TextBox(postEventOnChange = true)
@ConceptId(value = "IOT1.1.1")
@Label(value = "If Other, provide reason")
private String otherReason;
Core Config Annotations
AccessConditional
@AccessConditional allows to control the access of the specific area/functionality within the application based on User’s assigned role(s) and permission(s).
Example:
@AccessConditional(whenAuthorities="?[#this == 'entity_assign'].empty", p=Permission.HIDDEN)
private Section_EntityAssignment vsEntityAssignment;
Above configuration would hide the entity assignment section for user(s) who do not have access to "entity_assign" action.
| Name | Type | Default | Description |
|---|---|---|---|
whenAuthorities |
String |
SpEL (spring expression language) to check for user permissions Recommended |
|
whenRoles |
String |
SpEL (spring expression language) to check for user roles |
|
containsAuthorites |
String[] |
Simple contains check for user permissions. (for more complex conditions, use whenAuthorities) |
|
containsRoles |
String[] |
Simple contains check for user roles. (for more complex conditions, use whenRoles) |
|
Caution
|
whenRoles and containsRoles should be used with caution, since roles may be added/changed more frequently in the application and in that event, you would need to update the entity configurations. |
More Examples:
// vbEntityCreate will be hidden for user(s) who do not have access to "entity_create"
@AccessConditional(whenAuthorities="?[#this == 'entity_create'].empty", p=Permission.HIDDEN)
private Button_EntityCreate vbEntityCreate;
//vsEntityEdit will be hidden for user(s) who do not have access to "entity_create" or "entity_edit"
@AccessConditional(whenAuthorities="?[#this == 'entity_create'].empty && ?[#this == 'entity_edit'].empty", p=Permission.READ)
private Section_EntityEdit vsEntityEdit;
AccessConditionals
@AccessConditionals is a collection of AccessConditional calls.
| Name | Type | Default | Description |
|---|---|---|---|
value |
AccessConditional[] |
@AccessConditionals({
@AccessConditional(whenAuthorities="!?[#this == 'entity_management'].empty || !?[#this == 'entity_create'].empty", p=Permission.READ)
@AccessConditional(whenAuthorities="?[#this == 'entity_management'].empty && ?[#this == 'entity_create'].empty", p=Permission.HIDDEN)
})
private String entity_accessConditionals;
ActivateConditional
Activate Conditional is an extension capability provided by the framework. The annotation is used to conditionally activate/deactivate the param based on a SpEL condition. This annotation can be triggered for multiple events. Framework provides default event handling for this annotation on StateChange and StateLoad.
| Name | Type | Default | Description |
|---|---|---|---|
when |
String |
SpEL based condition to be evaluated relative to param’s state on which this annotation is declared. |
|
targetPath |
String[] |
Path of param to activate when condition is satisfied relative to param on which this annotation is declared. Multiple target paths can be given |
|
inactivateWhen |
String |
emptyString |
SpEL based condition on which param would be inactivated.If value is not overridden, then the negation of ActivateConditional#when() would be used |
@CheckBox(postEventOnChange=true)
@ActivateConditional(when="state != 'true'", targetPath="/../sectionG_skip")
private String skipSectionG;
private sectionG_Skip sectionG_skip;
@Radio(postEventOnChange=true)
@Model.Param.Values(value=YNType.class)
@ActivateConditional(when="state == 'No'", targetPath="/../q3Level2")
private String answerYesOrNo;
private Q3 q3Level2;
@CheckBoxGroup(postEventOnChange=true)
@Model.Param.Values(value=Days.class)
@ActivateConditional(when="state == new String[]{'Sunday'}",targetPath="/../../../sundayDeliverySection")
private String[] deliveryDays;
/*Check if selection contains one or more specific values*/
@CheckBoxGroup(postEventOnChange=true)
@Model.Param.Values(value=Days.class)
@ActivateConditional(when="state != null && state.?[#this=='Sunday'] != new String[]{}",targetPath="/../../../sundayDeliverySection")
private String[] deliveryDays;
@CheckBoxGroup(postEventOnChange=true)
@Model.Param.Values(value=VisitCount.class)
@ActivateConditional(when="state != null && state.length > 2",targetPath="/../../section")
private String[] visits;
Example SpEL expressions:
@ActivateConditional(when="state != null && state.?[#this=='Apple'] != new String[]{}", targetPath = {"/../xyz","/../abc"})
//Contains exactly one single element:
@ActivateConditional(when="state == new String[]{'Apple'}", targetPath = {"/../xyz","/../abc"})
//Evaluate multiple or conditions
@ActivateConditional(when="state!=null && state.?[#this=='Apple' || #this=='Google'] != new String[]{}",targetPath="/../")
ActivateConditionals
@ActivateConditionals is a collection of ActivateConditional calls.
| Name | Type | Default | Description |
|---|---|---|---|
value |
ActivateConditional[] |
@ActivateConditionals({
@ActivateConditional(when="state == 'A'", targetPath="/../q3Level1"),
@ActivateConditional(when="state == 'B'", targetPath="/../q3Level2")
})
private String q3;
private SampleCoreNestedEntity q3Level1;
private SampleCoreNestedEntity q3Level2;
Config
| Name | Type | Default | Description |
|---|---|---|---|
url |
String |
@Config(url="/pageAddEditGoal/tileEditGoal/sectionEditGoal/goalDetailsForm/_nav?pageId=pageCarePlanSummary")
@Button(type = Button.Type.PLAIN)
private String cancel;
A class with @Config annotation is used to perform an action on button click.
In most cases, the action is to retrieve values via HTTP Rest calls
from database (MongoDB), and display on the web page.
In the example shown above, when the button is clicked, the control will be navigated to the specified url.
nav is the http call for navigation.
The possible Actions are: -
-
get for HTTP GET
-
new for HTTP post
-
update for HTTP update
-
delete for HTTP delete
-
search for searching
-
nav for navigation
-
process for custom process/ work-flow definitions
Configs
| Name | Type | Default | Description |
|---|---|---|---|
values |
Config[] |
@Configs({
@Config(url="~/client/org_name/_update"),
@Config(url="~/client/org_name/_process?fn=_set&url=/p/cmcase/_search?fn=query&where=cmcase.patientReferred.firstName.eq('<!/.m/patientReferred/firstName!>').and(cmcase.patientReferred.lastName.eq('<!/.m/patientReferred/lastName!>'))"),
@Config(url="~/client/org_name/_nav?pageId=vpAdvancedCaseSearch")
})
@Button(type=Button.Type.PRIMARY, formReset=false)
private String submit;
@Configs is a collection of configuration calls. Multiple calls to the database
can be made simultaneously using @Configs, where each call will be represented by @Config.
As shown in the example, when the submit button is clicked, three http calls that are being made viz. update, process, and navigation.
ConfigConditional
ConfigConditional is an extension capability provided by the framework. The annotation is used to conditionally execute @Config calls based on a SPel based condition. This annotation can be triggered for multiple events. Framework provides default event handling for this annotation on StateChange.
| Name | Type | Default | Description |
|---|---|---|---|
when |
String |
SpEL based condition to be evaluated relative to param’s state on which this annotation is declared. |
|
config |
Config[] |
emptyString |
Array of @Configs |
@ConfigConditional(
when = "state == 'Completed'", config = {
@Config(url="<!#this!>/../state/_update?rawpayload=\"Closed\""),
@Config(url="/p/dashboard/_get")
})
private String status;
|
Note
|
In the above example , whenever there is statechange of status and the status is changed to Completed, the Configs will be executed. |
ConfigNature
Ignore
Framework persists the data objects of a class in database using @Repo by serializing the class and associating a version number that is called seriaVersionUID. However, if we do not want the framwework to serialize for time being, we can use @Ignore component of ConfigNature class. The following example shows that: -
@Domain(value="patient", includeListeners={ListenerType.persistence})
@Repo(value=Database.rep_mongodb, cache=Cache.rep_device)
@ToString
public class Patient extends IdString {
@Ignore
private static final long serialVersionUID = 1L;
}
Domain
Core Config configuration @Domain annotation persists data.
Core config @Domain will always be followed by @Repo that will specify the way data is persisted.
includeListeners={ListenerType.persistence, ListenerType.update} of @Domain
specifies that the data will be persisted.
value=Database.rep_mongodb of @Repo specifies that a class with
@Domain annotation will use MongoDb for persistence.
@Domain(value="cmcase", includeListeners={ListenerType.persistence, ListenerType.update})
@Repo(value=Database.rep_mongodb, cache=Cache.rep_device)
public class CMCase extends IdString {
}
|
Note
|
Please read @Repo for mroe information regarding @Repo annotation. |
EnableConditional
EnableConditional is an extension capability provided by the framework. The annotation is used to conditionally activate/deactivate the param based on a SpEL condition. This annotation can be triggered for multiple events. Framework provides default event handling for this annotation on StateChange and StateLoad. The difference between this annotation and @ActivateConditional is this annotation only affects the "enabled" state whereas @ActivateConditional affects both "enabled" and "visible" state.
| Name | Type | Default | Description |
|---|---|---|---|
when |
String |
SpEL based condition to be evaluated relative to param’s state on which this annotation is declared. |
|
targetPath |
String[] |
Path of param to enable when condition is satisfied relative to param on which this annotation is declared |
|
disableWhen |
String |
SpEL based condition on which param would be disabled. If value is not overridden, then the negation of EnableConditional#when() would be used |
@EnableConditional(when="state == 'hooli'", targetPath="../enable_p2")
private String enable_p1;
private String enable_p2;
EnableConditionals
@EnableConditionals is a collection of EnableConditional calls.
Exection
Execution is inherited annotation for @Config and @KeyValue. It is not currently being directly used, but is there for hieracrchial purposes.
More documentation will be added here if Execution expands or is directly used.
MapsTo
Path
| Name | Type | Default | Description |
|---|---|---|---|
value |
String |
specify value of Path |
|
colElemPath |
String |
DEFAULT_COL_ELEM_PATH |
specifies column element path |
state |
State |
State.Internal |
specifie path state |
linked |
boolean |
true |
determine if the path has links |
cache |
Cache |
Cache.rep_device |
specifies cache type |
@Path()
private Long version;
Type
| Name | Type | Default | Description |
|---|---|---|---|
value |
class<?> |
||
silent |
boolean |
true |
determines if Type is silent |
@MapsTo.Type(CMCase.class)
public static class SectionEditGoal {
}
|
Note
|
If it is not mapped (@Mapped), an exception will be thrown. If no exception is thrown, defaults to silent. |
Model
Param
| Name | Type | Default | Description |
|---|---|---|---|
value |
Class<? extends Source> |
Source.class |
specify value of Path |
url |
String |
staticCodeValue |
specifies url |
@Model.Param.Values(url="~/client/orgname/staticCodeValue/_search?fn=lookup&where=staticCodeValue.paramCode.eq('/thisIsParentQuestion14')")
@Radio(postEventOnChange=true, controlId = "27")
private String thisIsParentQuestion14;
|
Note
|
The example will retrieve the value of Radio button from the specified url. staticCodeValue is a collection in MongoDB that will be searched and retrieved using @Model annotation. The search criteria is specified using param code thisIsParentQuestion14 |
Text
| Name | Type | Default | Description |
|---|---|---|---|
label |
String |
ParamContext
@ParamContext is used to set the contextual properties of a field during the OnStateLoad event (e.g. visible, enabled).
| Name | Type | Default | Description |
|---|---|---|---|
visible |
boolean |
Whether or not the decorated target should be visible. |
|
enabled |
boolean |
Whether or not the decorated target should be enabled. |
The intent of @ParamContext is to be able to decorate fields to define default contextual behavior. For example:
public static class SampleView {
@TextBox
@ParamContext(enabled=false, visible=false)
private String myTextBox;
}
In this scenario we have configured the contextual values for enabled and visible to be false for myTextBox. These values will be set during the OnStateLoad event and myTextBox consequently will not be enabled or visible when the corresponding page is rendered.
|
Tip
|
@ParamContext can also be defined on annotations. In these scenarios when a field is decorated with that annotation, then the handler for @ParamContext will execute. This may be useful when building a framework extension. |
SearchNature
StartsWith
This component is ued to validate a field. The wilcard attribute determines the validation criteria for a field. This is a server side component.
| Name | Type | Default | Description |
|---|---|---|---|
wildCard |
String |
* |
determines the search criteria |
@NotNull
@StartsWith
@Label(value = "First Name")
private String firstName;
|
Note
|
The example will always search the first name that starts with anything, represented with the default value. A specific search criteria can be specified using wildcard attribute of @StartsWith. |
Repo
| Name | Type | Default | Description |
|---|---|---|---|
alias |
String |
cannot be changed |
|
value |
enum |
specify value of Path |
|
cache |
enum |
Cache.rep_device |
specifies cache type |
autoSave |
boolean |
true |
determine if the autosave is enabled |
|
Note
|
The possible enum values for value are DATABASE.rep_none, DATABASE.rep_rdbms, DATABASE.rep_mongodb, DATABASE.rep_ws The possible enum values for cache are CACHE.rep_none, CACHE.rep_device |
@Repo is used to determine where the data will be persisted. It is always used along with @Domain.
rep_mongodb
The following example shows how data is persisted/ retrieved using MongoDB as a source.
@Domain(value="cmassessment", includeListeners={ListenerType.persistence})
@Repo(alias="cmassessment",value=Database.rep_mongodb, cache=Cache.rep_device)
@Getter @Setter
public class CMAssessment extends IdString {
}
rep_ws
Databse values can be persisted/ retrieved not only using internal MongoDb as a source, we can now use an external web service for the same purpose. All we have to do is create a REST call to a web service that will provide or store the data. Following is an example: -
@Domain(value="ext_client")
@Repo(value=Database.rep_ws, cache=Cache.rep_device)
@Getter @Setter @ToString(callSuper=true)
public class ExtClient {
}
Notice @Repo(value=Database.rep_ws) in the code above. This indicates that it will make use of an external web service call rather than a MongoDb call for ExtClient data objects' persistence/ retrieval purposes.
The advantage of this feature is that now we do not rely on internal source only. This gives us better flexibility and maintainability
Rule
@Rule allows its decorated field a mechanism for triggering one or more rule definitions during its OnStateLoad and OnStateChange events.
@Domain(value="sample_rule_entity", includeListeners={ListenerType.persistence})
@Repo(Database.rep_mongodb)
@Getter @Setter
public class SampleRuleEntity {
// Execute the rule at "rules/sample_increment" during the OnStateLoad and
// OnStateChange events of ruleParam.
@Rule("rules/sample_increment")
private String rule_param;
}
By default, the framework provides support for firing all rules for a given domain entity. That is, for the SampleRuleEntity.java above we might have a rule file defined as sample_rule_entity.drl which will be automatically fired by naming convention.
For cases where additional configuration for other rules is needed, @Rule can be used.
| Name | Type | Default | Description |
|---|---|---|---|
value |
String[] |
rule file path(s) to execute. |
Values
Values provides a mechanism for populating a fields values property. This can be used by a number of components to perform such functions as: define a set of selections for radio buttons and checkboxes, or populating a dropdown list.
| Name | Type | Default | Description |
|---|---|---|---|
value |
Class<? extends Source> |
EMPTY |
Source implementation that returns a list of ParamValues |
url |
String |
url endpoint that returns a list of ParamValues |
|
Note
|
value's default value is EMPTY, which is a simple Source implementation that returns an empty list of ParamValues. |
Source
The Source is a simple abstraction for providing a contract between implementations to provide data to the framework.
Source is exclusively used for @Values.
public static interface Source {
public List<ParamValue> getValues(String paramCode);
}
We can use this to define several different types of values providers. A simple static Source implementation is shown below:
public class SampleStaticSource implements Source {
public List<ParamValue> getValues(String paramCode) {
List<ParamValue> values = new ArrayList();
values.add(new ParamValue("sample.value.1", "Sample Value 1"));
return values;
}
}
Examples
@Values(SampleStaticSource.class)
@CheckBoxGroup
private String petTypes;
In this example, all of the values retrieved from SampleStaticSource.getValues will be displayed as a collection of checkboxes.
@Values(url="CLIENT_ID/ORG/p/staticCodeValue/_search?fn=lookup&where=staticCodeValue.paramCode.eq('/petType')")
@CheckBoxGroup
private String petTypes;
In this example, all of the values retrieved from the url defined in @Values will be displayed as a collection of checkboxes.
ValuesConditional
ValuesConditional is an extension capability provided by the framework. The annotation is used to conditionally set the @Values configuration for a dependent field based on a SpEL condition. This annotation can be triggered for multiple events. Framework provides default event handling for this annotation on StateChange and StateLoad.
| Name | Type | Default | Description |
|---|---|---|---|
target |
String |
The target path relative to the this annotated field to update. |
|
condition |
Condition[] |
An array of conditional metadata that is responsible for determining whether or not the target field will be updated. |
|
resetOnChange |
boolean |
true |
When true and the associated when expression evaluates to true, the state of target will be set to null. When false and the associated when expression evaluates to true, the state of target will be set to null only when the previously existing target's state does not exist in the then's @Values property. Otherwise, the existing state will be preserved. |
exclusive |
boolean |
true |
Configures whether or not the first truthy condition should be exclusive. If true, then only the first truthy condition will be executed. If false then all truthy conditions will be executed. the default value is true. |
| Name | Type | Default | Description |
|---|---|---|---|
when |
String |
SpEL based condition to be evaluated relative to param’s state on which this annotation is declared. |
|
then |
Values |
Values configuration to be applied to the param identified by the target path when this condition’s when clause is found to be true. |
Consider the following sample defined Values:
// Sample Values Implementations
public static class SRC_FOODS_ALL implements Source {
@Override
public List<ParamValue> getValues(String paramCode) {
final List<ParamValue> values = new ArrayList<>();
values.add(new ParamValue("Generic Food 1", "Generic Food 1"));
values.add(new ParamValue("Generic Food 2", "Generic Food 2"));
return values;
}
}
public static class SRC_FOODS_DOG implements Source {
@Override
public List<ParamValue> getValues(String paramCode) {
final List<ParamValue> values = new ArrayList<>();
values.add(new ParamValue("Dog Food 1", "Dog Food 1"));
return values;
}
}
public static class SRC_FOODS_CAT implements Source {
@Override
public List<ParamValue> getValues(String paramCode) {
final List<ParamValue> values = new ArrayList<>();
values.add(new ParamValue("Cat Food 1", "Cat Food 1"));
return values;
}
}
Given a defined set of Values that we can assign using the @Values annotation, we can explicitly define conditions to set a dependent field’s values.
@Model
@Getter @Setter
public static class StatusForm {
@ValuesConditional(target = "../petFoodSelection", condition = {
@Condition(when = "state=='dog'", then = @Values(SRC_FOODS_DOG.class)),
@Condition(when = "state=='cat'", then = @Values(SRC_FOODS_CAT.class)),
}
)
@TextBox(postEventOnChange = true)
private String petType;
@Radio
@Values(SRC_FOODS_ALL.class)
private String petFoodSelection;
}
In this example, petType is the field and petFoodSelection is the dependent field. We set petFoodSelection to contain the defaults ["Generic Food 1", "Generic Food 2"] initially and conditionally define those values when petType's state is "dog" or "cat".
When the state of petType is "dog", then the Values for petFoodSelection will be ["Dog Food 1"]. Similarly when the state of petType is "cat", then the Values for petFoodSelection will be ["Cat Food 1"].
Conceptually speaking, we are pushing the updates of Values to the dependent field whenever the state of the annotated field loads or is changed.
ValuesConditionals
@ValuesConditionals is a collection of ValuesConditional calls.
The framework has the capability for a field to define ValuesConditional to affect multiple dependent fields.
| Name | Type | Default | Description |
|---|---|---|---|
value |
ValuesConditional[] |
@Model
@Getter @Setter
public static class StatusForm {
@ValuesConditionals({
@ValuesConditional(target = "../petFoodSelection", condition = {
@Condition(when = "state=='dog'", then = @Values(SRC_FOODS_DOG.class)),
@Condition(when = "state=='cat'", then = @Values(SRC_FOODS_CAT.class)),
}
),
@ValuesConditional(target = "../petFoodSelection2", condition = {
@Condition(when = "state=='dog'", then = @Values(SRC_FOODS_DOG.class)),
}
)
})
@TextBox(postEventOnChange = true)
private String petType;
@Radio
@Values(SRC_FOODS_ALL.class)
private String petFoodSelection;
@Radio
private String petFoodSelection2;
}
In this example, we have two dependent fields: petFoodSelection and petFoodSelection2. Note that nothing has changed for the petFoodSelection field from the previous example, but we have set a @ValuesConditional for the dependent field petFoodSelection2 that when the state of status is "dog", the Values of petFoodSelection2 will be ["Dog Food 1"].
View Component(s)
Tooltip
This is a new custom component that is added in the framework to provide additional information about all the input fields that are used within the application. The input fields are the fields that require user selection like textbox, textarea, combobox, checkbox, input date etc. In order to create a tooltip component for a particular field, all that is required is to add a help attribute in the field configuration. Please look at the following example: -
@Radio(postEventOnChange = true, help="This field requires a value for pet type")
private String petType;
|
Note
|
The tooltip component will be created for this field and will display the specified value in the help field. |
UI Validation
JSR Annotations
Support has been added for JSR 303 type annotations. All annotations inheriting from javax.validation.Constraint will be picked up and added to a configured parameter’s configuraton.
Specific support within the UI has been added for the following javax.validation annotations
| Name | Description |
|---|---|
@NotNull |
Requires that a field should not have a null value. |
@Pattern |
Requires that a field follow a specific regex pattern. |
@Min |
Requires that a minimum value should be provided. |
@Max |
Requires that a maximum value should be provided. |
@Size |
Requires that a specific range should be provided. Useful for component groups. |
Special Considerations
-
When used in conjunction with @CheckBoxGroup, @Size will require the given number (min) of checkboxes to be selected or will limit the given number (max) of checkboxes that are able to be selected.
Custom Messages
The framework has the ability to pass custom validation messages from within JSR Annotations to the UI.
@NotNull(message = "First name should not be empty.")
private String status;
Here, if the UI field 'status' is left blank by the user, "First name should not be empty" message would be displayed. @NotNull will just display the default message.
Layout Configuration
As you can see in the screenshot above, the layout of the application is divided into 3 sections viz. Header, Footer, and Leftbar. Please read the code below to understand the way the sections has been created.
public static class VPHome {
@Section(Type.HEADER)
private VSHomeHeader vsHomeHeader;
@Section(Type.LEFTBAR)
private VSHomeLeftBar vsHomeLeftBar;
@Section(Type.FOOTER)
private VSHomeFooter vsHomeFooter;
}
|
Note
|
@Section(Type.value) determines the section on the page. This code shows three of the type values for @Section. For more values, please refer to the @Section annotation within View Config Annotations. |
Collection Configuration
Collection configuration is introduced in the framework to eliminate the creation and use of different functional handlers for adding, editing and deleting elements from/ to a collection. This structure now gives us the ability to work on any of these functions on any of the elements from a collection at any given time.
This configuration is explained using a use case of a Car. A user might want to see a Car home page that has list of cars. User may be able to add, edit, or delete cars and also view properties of car. The first step is to create a core domain entity.
@Domain(value="Car", includeListeners={ListenerType.persistence})
@Repo(Database.rep_mongodb)
@Getter @Setter
public class CarEntity extends IdString {
private String attr_String;
private int attr_int;
private Integer attr_Integer;
private CarNestedEntity attr_CarNestedEntity;
private List<CarNestedEntity> attr_list_2_CarNestedEntity;
}
This configuration provides us with the flexibility such that we can define a custom set of car features to be displayed. The features are defined in the nested entity as shown in the code below: -
@Model
@Getter @Setter
public class CarNestedEntity {
private String car_name;
}
The following class defines the home page that will show a list of cars. Notice the way in which the nested entities are mapped to its property.
@MapsTo.Type(CarEntity.class)
@Getter @Setter
public class VPCarHome {
@Tile(title="Car Home", size=Tile.Size.Large)
private TileBlue tile;
@MapsTo.Type(CarEntity.class)
@Getter @Setter
public static class TileBlue {
// add new Nested Entity
@Configs(
@Config(url="/page_red/tile/vt_attached_convertedNestedEntity/_get?fn=param&expr=assignMapsTo('../.m/attr_list_2_CarNestedEntity')")
)
private String addButton;
// view/edit mapped collection to core
@Path(value="/attr_list_2_CarNestedEntity")
private List<Section_ConvertedNestedEntity> vm_attached_convertedList;
}
@MapsTo.Type(CarNestedEntity.class)
@Getter @Setter
public static class Section_ConvertedNestedEntity {
// assigning collection element of core to Form
@Configs(
@Config(url="/page_red/tile/vt_attached_convertedNestedEntity/_get?fn=param&expr=assignMapsTo('/.d/<!#this!>/../.m')")
)
private String editButton;
@Path("/car_name")
private String vm_car_name;
}
}
As you can see, when you click on addButton, the config url will follow the domain model path until the form view where a user can save the new car (nested entity), and then switch from view config to core config using .m to assign a new car to attr_list_2_CarNestedEntity list. The Section_ConvertedNestedEntity is a nested entity that is used to view/ edit collection that is mapped to core, using edit button and vm_car_name respectively. The edit button that has a config url that will be resolved in a similar way to that of add button, however, as you can see, there is a .d that signifies the mapping to the core domain model i.e. it will point to the root which is CarEntity.
@MapsTo.Type(CarEntity.class)
@Getter @Setter
public class VPCarDetails {
@Tile(title="Car Details", size=Tile.Size.Large)
private TileRed tile;
@MapsTo.Type(CarEntity.class)
@Getter @Setter
public static class TileRed {
@Path(value="/attr_list_2_CarNestedEntity", nature=Nature.TransientColElem)
private Form_ConvertedNestedEntity vt_attached_convertedNestedEntity;
}
@MapsTo.Type(CarNestedEntity.class)
@Getter @Setter
public static class Form_ConvertedNestedEntity {
@Configs(
@Config(url="<!#this!>/../_update")
)
private String saveButton;
@Configs({
@Config(url="<!#this!>/../.m/_delete"),
@Config(url="<!#this!>/../_get?fn=param&expr=unassignMapsTo()")
})
private String deleteButton;
@Path("/car_name")
private String vt_car_name;
}
}
This is the car details page that will be displayed when user clicks on add/ edit button from the Home page. This is used to create another nested entity, however, please notice nature=Nature.TransientColElem. This property is used to determine that Form_ConvertedNestedEntity have transient relationship with the Car (core entity).
Hence, by using the collection configuration, we can eliminate the use of add/edit/delete custom functional handlers to perform add/edit/delete functions respectively.
Rule Configuration
Framework comes with support for Drools Rules (https://www.drools.org/) engine out of the box. The rules can be defined at multiple levels.
-
Entity Level: Rules defined at the entity level gets triggered everytime the entity is updated. Typically business rules that manage the entity state would be defined at this level. The framework would pick any rule with the extension <domainalias>.drl and associate with the entity updates. The rule would have access to the entity domain that it is being executed.
-
Function Handler Level: Business rules that can span across multiple entities or needs to be controlled based on business flow rather than everytime entity is updated can be configured using Function handler. Please refer to the Function Handler documentation for more information on configuring these rules.
-
Attribute Level: Activation and deactivation at attribute level based on certain conditions can be handled using @ActivateConditional annotation. Please refer to the ActivateConditional documentation for more information.
-
Configuration Level: Individual fields can be annotated with @Rule so that a particular rules file(s) will be executed. Please refer to the Rule documentation for more information.
Audit
When a leafParam is annotated with @Audit, based on the event handler defined for the annotation, the audit history is created for that particular leafParam. By default, the @Audit functionality is invoked for OnStateChange event handlers.
Usage : @Audit(AuditHistory.class)
@Audit(SampleCarAuditEntry.class)
private String audit_String;
@Audit(SampleCarAuditEntry.class)
private Integer audit_Integer;
@Audit(SampleCarAuditEntry.class)
private String unmapped_String;
@Audit(SampleCarAuditEntry.class)
@Path
private String audit_String; // mapped and marked with Audit on both view & core
@Audit(SampleViewCarAuditEntry.class)
private String unmapped_String; // unmapped and marked with Audit on a quad with persistent core
@Path
private Integer audit_Integer; // mapped view to a core which is annotated with Audit
As you can see @Audit can be annotated on both view and core entities.
Process Configuration
Business Process Configuration
Activiti BPM engine (https://www.activiti.org/) is currently integrated out of the box with the framework. All standard BPM functions are available for creating business processes. Business process can be defined to manage business entity lifecycle and for creation of stateless processes that executes complex business functions.
Entity Lifecyle Management using BPM
The framework provides the ability to back a business or view entity using a workflow. There might be scenarios where an entity needs to traverse through a series of business steps. Having a BPM defined through standard BPMN construct can help with configuring the business steps and will also provide a visual depiction of the bsuiness configuration.
Associating a workflow with an entity
Lets take the example domain named UmCaseFlow with an alias "umcaseview".
@Domain(value="umcaseview", includeListeners={ListenerType.websocket}, lifecycle ="umcaseview")
@MapsTo.Type(UMCase.class)
@Repo(value=Database.rep_none)//default cache is repo_session
@Getter @Setter
public class UmCaseFlow {
@Page(route="umCaseR", defaultPage=true)
private PageUMCaseCreateMember pageCreateMember;
@Page(route="umCaseR")
private PageUMCaseCreateProvider pageCreateProvider;
@Page(route="umCaseR")
private PageUMCaseCreateCaseInfo pageCreateCaseInfo;
}
@Domain Annotation takes a "lifecyle" attribute. The attribute value represents the process id of the BPMN backing the entity. The bpmn execution has access to the ProcesEngineContext through the key
Stateless Business Function implementation using BPM
BPMN provides a strong visual and expression syntax for configuring business processes. It might not be always associated with an entity lifecyle. If there is a need to execute a statless BPM as a function.
-
Steps for configuring a BPMN process as a function
-
Create a BPMN process with a unique process id
-
Define the config url with action as _process,fn as _bpm and processId as the name of the process id. Example @Config(url="/p/patient:<!/.m/id!>/_process?fn=_bpm&processId=createcaseforpatient")
-
Function Handlers
Function Handlers are an abstraction within the framework to execute a common set of instructions for a given Action.
Given an action, a particular function handler can be executed by specifying a value for the query parameter fn.
@Config(url="/p/patient:<!/.m/id!>/_process?fn=_set")
In the example above, process is the Action and set is the Function Handler we have configured to execute as a part of this @Config configuration.
Predefined Function Handlers
There are several default function handlers defined within the core framework to handle common framework instructions, such as setting the state of a parameter (set) or adding a parameter value into a collection (add).
The following function handlers are provided out-of-the-box:
| Handler | Action | Description |
|---|---|---|
_param |
_get |
|
_default |
_nav |
|
_initEntity |
_new |
|
_add |
_process |
Adds parameter value to a collection. |
_addCollection |
_process |
|
_bpm |
_process |
Invokes a statless bpm process. |
_eval |
_process |
|
_set |
_process |
Sets parameter value. |
_setByRule |
_process |
Set parameter value through a rule. |
_example |
_search |
|
_lookup |
_search |
|
_query |
_search |
Custom Function Handlers
The framework provides the ability to users to define custom function handlers.
To create a custom function handler, create a @Bean to be injected in the spring context which implements FunctionHandler class from the framework. Below are two samples for creating custom handlers.
@Configuration
public class PetClinicExtensionConfig {
@Bean(name="default._process$execute?fn=_custom")
public CustomFunctionHandler<?,?> setCustomFunctionHandler(BeanResolverStrategy beanResolver) {
return new CustomFunctionHandler<>(beanResolver);
}
@Bean(name="petclinic._process$execute?fn=_setByRule")
public SetByRuleFunctionHandler<?,?> setByRuleFunctionHandler() {
return new SetByRuleFunctionHandler<>();
}
}
Custom implementation example:
public class CustomFunctionHandler<T,S> implements FunctionHandler<T,S> {
public CustomFunctionHandler(BeanResolverStrategy beanResolver) {}
@Override
public S execute(ExecutionContext eCtx, Param<T> actionParameter) {
/**
* Add custom function handler logic here
**/
return null;
}
}
Usage: @Config(url="/vpOwners/vtOwners/vsSearchOwnerCriteria/vfSearchOwnerCriteria/vbgSearchOwner/\_process?fn=\_custom")
-
Naming convention for the bean name should to be followed for the custom function handler to be recognized by the framework - <default>.\_process$execute?fn
-
<default> is used for the default implementation of framework. It can be overwritten by specific implementations of the function handler by replacing <default> with ex. petclinic
Nimbus Search Filtering
Nimbus uses query dsl syntax to construct filtering queries. The framework uses groovy parser to parse the criteria and replace with the required domain name from the library.
Usage Examples
Lets take the example domain named Test with an alias "testdsl".
@Getter @Setter
@Domain("testdsl")
@Repo(Database.rep_mongodb)
@Execution.Input.Default
@Execution.Output.Default
@ToString
public class Test extends IdString{
@Ignore
private static final long serialVersionUID = 1L;
private String name;
private Integer age;
private LocalDate startDate;
}
Criteria
If the requirement is to search for all records that have age between 18 and 21, the criteria will be as below
&criteria=testdsl.age.between(1,11)
The &criteria above denotes a query parameter that will be part of a service task in the BPMN as shown in the below example.
If the requirement is to search for records those have names beginning with 'a' and age between 18 and 21, the criteria is as below
&criteria=testdsl.age.between(18,21).and(testdsl.name.startsWith('a'))
If the requirement is to search for records those have names beginning with 'a' or age between 18 and 21, the criteria is as below
&criteria=testdsl.age.between(18,21).or(testdsl.name.startsWith('a'))
If the requirement is to search for records that have a start date as today’s date, the criteria is as below
&criteria=testdsl.startDate.eq(todaydate)
Please note that 'todaydate' is a keyword that is used by framework’s groovy parser to parse it to actual date.
Projection
The framework provides for support for certain projections. If the requirement is to fetch the count of all records
If the requirement is to get the count of records that have a start date as today’s date, the criteria is as below
&criteria=testdsl.startDate.eq(todaydate)&projection=count


Preparation time
30 mins to 1 hour
Cooking time
10 to 30 mins
Serves
Serves 4
Pat the duck breasts dry and place them in a shallow dish.
Peel the lemons with a potato peeler so you get ringlets of lemon zest, then squeeze the juice from them.
Scatter the lemon ringlets over the duck pour over the juice and limoncello and leave to marinate for about 30 minutes.
Remove the duck from the marinade, dry on kitchen paper and season well all over with salt and pepper. Do not discard the marinade.
Clarify the butter in a large frying pan by letting it melt, then when it begins to foam, carefully lifting off the foam with a tablespoon, leaving just the clear, golden liquid. Add the olive oil.
When it is hot, place the duck breasts in the pan, skin-side down, and seal well on both sides.
Reduce the heat and cook for about 12 minutes, turning the duck over from time to time. This will give you medium-cooked duck, which I think is ideal for this dish.
Now turn the heat up high, pour in the marinade and let it evaporate, turning the duck over and giving the pan a shake from time to time - this will help the sauce thicken.
As soon as the sauce has thickened, remove the pan from the heat and place the duck breasts on a chopping board. Leave to rest for about five minutes, then cut them into slices, arrange on four plates or one serving dish and pour over the sauce.
To make the carrot and celeriac mash, boil the vegetables and strain off the liquid using a piece of muslin.
Return to the pan, season with salt and pepper and a drizzle of olive oil, and puree with a hand blender.
Serve with the limoncello duck.


Village loses 13 in tanker tragedy
Disaster at night:
All the victims who were siphoning fuel
from accident
truck at Malanga
trading
centre on Kisumu-Busia highway on Saturday night knew one another
PAGE
5
James Omollo, who was injured in the Malanga fuel tanker tragedy, speaks from his
hospital
bed
in Yala sub-county hospital LEFT Villagers mingle around the charred remains of a lorry
involved
in the fire accident. PD/VIOLA KOSOME


Automated testing is a great way to ensure that code being maintained works. The Extreme Programming (XP) methodology relies heavily on it, and practitioners have available to them a range of testing frameworks, most of which work by making direct calls to the code being tested. But what if you want to test a web application? Or what if you simply want to use a web-site as part of a distributed application?
In either case, you need to be able to bypass the browser and access your site from a program. HttpUnit makes this easy. Written in Java, HttpUnit emulates the relevant portions of browser behavior, including form submission, JavaScript, basic http authentication, cookies and automatic page redirection, and allows Java test code to examine returned pages either as text, an XML DOM, or containers of forms, tables, and links. When combined with a framework such as JUnit, it is fairly easy to write tests that very quickly verify the functioning of a web site.
The same techniques used to test web sites can be used to test and develop servlets without a servlet container using ServletUnit, included in the download.