|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.oktiva.mogno.Application
The main Mogno application class. It's the "runnable" class, called from the servlet.
import com.oktiva.mogno.*; ... Application myApp = new Application(); myApp.addTopLevel("formLogin", "com.oktiva.myapp.TopLevel1", "TopLevel1.xml"); myApp.addTopLevel("cadastroUsuario", "com.oktiva.myapp.TopLevel2", "TopLevel2.xml"); myApp.addTopLevel("formBusca", "com.oktiva.myapp.TopLevel3", "TopLevel3.xml"); myApp.setDefaultTopLevel("formLogin");
Field Summary | |
protected ApplicationFiler |
applicationFiler
|
protected java.util.Hashtable |
applicationFilerParams
|
protected java.lang.String |
defaultTopLevel
|
protected boolean |
designing
|
protected javax.servlet.http.HttpServletRequest |
request
|
protected javax.servlet.http.HttpServletResponse |
response
|
protected javax.servlet.http.HttpSession |
session
|
protected java.util.Hashtable |
topLevels
|
protected java.util.Hashtable |
topLevelsData
Hashtable of Hashtables. |
Constructor Summary | |
Application()
Creates a new instance of Application |
Method Summary | |
void |
addTopLevel(java.lang.String name,
java.lang.String topLevelClass)
Add the TopLevel data supplied to the topLevelsData Hashtable. |
void |
addTopLevel(java.lang.String name,
java.lang.String topLevelClass,
java.lang.String xmlFileName)
Add the TopLevel data supplied to the topLevelsData Hashtable. |
void |
emergency(java.lang.Throwable e)
Prints the stack trace for an exception to the user, in text/plain format. |
Application |
getClone()
|
java.lang.String |
getDefaultTopLevel()
|
java.lang.String |
getRootDir()
Get the root dir for this application. |
javax.servlet.http.HttpServletRequest |
getServletRequest()
|
javax.servlet.http.HttpServletResponse |
getServletResponse()
|
javax.servlet.http.HttpSession |
getSession()
|
TopLevel |
getTopLevel(java.lang.String name)
Get the TopLevel registered under the name supplied. |
java.lang.String |
getTopLevelClassname(java.lang.String topLevelName)
|
java.util.Hashtable |
getTopLevelsData()
Get the Hashtable with the data of this application's TopLevels. |
java.lang.String |
getTopLevelXmlFileName(java.lang.String topLevelName)
|
void |
initialize()
Initialize this application with a custom filer. |
void |
initialize(java.io.File xmlFile)
Initialize this application passing the XML file to load. |
void |
initialize(java.lang.String xmlFileName)
Initialize this application passing the XML file to load. |
boolean |
isDesigning()
Getter for property designing. |
void |
out(java.lang.String str)
Outputs the string received without setting any header. |
void |
outHtml(java.lang.String html)
Outputs the string received as text/html content to the user. |
void |
removeTopLevel(java.lang.String name)
Remove from the application the TopLevel registered under the name supplied. |
void |
run(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Run this application, with the data in the request. |
void |
setApplicationFiler(ApplicationFiler filer)
Set a custom ApplicationFiler to use instead of the DefaultApplicationFiler. |
void |
setApplicationFilerParams(java.util.Hashtable params)
Set the params for the custom ApplicationFiler. |
void |
setDefaultTopLevel(java.lang.String name)
Set the TopLevel that will be shown when this application is called without mognoOrigin parameter. |
void |
setDesigning(boolean designing)
Setter for property designing. |
void |
setRootDir(java.lang.String dir)
Set the root dir for this application. |
void |
store()
Store the current application into the file defined by the xmlFileName property |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
protected javax.servlet.http.HttpSession session
protected java.lang.String defaultTopLevel
protected java.util.Hashtable topLevels
protected java.util.Hashtable topLevelsData
protected ApplicationFiler applicationFiler
protected java.util.Hashtable applicationFilerParams
protected boolean designing
Constructor Detail |
public Application()
Method Detail |
public void initialize(java.lang.String xmlFileName) throws java.io.IOException
xmlFileName
- The path to the XML file to load.
java.io.IOException
public void initialize(java.io.File xmlFile) throws java.io.IOException
xmlFile
- The File whith XML to load.
java.io.IOException
initialize(String)
public void initialize() throws java.io.IOException
java.io.IOException
public void setApplicationFiler(ApplicationFiler filer)
filer
- The ApplicationFiler to use.setApplicationFilerParams(Hashtable)
,
initialize()
public void setApplicationFilerParams(java.util.Hashtable params)
params
- The params to pass to the filer.setApplicationFiler(ApplicationFiler)
,
initialize()
public void store() throws java.io.IOException
java.io.IOException
public void addTopLevel(java.lang.String name, java.lang.String topLevelClass) throws com.oktiva.mogno.DuplicatedTopLevelException
name
- Name of the TopLevel. Must be unique.topLevelClass
- Fully qualified name of the TopLevel class.
com.oktiva.mogno.DuplicatedTopLevelException
- If there is already a TopLevel with the specified name.public void addTopLevel(java.lang.String name, java.lang.String topLevelClass, java.lang.String xmlFileName) throws com.oktiva.mogno.DuplicatedTopLevelException
name
- Name of the TopLevel. Must be unique.topLevelClass
- Fully qualified name of the TopLevel class.xmlFileName
- Name of the XML file for this TopLevel, without path.
com.oktiva.mogno.DuplicatedTopLevelException
- If there is already a TopLevel with the specified name.public void removeTopLevel(java.lang.String name) throws com.oktiva.mogno.TopLevelNotFoundException
store()
if you want this.
name
- Name of the TopLevel to remove.
com.oktiva.mogno.TopLevelNotFoundException
- If the name is not the name of a registered TopLevel.public java.util.Hashtable getTopLevelsData()
topLevelsData
public void setDefaultTopLevel(java.lang.String name) throws com.oktiva.mogno.TopLevelNotFoundException
name
- Name of the default TopLevel.
com.oktiva.mogno.TopLevelNotFoundException
- If the name is not the name of a registered TopLevel.public java.lang.String getDefaultTopLevel()
public TopLevel getTopLevel(java.lang.String name) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, InitializeException, com.oktiva.mogno.TopLevelNotFoundException
name
- Name of the TopLevel to get.
java.lang.ClassNotFoundException
- If the class of the TopLevel can not be found in the CLASSPATH.
java.lang.InstantiationException
- If the reflection system can't instantiate the TopLevel's class.
java.lang.IllegalAccessException
- If the class or it's constructor is not acessible.
InitializeException
- If the initialization proccess of the TopLevel fails.
com.oktiva.mogno.TopLevelNotFoundException
public void setRootDir(java.lang.String dir)
public java.lang.String getRootDir()
public java.lang.String getTopLevelClassname(java.lang.String topLevelName) throws com.oktiva.mogno.TopLevelNotFoundException
com.oktiva.mogno.TopLevelNotFoundException
public java.lang.String getTopLevelXmlFileName(java.lang.String topLevelName) throws com.oktiva.mogno.TopLevelNotFoundException
com.oktiva.mogno.TopLevelNotFoundException
public void run(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
java.io.IOException
public void emergency(java.lang.Throwable e) throws java.io.IOException
java.io.IOException
public void outHtml(java.lang.String html) throws java.io.IOException
java.io.IOException
public void out(java.lang.String str) throws java.io.IOException
java.io.IOException
public javax.servlet.http.HttpServletRequest getServletRequest()
public javax.servlet.http.HttpServletResponse getServletResponse()
public javax.servlet.http.HttpSession getSession()
public Application getClone()
public boolean isDesigning()
designing
public void setDesigning(boolean designing)
designing
- New value of property designing.designing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |