Pages

Friday, 4 October 2013

Example of mail merge generating multiple files.

Example of mail merge (Dependency Example) generating different files using RTFTemplate library.


  • Add required JARS in class path.
  •  Required JARS:  
       
     rtftemplate-1.0.1-b14.jar  
     commons-collections-3.2.1.jar  
     spring-beans-3.2.2.RELEASE.jar  
     spring-context-3.2.2.RELEASE.jar  
     spring-context-support-3.2.2.RELEASE.jar  
     spring-core-3.2.2.RELEASE.jar  
     spring-expression-3.2.2.RELEASE.jar  
     spring-jdbc-3.2.2.RELEASE.jar  
     spring-orm-3.2.2.RELEASE.jar  
     spring-tx-3.2.2.RELEASE.jar  
     xml-apis-1.0.b2.jar  
     commons-logging-1.1.1.jar  
     freemarker.jar  
     commons-digester-2.1.jar  
     org.apache.commons.beanutils.jar  
     velocity-1.7.jar  
     commons-lang.jar  
    


References:-
http://sourceforge.net/projects/rtftemplate/

http://rtftemplate.sourceforge.net/

Thursday, 3 October 2013

Example of mail Merging

Example of mail Merging (Address Example) using RTFTemplate library.


  • Add required JARS in class path.
  •  Required JAR:  
       
     commons-collections-3.2.1.jar  
     commons-digester-2.1.jar  
     commons-lang.jar  
     commons-logging-1.1.1.jar  
     freemarker.jar  
     org.apache.commons.beanutils.jar  
     rtftemplate-1.0.1-b14.jar  
     spring-beans-3.2.2.RELEASE.jar  
     spring-context-3.2.2.RELEASE.jar  
     spring-context-support-3.2.2.RELEASE.jar  
     spring-core-3.2.2.RELEASE.jar  
     spring-expression-3.2.2.RELEASE.jar  
     spring-tx-3.2.2.RELEASE.jar  
     velocity-1.7.jar  
     xml-apis-1.0.b2.jar  
    
  • Download the RTF sample and Template file in rtf format.
  • Add the required classes.

Wednesday, 4 September 2013

Mail merge functionality using RTF template file.

Overview

RTFTemplate is RTF engine RTF to RTF, which is able to generate RTF by merging template RTF (model RTF  source) with JAVA object (context). RTFTemplate use Velocity for  merging template  with JAVA object.

Steps to Merge RTF template and Java Context:


  • Step Parse RTF model source (1) consist to load RTF model source into RTFDocument structure .RTFDocument contains the whole RTF model, which split RTF elements interpretated by RTFTemplate as fields (RTFField), bookmarks (RTFBookmark)...
  • Step Transform RTF Document (2) consist to transform the RTFDocument structure, in other words:
    1. replace RTF code with specific macro swith template engine selected (ex : replace bookmark with#foreach macro when RTFTemplate is used with Velocity).
    2. remove some RTF code. For merge fields (MERGEFIELD), RTFTemplate remove the character " which include merge fields.









Steps for office Integration

  • RTF  template  can  be  created  with  MS  Word  by,  using MERGEFIELD,  HYPERLINK and BOOKMARK (cf. RTF specification).
  • This template will be merged with  Java objects  (can be  from database, LDAP etc.) and RTF  file will be generated at particular target.
  • These files can be saved in RTF as well as PDF format.
  • The generated files can be printed or send by email.



References:-
http://sourceforge.net/projects/rtftemplate/

http://rtftemplate.sourceforge.net/

Examples.

Address example.
Dependency example.



Friday, 23 August 2013

Steps to install JBOSS 7.1.1 sever.

  1.     Download the Binary zip files from http://labs.jboss.com/jbossas/downloads/.
  2.     In this form of installation, simply un-zip the downloaded zip file to the directory of your choice on any operating system that supports the zip format.
  3.     Go-to --> <Current Directory>\jboss-as-7.1.1.Final\bin
  4.     Run the run.bat file for setting JBOSS_HOME  
  5.     Now for starting JBoss server run <JBOSS_HOME>\bin\standalone.bat file and server will be in running mode.


Friday, 9 August 2013

Comparison between Flyway and Liquibase

Comparison between Flyway and Liquibase


Features supported by Liquibase
  1. Liquibase XML: - Smallest common denominator DB-independent format. It frees you from writing DDL and is compatible across DBs. Vendor lock-in (may or may not be an issue).
  2. Liquibase annotated SQL: - SQL with Liquibase metadata in comments (must be present). DDL gets converted to Liquibase XML with custom SQL blocks at runtime. May or may not be compatible across DBs.
  3. Refactoring: - All database change modelled as a "refactoring". Makes rollback feasible.
  4. SQL Scripts: - Generation of SQL scripts for DBA review.
  5. Multiple Databases: - Liquibase supports multiples databases; It has the option to describe your changes in a database-neutral manner so the same upgrade script can be used with multiple database types.
  6. Execution: - Conditional execution of changesets (based on DBcontext, or whether the changeset has been altered).

Features supported by Flyway

  1. Plain SQL: - Regular DDL SQL file. May or may not be compatible across DBs. No special annotations. DB structure dumps using native DB tools may be used as is. No tool specific constructs. No lock in.
  2. Procedures/Functions: - It support DB dumps including PL/SQL, T-SQL or MySQL and PostgreSQL stored procedures.
  3. Java migrations: - Migrations are Java classes using the JDBC API. Great for dealing with LOBs and complex data transformations. May or may not be compatible across DBs. Vendor lock-in (may or may not be an issue).
  4. Convention Over Configuration: - Classpath Scanning to automatically discover Sql and Java migrations.
  5. Highly reliable: - Safe for cluster environments (Multiple machines can migrate in parallel).
  6. Cloud support: - Runs on Google App Engine with full support for Google Cloud SQL.
  7. Auto-migration on Startup: - Ship migrations together with the application and run them automatically on startup using the API.
  8. Fail fast: - Inconsistent database or failed migration prevents app from starting.
  9. Schema Clean: - Drop all tables, views, triggers, from a schema without dropping the schema itself

Summary
  • FlyWay is "lower level" with you specifying exactly the SQL you want ran whereas Liquibase is "higher level" with you specifying what you want changed and Liquibase computing the SQL.
  • FlyWay manages changes by filename whereas Liquibase manages changes by order in a file.

References:-
http://stackoverflow.com/questions/8418814/db-migration-tool-liquibase-or-flyway

Please find below the link for feature comparison:-