|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.eng.spagobi.utilities.BIObjectValidator
public class BIObjectValidator
This class has been rewritten starting from the it.eng.spago.validation.Validation
while are needed more functionality like:
1) In SpagoBI the validator must be able to read rules generated dinamically at runtime.
2)The validation rules must be expressed in a different format than in Spago, while in Spago two or more validator rules are grouped at the same time:a combination of two or more rules at the same time is difficult to generate dinamically.
Field Summary | |
---|---|
private java.lang.String |
_serviceName
|
private java.lang.String |
_serviceType
|
private it.eng.spago.base.SourceBean |
_serviceValidations
|
private it.eng.spago.base.SourceBean |
_validationStructure
|
private static java.lang.String |
ALPHANUMERIC_STRING_REGEXP
|
static int |
ERROR_ALFANUMERIC
|
static int |
ERROR_DATE
|
static int |
ERROR_DECIMALS
|
static int |
ERROR_EMAIL
|
static int |
ERROR_FISCALCODE
|
static int |
ERROR_GENERIC
|
static int |
ERROR_LETTERSTRING
|
static int |
ERROR_MANDATORY
|
static int |
ERROR_MAXLENGTH
|
static int |
ERROR_MINLENGTH
|
static int |
ERROR_NUMERIC
|
static int |
ERROR_RANGE
|
static int |
ERROR_REGEXP
|
static int |
ERROR_URL
|
private static java.lang.String |
FISCAL_CODE_REGEXP
|
private static java.lang.String |
LETTER_STRING_REGEXP
|
static java.lang.String |
NAME_ATTRIBUTE
|
static java.lang.String |
TOUPPERCASE_ATTRIBUTE
|
Constructor Summary | |
---|---|
BIObjectValidator(java.lang.String serviceName,
java.lang.String serviceType)
Thise method is called everyTime a service with label serviceName
is called, if the service validator is configured correctly into the validator.xml
configuration file. |
Method Summary | |
---|---|
private void |
automaticValidation(it.eng.spago.base.SourceBean serviceRequest,
it.eng.spago.error.EMFErrorHandler errorHandler)
For each input field type (Numeric, URL, extc:), this method applies validation. |
boolean |
isBlocking()
A method which says if a validator has blocking properties. |
private void |
structure(it.eng.spago.base.SourceBean serviceRequest)
|
boolean |
validate(it.eng.spago.base.RequestContainer requestContainer,
it.eng.spago.base.ResponseContainer responseContainer,
it.eng.spago.base.SourceBean _serviceValidations)
From the request and response container this method controls if validation conditions declarated into the validator.xml> file are verifyed, and, if yes, acknowledge
to start validation control. |
private boolean |
validateService(it.eng.spago.base.RequestContainer requestContainer,
it.eng.spago.base.ResponseContainer responseContainer)
When the validation is started, if a control has generated errors, this method interrupts validation without going on with other controls. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String _serviceName
private java.lang.String _serviceType
private it.eng.spago.base.SourceBean _serviceValidations
private it.eng.spago.base.SourceBean _validationStructure
public static final java.lang.String NAME_ATTRIBUTE
public static final java.lang.String TOUPPERCASE_ATTRIBUTE
public static final int ERROR_GENERIC
public static final int ERROR_MANDATORY
public static final int ERROR_LETTERSTRING
public static final int ERROR_ALFANUMERIC
public static final int ERROR_NUMERIC
public static final int ERROR_EMAIL
public static final int ERROR_FISCALCODE
public static final int ERROR_DECIMALS
public static final int ERROR_RANGE
public static final int ERROR_MAXLENGTH
public static final int ERROR_MINLENGTH
public static final int ERROR_REGEXP
public static final int ERROR_DATE
public static final int ERROR_URL
private static final java.lang.String LETTER_STRING_REGEXP
private static final java.lang.String FISCAL_CODE_REGEXP
private static final java.lang.String ALPHANUMERIC_STRING_REGEXP
Constructor Detail |
---|
public BIObjectValidator(java.lang.String serviceName, java.lang.String serviceType)
serviceName
is called, if the service validator is configured correctly into the validator.xml
configuration file. It starts the validation procedure.
serviceName
- The name of the serviceserviceType
- The type of the service (PAGE; ACTION)Method Detail |
---|
public boolean validate(it.eng.spago.base.RequestContainer requestContainer, it.eng.spago.base.ResponseContainer responseContainer, it.eng.spago.base.SourceBean _serviceValidations) throws java.lang.Exception
validator.xml>
file are verifyed, and, if yes, acknowledge
to start validation control. It has been adapted for BI object validation, while
in this case we pass some important validation information through an input Source Bean.
requestContainer
- The input request containerresponseContainer
- The input response container_serviceValidations
- The input validations Source Bean
java.lang.Exception
- if an exception occurs.private void structure(it.eng.spago.base.SourceBean serviceRequest) throws java.lang.Exception
serviceRequest
-
java.lang.Exception
- Applica le eventuali regole TOUPPERCASE e il TRIM e eventualmente fa delle
elaborazioni sulle liste ( campi multivalore )public boolean isBlocking()
private boolean validateService(it.eng.spago.base.RequestContainer requestContainer, it.eng.spago.base.ResponseContainer responseContainer) throws java.lang.Exception
requestContainer
- The input request containerresponseContainer
- The input response container
java.lang.Exception
- If any exception occurredprivate void automaticValidation(it.eng.spago.base.SourceBean serviceRequest, it.eng.spago.error.EMFErrorHandler errorHandler) throws java.lang.Exception
errorHandler
errors stack.
The field label to be displayed is defined in file validation.xml for each
validation: if it is not defined it is set with the field name; if it starts with
"#" it is interpreted as a key and the message is recovered by
PortletUtilities.getMessage(key, "messages") method, else it remains unchanged.
serviceRequest
- The request Source BeanerrorHandler
- The errors Stack
java.lang.Exception
- If any exception occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |