com.taggercat.template.pagegen
Class JSPPageGenerator

java.lang.Object
  extended by com.taggercat.template.pagegen.JSPPageGenerator

public class JSPPageGenerator
extends java.lang.Object

A console application for the generating and maintaining basic template based JSP pages. We are using this application because we are maintaining ~ 400 pages in our application. If your application has ~ 10 ish pages, then this might not be a significant benefit to you.

 

Field Summary
static java.lang.String DEFAULT_ENCODING
          Default character encoding for response.
 
Constructor Summary
JSPPageGenerator(java.lang.String filename, java.lang.String xpath, java.lang.String outputBaseFolderName, boolean testmode)
           
 
Method Summary
 void generatePage(java.lang.String baseFolderName, com.taggercat.template.pagegen.JSPPageGenerator.Page page)
          Generates the specific page in the destination folder.
 java.util.Map getExistingEditablePageContent(java.io.File destinationFile)
          Creates a Map of all named editable sections in the existing page.
 java.lang.String getJSessionId(java.net.URLConnection conn)
          Get the jsession id used in the current connection
static void main(java.lang.String[] args)
          Main
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

public static final java.lang.String DEFAULT_ENCODING
Default character encoding for response.

See Also:
Constant Field Values
Constructor Detail

JSPPageGenerator

public JSPPageGenerator(java.lang.String filename,
                        java.lang.String xpath,
                        java.lang.String outputBaseFolderName,
                        boolean testmode)
Method Detail

getJSessionId

public java.lang.String getJSessionId(java.net.URLConnection conn)
                               throws java.net.MalformedURLException,
                                      java.io.IOException
Get the jsession id used in the current connection

Throws:
java.net.MalformedURLException
java.io.IOException
Parameters:
conn -
Returns:
String

generatePage

public void generatePage(java.lang.String baseFolderName,
                         com.taggercat.template.pagegen.JSPPageGenerator.Page page)
                  throws java.net.MalformedURLException,
                         java.io.IOException
Generates the specific page in the destination folder. If the page currently exists, then its editable content will be merged into the new page.

Throws:
java.net.MalformedURLException
java.io.IOException
Parameters:
baseFolderName - the base folder to write the output
page - the page object to process

getExistingEditablePageContent

public java.util.Map getExistingEditablePageContent(java.io.File destinationFile)
                                             throws java.io.IOException
Creates a Map of all named editable sections in the existing page. All content outside of these sections will be over written.

Throws:
java.io.IOException
Parameters:
destinationFile - the existing jsp file
Returns:
Map

main

public static void main(java.lang.String[] args)
Main

Parameters:
args - templates.xml file xpath expression base output directory