Sunday, September 27, 2009

XSD

The projects I have worked on and continue to work on, aren't typically standalone. They tend to use inter organization projects, some written in different language and hosted in different environments.

For the brief reasons above, there is always a need data exchange in a standard format. I have used xsd to define structure of the xml documents my projects will be exchanging.

Extensively used XSD.

Experienced also with XSL (styled document for document(xml) output, voice or print output)


Please ask for more about my experience in document interchange and technologies along these lines visa email or phone call,

Thanks for reading,

~Nirmal

Thursday, September 24, 2009

velocity template engine using java objects


Velocity is a Java based template engine.It permits anyone to use a simple yet powerful template language to reference objects defined in Java code.


An alternative to JSP and PHP, and few others. Velocity framework can be used in following areas:- Web apps, dynamic HTML pages are created and processed with VelocityViewServlet or number of frameworks that support Velocity - Source code generation- Automatic e-mails- XML transformation, provides an ant task called Anakia which reads an XML file and makes it available to a Velocity template. What are the features of Velocity?Velocity framework has following features:- Velocity is MVC based- It segregates html template code from Java code- It emphasizes on role based web app development - Velocity offers better maintainable web applications.


Here is a little description of how it could be used:


Problem(2 parts):
 
1. I have a block of text inside a String. I need to be able to apply certain substituions and insertions based on pattern matches.  Example, blah blah blah SUBJECT blah blah - needs to be blah blah blah <color=red>SUBJECT</color> blah blah  

2. The substituion/insertion data needs to be stored externally so it can be changed.
 
Is velocity a good match for this, or should I just store Pattern strings in a database table?

Solutions Exploration:


Velocity is easy to use. You simply use template markers in the prototype text. For example:
 
        blah blah blah $SUBJECT blah blah
 
You populate the VelocityContext (essentially a dictionary) with replacement values. In your case, these would come from a config file.
 
Velocity is more interesting when you use it with objects. For example, at the key 'colorUtil' you might put an object (of your design) which builds color tags. Your template might then look something like:
 

        blah blah blah $colorUtil.red($SUBJECT) blah blah

-----------------------------------------------

I have used velocity extensively when I worked on an adapter's FCIF work.  But, that's about it. Everything was straight pojo field mapping to same named property in the template with a dollar sign in front.  The colorUtil looks way cool, but it still operates on the premise that SUBJECT is a property not literal text, correct?


-----------------------------------------------


For literal text, this should work:
 
 blah blah blah $colorUtil.red('SUBJECT') blah blah
 

--Thanks for reading,

Sunday, September 20, 2009

xwork/WebWork

Used XWork with Struts 2 actions to program actions.

Interceptors were used profusely in my project. Intercept stack were configured in a xml file.

The real use of abundant memory these days is great for the fact that the entire stack of intercepts are loaded at the start so the entire process is very quick.  

--ask me for more details.


XWork 2.1.4 offers users a powerful command-pattern framework that is used to power Struts 2. Users can define action classes by using an Action interface, then XWork will setup and run the users actions. XWork provides an Inversion of Control container, a powerful expression language, data type conversion, validation, and pluggable configuration. XWork is most widely known from the web MVC framework called Webwork.

Major Features

  1. Flexible and customizable configuration based on a simple Configuration interface, allowing you to use XML , programmatic, or even product-integrated configuration
  2. Core command pattern framework which can be customized and extended through the use of interceptors to fit any request / response environment
  3. Built in type conversion and action property validation using OGNL
  4. Powerful validation framework based on runtime attributes and a validation interceptor

Thursday, September 10, 2009

google-gson

gson-1.3.jar

Java object to JSON and vice versa.