org.formaria.aria
Interface PageLoader

All Known Implementing Classes:
AriaBuilder, EditorAriaBuilder, FormBuilder, FormBuilder, GenericBuilder, GroovyBuilder, PojoFormBuilder

public interface PageLoader

An interface used by the PageLoader to load pages

Copyright (c) Formaria Ltd., 2008

License: see license.txt

$Revision: 2.4 $


Method Summary
 java.lang.String getType()
          Get the page loader type - a unique name identifying the loader
 boolean loadFrames(java.lang.String packageName, java.lang.String pageName, PageDisplay pageDisplay, boolean useFrames)
          Loads a frameset
 PageSupport loadPage(java.lang.String packageName, java.lang.String pageName, boolean include)
          Loads an Page
 PageSupport readPage(java.io.Reader reader, java.lang.String pageName, java.lang.String ext, boolean include)
          Read an XML description of the page and construct a new Page.
 void setClassLoader(java.lang.ClassLoader cl)
          Set a secondary classloader for loading the classes referenced by pages
 void setPackageName(java.lang.String packageName)
          Set the default package name to use for loading pages and components
 void setPage(PageSupport p)
          Set the current page
 

Method Detail

getType

java.lang.String getType()
Get the page loader type - a unique name identifying the loader

Returns:
the type

loadPage

PageSupport loadPage(java.lang.String packageName,
                     java.lang.String pageName,
                     boolean include)
Loads an Page

Parameters:
packageName - the package or path to the page
pageName - the page name or the name of the class implementing the page
include - the page to be loaded is being included in another page
Returns:
the page

loadFrames

boolean loadFrames(java.lang.String packageName,
                   java.lang.String pageName,
                   PageDisplay pageDisplay,
                   boolean useFrames)
Loads a frameset

Parameters:
packageName - the package or path to the page
pageName - the page name or the name of the class implementing the page
pageDisplay - the object that will display the pages and frameset
useFrames - true to setup the frameset or false to add just a single target area
Returns:
true if a frameset is loaded

setPackageName

void setPackageName(java.lang.String packageName)
Set the default package name to use for loading pages and components

Parameters:
packageName - the package or path to the page

setClassLoader

void setClassLoader(java.lang.ClassLoader cl)
Set a secondary classloader for loading the classes referenced by pages

Parameters:
cl - the class loader

setPage

void setPage(PageSupport p)
Set the current page

Parameters:
p - the page object
Since:
3.0

readPage

PageSupport readPage(java.io.Reader reader,
                     java.lang.String pageName,
                     java.lang.String ext,
                     boolean include)
Read an XML description of the page and construct a new Page. An instance of the class specified by the class attribute is constructed or else an instance of Page if no class attribute is specified. The new page is populated but is not yet added to its parent.
The startup file parameter 'DefaultClass' is used to obtain a default for each page's class if a class parameter is not specified in the page's XML
The startup file parameter 'Validations' is used to obtain a default for each page's set of validation rules

Parameters:
reader - a input stream from which to read the page
pageName - the name of the page
ext - the file extension
include - the page to be loaded is being included in another page
Returns:
the page