com.webstersmalley.picweb.offline.config
Class ConfigurationModel

java.lang.Object
  extended by com.webstersmalley.picweb.offline.config.ConfigurationModel

public final class ConfigurationModel
extends java.lang.Object

Holds the model for the configuration. This is expected to be instantiated with the default constructor and the fields set by either the configuration GUI or a saved configuration.


Field Summary
private  java.lang.String artifactsFolder
          Artifacts folder.
private  java.lang.String googleAdId
          Google Ad ID
private  int imageSize
          Maximum size of image (height or width).
private  int maxRows
          Maximum number of rows before a new page of thumbs is created.
private  java.lang.String outputFolder
          The base output folder (eg /html/picweb-generated).
private  java.lang.String rootFolder
          The base input folder (eg /pics/holiday).
private  int rowSize
          Maximum number of images per row in the table of thumbnails
private  java.lang.String templateFilename
          Name of the template file.
private  int thumbSize
          Maximum size of thumbnail (height or width).
private  java.lang.String title
          The title of the webpage (appears as the html title).
 
Constructor Summary
ConfigurationModel()
           
 
Method Summary
static ConfigurationModel fromXML(java.lang.String filename)
          Create a ConfigurationModel object out of an xml filename
 java.lang.String getArtifactsFolder()
           
 java.lang.String getGoogleAdId()
           
 int getImageSize()
          Returns the image size
 int getMaxRows()
          Returns the maximum number of rows in the table on a given thumbnail page.
 java.lang.String getOutputFolder()
          Returns the folder in which all output is to be saved.
 java.lang.String getRootFolder()
          Returns the folder in which the images are to be found.
 int getRowSize()
          Returns the maximum number of images in a given row in the thumbnails page.
 java.lang.String getTemplateFilename()
          Returns the filename of the template.
 int getThumbSize()
          Returns the maximum size of the thumbnails, irrespective of picture orientation.
 java.lang.String getTitle()
          Returns the title of the generated web site.
 void setArtifactsFolder(java.lang.String artifactsFolder)
           
 void setGoogleAdId(java.lang.String googleAdId)
           
 void setImageSize(int imageSize)
          Sets the maximum size of the image.
 void setMaxRows(int maxRows)
          Sets the maximum number of rows in the table on a given thumbnail page.
 void setOutputFolder(java.lang.String outputFolder)
          Sets the folder in which all output is to be saved.
 void setRootFolder(java.lang.String rootFolder)
          Sets the folder in which the images are to be found.
 void setRowSize(int rowSize)
          Sets the maximum number of images in a given row in the thumbnails page.
 void setTemplateFilename(java.lang.String templateFilename)
          Filename of the template file to set.
 void setThumbSize(int thumbSize)
          Sets the maximum size of the thumbnail.
 void setTitle(java.lang.String title)
          Sets the title of the generated web site.
 org.w3c.dom.Document toXML()
          Returns an XML representation of the configuration model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputFolder

private java.lang.String outputFolder
The base output folder (eg /html/picweb-generated).


rootFolder

private java.lang.String rootFolder
The base input folder (eg /pics/holiday).


title

private java.lang.String title
The title of the webpage (appears as the html title).


rowSize

private int rowSize
Maximum number of images per row in the table of thumbnails


maxRows

private int maxRows
Maximum number of rows before a new page of thumbs is created.


thumbSize

private int thumbSize
Maximum size of thumbnail (height or width).


imageSize

private int imageSize
Maximum size of image (height or width).


templateFilename

private java.lang.String templateFilename
Name of the template file.


googleAdId

private java.lang.String googleAdId
Google Ad ID


artifactsFolder

private java.lang.String artifactsFolder
Artifacts folder. All files in here will be copied to the base output folder. Put things like icons (for navigation) and stylesheets here.

Constructor Detail

ConfigurationModel

public ConfigurationModel()
Method Detail

getImageSize

public int getImageSize()
Returns the image size

Returns:
the imageSize.

setImageSize

public void setImageSize(int imageSize)
Sets the maximum size of the image. Irrespective of whether the image is portrait (height > width) or landscape (width > height), no dimension will be greater than the set imageSize.

Parameters:
imageSize - The imageSize to set.

getMaxRows

public int getMaxRows()
Returns the maximum number of rows in the table on a given thumbnail page.

Returns:
Returns the maxRows.

setMaxRows

public void setMaxRows(int maxRows)
Sets the maximum number of rows in the table on a given thumbnail page. If the number of rows would exceed this value, the generated web page should be split into sub pages.

Parameters:
maxRows - The maxRows to set.

getOutputFolder

public java.lang.String getOutputFolder()
Returns the folder in which all output is to be saved.

Returns:
Returns the outputFolder.

setOutputFolder

public void setOutputFolder(java.lang.String outputFolder)
Sets the folder in which all output is to be saved.

Parameters:
outputFolder - The outputFolder to set.

getRootFolder

public java.lang.String getRootFolder()
Returns the folder in which the images are to be found.

Returns:
Returns the rootFolder.

setRootFolder

public void setRootFolder(java.lang.String rootFolder)
Sets the folder in which the images are to be found.

Parameters:
rootFolder - The rootFolder to set.

getRowSize

public int getRowSize()
Returns the maximum number of images in a given row in the thumbnails page.

Returns:
Returns the rowSize.

setRowSize

public void setRowSize(int rowSize)
Sets the maximum number of images in a given row in the thumbnails page. If the number of images exceeds this value, the table is wrapped onto a new row.

Parameters:
rowSize - The rowSize to set.

getThumbSize

public int getThumbSize()
Returns the maximum size of the thumbnails, irrespective of picture orientation.

Returns:
Returns the thumbSize.

setThumbSize

public void setThumbSize(int thumbSize)
Sets the maximum size of the thumbnail. Irrespective of whether the image is portrait (height > width) or landscape (width > height), no dimension will be greater than the set thumbSize.

Parameters:
thumbSize - The thumbSize to set.

getTitle

public java.lang.String getTitle()
Returns the title of the generated web site.

Returns:
Returns the title.

setTitle

public void setTitle(java.lang.String title)
Sets the title of the generated web site.

Parameters:
title - The title to set.

getTemplateFilename

public java.lang.String getTemplateFilename()
Returns the filename of the template.

Returns:
Returns the templateFilename.

setTemplateFilename

public void setTemplateFilename(java.lang.String templateFilename)
Filename of the template file to set.

Parameters:
templateFilename - The templateFilename to set.

getArtifactsFolder

public java.lang.String getArtifactsFolder()
Returns:
Returns the artifactsFolder.

setArtifactsFolder

public void setArtifactsFolder(java.lang.String artifactsFolder)
Parameters:
artifactsFolder - The artifactsFolder to set.

getGoogleAdId

public java.lang.String getGoogleAdId()
Returns:
Returns the googleAdId.

setGoogleAdId

public void setGoogleAdId(java.lang.String googleAdId)
Parameters:
googleAdId - The googleAdId to set.

fromXML

public static ConfigurationModel fromXML(java.lang.String filename)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Create a ConfigurationModel object out of an xml filename

Parameters:
filename - the filename of the XML file to parse
Returns:
ConfigurationModel the model
Throws:
org.xml.sax.SAXException
java.io.IOException

toXML

public org.w3c.dom.Document toXML()
                           throws javax.xml.parsers.ParserConfigurationException
Returns an XML representation of the configuration model

Returns:
Throws:
javax.xml.parsers.ParserConfigurationException


Copyright © 2004-2005-2005 Webster Smalley. All Rights Reserved.