[ 
https://issues.apache.org/jira/browse/VALIDATOR-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530484
 ] 

bhupeshnaik edited comment on VALIDATOR-237 at 9/26/07 10:36 PM:
------------------------------------------------------------------

Hello,

I have attached a sample project (of eclipse) that uses the action framework 
for validation and as well as transformation. I have also sent some source code 
that is relevant.

Currently the action framework extends the validation framework classes; the 
idea is to have these as base classes above validation classes.

Have a look at the xml files in \test.actionframework\src\config\ they have 
modified xml structure (generic to action framework) with no special validation 
specific tags.

You will get an idea when you see the example.

The attached is an eclipse project, you will have to add a variable in eclipse 
to point to \test.actionframework (Project Folder)\lib. This contains the jars 
it is referring to. The system jars are from our project and has lot more than 
what is relevant here; hence I have given source code of only the relevant 
stuff.

Platform tested, Windows XP, Eclipse 3.3.0, JDK 1.5

With this action framework as base, I am working on creating the action 
executors that can be used in setting styles for UI controls.

When you run the application, the console will display sax parser errors for 
the xml structure. Please ignore the same. The console will display the 
following data, it may get hide in the sax error.

---------- Apache Validator used as < Transformation > framework Ignoring 
missing bean descriptor - /config/elixir/common/bean-descriptor.xml
Date Format Result: Source Value:24-09-2007, transformed value:24th Jan 2007 
Substring Result :  Source Value:FIRSTSECOND, transformed value:SECOND
----------- Transformation  END -------------------------


----------- Apache Validator used as < Validation > framework 
customer.firstname : Source Value:SteveNotNull, validation result:true 
customer.email :  Source Value:[EMAIL PROTECTED], validation result:false
----------- Validation  END -------------------------

Thanks & Regards,

Bhupesh 




  
> Abstract Validation framework to Actions framework.
> ---------------------------------------------------
>
>                 Key: VALIDATOR-237
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-237
>             Project: Commons Validator
>          Issue Type: New Feature
>          Components: Framework
>    Affects Versions: 1.4
>         Environment: All
>            Reporter: Bhupesh Naik
>            Priority: Minor
>         Attachments: test.actionframework.zip
>
>
> Apache Commons validator can be ABSTRACTED to a common framework called 
> ACTIONS framework.
>  
> The Actions framework will act in similar manner as validation framework but 
> will be independent of the way in which actions are execute on the value.
>  
> Abstraction points.
> 1.Validation can be treated as any action
> 2.The value to be validated is treated as source value
> 3.The return value true/false can be treated as a target value
> 4.Source Value ---pass to--- > list of actions to be executed ----results 
> in---> Target Value
>  
> We have already done this in our enterprise product, we use apache validation 
> framework even for transforming values in our custom ETL framework.
>  
> Once the apache validator is abstracted as actions framework one can use the 
> same to not only validate the source value but to transform the value or even 
> in describing and modifying styles of controls in UI and much more. The 
> advantage here is we use the same digester , loading of elements, extending 
> forms and stuff, this code remains common.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to