PAJES Jenerator
The PAJES Jenerator is a standard web application, written using PAJES. Its purpose is to generate Java source code for:
  • PAJE templates from your HTML files.
  • A web application stub using the PAJES servlet framework.
  • PAJES Entity objects to access your database tables.
The Jenerator creates both an abstract and a concrete class for most things that it does. This enables you to separate the Jenerated code from the program code you have to write.
You should never change the Jenerated abstract classes. Only ever write code in the concrete classes, and re-Jenerate the abstract classes as needed.
For example, if you write some code that manipulates the HTML Jenerated from your source document, and then your source document changes so significantly that it has to be re-Jenerated, you only need to recreate the abstract PajeTemplate and Paje sub-classes, and your hand developed business logic code in your concrete class will not be lost.
The PAJES Jenerator is included in the demonstration download.
  PAJE templates from your HTML files
The PAJES PajeFactory and PajeTemplate classes combine to produce Paje instances, which are Java objects representing an HTML page.
Whilst this base infrastructure works well, it requires that your code contain Strings that represent the ID and NAME attributes of the HTML tags (which is how you retrieve the individual HTML elements on the Paje). If there are major changes to the base HTML document, it can be difficult to track down and change all the affected Strings.
So, we developed the Jenerator, which produces Java source code for the following objects for a specified HTML source file. (The [filename] in each class name below is derived by removing the path and file type (i.e. .html) from the file name.)
Class Description Jenerated
Abstract[filename]Template.java An abstract sub-class of PajeTemplate that contains constants that can be used to refer to individual ID and NAME attributes of each HTML element, and method definitions that allow manipulation of the individual HTML elements as they are parsed from the HTML source file and added to the document class hierarchy. Also ensures that the Paje which is generated is an instance of [filename]Paje. Always
Abstract[filename]Paje.java An abstract sub-class of Paje that contains methods to access individual HTML elements in the document class hierarchy, so that you can use method calls rather than hard-coding Strings. Always
[filename]Template.java Empty concrete implemetation of Abstract[filename]Template to which any required business logic code may be added. On Request
[filename]Paje.java Empty concrete implemetation of Abstract[filename]Paje to which any required business logic code may be added. On Request
[filename]PajeFactory.java Concrete sub-class of PajeFactory that returns [filename]Paje objects. On Request
[filename].java Concrete sub-class of PajeServlet that displays [filename]Paje instances. On Request
  Web Application Stub
The Application Jenerator is used to create a simple web application that uses PAJES as it's presentation layer. It's purpose is provide you with a basic working application that you can extend. A zip file is created which you can download and unzip. It contains all of the Java source files you need as well as the jar files that are required.
All you need to do is compile the jenerated .java files and run them inside your servlet engine.
  PAJES Entity objects to access your database tables
PAJES contains a set of simple object-relational mapping classes. The Jenerator enables you to create the Java source of classes to access your applications' database tables, using the database tables themselves as the source.
In addiiton to the classes to access the database table, you can automatically create lists of database rows and do simple inserts, updates and deletes, all with no SQL or Java programming!
The Jenerator produces Java source code for the following objects for specified database tables and/or views:
Class Description Jenerated
Abstract[tablename]Manager.java Abstract sub-class of org.pages.db.entity.Manager that contains constants that can be used to refer to individual columns names, and the org.pages.db.entity.Attributes definitions required by the PAJES database entity model. Always
Abstract[tablename].java Abstract sub-class of org.pages.db.entity.Entity that contains the get and set methods to retrieve and update specific columns in a row of the database table. Always
[tablename]Manager.java Concrete implemetation of Abstract[tablename]Manager to which any required business logic code may be added. On Request
[tablename].java Empty concrete implemetation of Abstract[tablename] to which any required business logic code may be added. On Request
[tablename]Admin.java Concrete sub-class of org.pages.db.entity.MaintenanceServlet which can automtically create HTML lists of [tablename] Java objects, and HTML edit screens for inserting, updating and deleting those objects, without any HTML, Java or SQL programming. On Request