com.oktiva.mogno
Class XmlContainer

java.lang.Object
  extended bycom.oktiva.mogno.Component
      extended bycom.oktiva.mogno.Visual
          extended bycom.oktiva.mogno.Container
              extended bycom.oktiva.mogno.XmlContainer
All Implemented Interfaces:
java.lang.Cloneable

public abstract class XmlContainer
extends Container

The superclass for containers that knows how to get the XML from some resource, with nice defaults.


Field Summary
 java.lang.String evOnUncaughtError
          Event dispatched when some exception is not caught in the inner components.
 
Fields inherited from class com.oktiva.mogno.Container
afterEnd, content
 
Fields inherited from class com.oktiva.mogno.Visual
evOnShow, evOnSyntaxError, gridHeight, gridWeightX, gridWeightY, gridWidth, id, lastError, left, parent, problematic, style, styleClass, title, top
 
Fields inherited from class com.oktiva.mogno.Component
bag, componentFiler, componentFilerParams, designing, eventQueue, evOnCreate, name, owned, ownedClasses, owner, tag, xmlFileName
 
Constructor Summary
XmlContainer()
           
 
Method Summary
 void checkSyntax()
          Check the syntax for this component.
protected  void checkSyntax(java.util.Vector fields)
          This function is overrided to check the syntax of owned components.
protected  java.util.Vector checkSyntaxFields()
          List the components that need to be checked for syntax errors.
 void dispatchAll()
          Dispatch all the events in the event queue in all child components and in this one.
 void freeChildComponent(java.lang.String name)
          Convenience method equivalent to freeChild.
 Component getChildComponent(java.lang.String name)
          Convenience method equivalent to getChild.
 java.lang.Class getChildComponentClass(java.lang.String name)
          Convenience method equivalent to getChildClass.
 java.lang.String getEvOnUncaughtError()
          Event dispatched when some exception is not caught in the inner components.
protected  java.io.InputStream getXmlInputStream()
          Obtain a InputStream from wich we will get the XML.
protected  java.lang.String getXmlResourceName()
          Gets the ResourceName that will be used at getXmlResourceName()
 void initialize(java.util.Hashtable params)
          Initializes this components.
 java.util.Vector nonAttributeGetters()
          Method used to define what methods started with "get" or "is" are not component attributes getter methods.
 void onReceiveRequest()
          Event dispatched when the request is received.
 void receiveRequest(javax.servlet.http.HttpServletRequest request)
          Receive the request and rebuild the properties using the data that the user has filled in.
protected  Component selectParentComponent()
          The parent component: this one or his owner.
 void setEvOnUncaughtError(java.lang.String evOnUncaughtError)
          Event dispatched when some exception is not caught in the inner components.
 java.lang.String show()
          Write down my serialized bag if there is elements there, then call super.show();
 
Methods inherited from class com.oktiva.mogno.Container
addChildsVector, betweenColumns, betweenRows, endColumn, endContainer, endRow, getChildsVector, getContent, getFullComponentsVector, getOrderedChildNames, getOrderedChildsVector, orderChildsVector, setContent, startColumn, startContainer, startRow
 
Methods inherited from class com.oktiva.mogno.Visual
buildHtmlAttributes, cellhalignHtmlAttributes, cellvalignHtmlAttributes, coreHtmlAttributes, descendentOf, eventsHtmlAttributes, getEvOnShow, getEvOnSyntaxError, getGridHeight, getGridWeightX, getGridWeightY, getGridWidth, getId, getLastError, getLeft, getParent, getStyle, getStyleClass, getTitle, getTop, htmlAttributes, i18nHtmlAttributes, localizableAttributes, setEvOnShow, setEvOnSyntaxError, setGridHeight, setGridWeightX, setGridWeightY, setGridWidth, setId, setLastError, setLeft, setParent, setStyle, setStyleClass, setTitle, setTop, showHtmlAttributes
 
Methods inherited from class com.oktiva.mogno.Component
attribsHash, createOwnedComponents, dispatch, dispatchFunction, eventParamTypes, eventParamValues, freeChild, getApplication, getAttrsTypes, getBag, getChild, getChildClass, getClone, getEvOnCreate, getFromBag, getName, getOwner, initialize, initialize, initialize, isDesigning, listChilds, putInBag, queue, registerChild, removeFromBag, serializedBag, setBag, setComponentFiler, setComponentFilerParams, setDesigning, setEvOnCreate, setName, setOwner, setProperties, store, unserializeBag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

evOnUncaughtError

public java.lang.String evOnUncaughtError
Event dispatched when some exception is not caught in the inner components.

Constructor Detail

XmlContainer

public XmlContainer()
Method Detail

initialize

public void initialize(java.util.Hashtable params)
                throws InitializeException
Initializes this components. Changes the childs names from the XML for [thisComponentName]__[originalChildName]

Overrides:
initialize in class Component
Parameters:
params - This instance's attributes.
Throws:
InitializeException - If the resource is not found or the initialization fails.
See Also:
Component.initialize()

getChildComponent

public Component getChildComponent(java.lang.String name)
Convenience method equivalent to getChild. Do the name translation automatically.

See Also:
initialize(Hashtable), Component.getChild(String)

getChildComponentClass

public java.lang.Class getChildComponentClass(java.lang.String name)
Convenience method equivalent to getChildClass. Do the name translation automatically.

See Also:
initialize(Hashtable), Component.getChildClass(String)

freeChildComponent

public void freeChildComponent(java.lang.String name)
Convenience method equivalent to freeChild. Do the name translation automatically.

See Also:
initialize(Hashtable), Component.freeChild(String)

getXmlInputStream

protected java.io.InputStream getXmlInputStream()
Obtain a InputStream from wich we will get the XML. For default, it gets it from the class resource using the name from getXmlResourceName()

See Also:
getXmlResourceName()

getXmlResourceName

protected java.lang.String getXmlResourceName()
Gets the ResourceName that will be used at getXmlResourceName()


nonAttributeGetters

public java.util.Vector nonAttributeGetters()
Description copied from class: Component
Method used to define what methods started with "get" or "is" are not component attributes getter methods.
This method in all subclasses of Component must start with the following line:
Vector v = super.nonAttributeGetters();
and end with the following:
return v;

Overrides:
nonAttributeGetters in class Container

selectParentComponent

protected Component selectParentComponent()
Description copied from class: Container
The parent component: this one or his owner.

Overrides:
selectParentComponent in class Container
Returns:
(Component)owner==null?this:owner

receiveRequest

public void receiveRequest(javax.servlet.http.HttpServletRequest request)
Receive the request and rebuild the properties using the data that the user has filled in.

Overrides:
receiveRequest in class Visual
Parameters:
request - The HttpServletRequest object.

dispatchAll

public void dispatchAll()
                 throws java.lang.Exception
Dispatch all the events in the event queue in all child components and in this one.

Overrides:
dispatchAll in class Component
Throws:
java.lang.Exception

getEvOnUncaughtError

public java.lang.String getEvOnUncaughtError()
Event dispatched when some exception is not caught in the inner components.


setEvOnUncaughtError

public void setEvOnUncaughtError(java.lang.String evOnUncaughtError)
Event dispatched when some exception is not caught in the inner components.


checkSyntax

public void checkSyntax()
                 throws SyntaxErrorException
Check the syntax for this component.

For default, call checkSyntax of the components listed in checkSyntaxFields().

Overrides:
checkSyntax in class Visual
Throws:
SyntaxErrorException - if any of the components don't pass the check.

checkSyntaxFields

protected java.util.Vector checkSyntaxFields()
List the components that need to be checked for syntax errors.

The default value is the list of all children of this component.

Returns:
A Vector with the name of the components to be tested.

checkSyntax

protected void checkSyntax(java.util.Vector fields)
                    throws SyntaxErrorException
This function is overrided to check the syntax of owned components.

Parameters:
fields - A Vector with the name of the components to be tested
Throws:
SyntaxErrorException - if any of the components don't pass the check.

show

public java.lang.String show()
                      throws java.lang.Exception
Write down my serialized bag if there is elements there, then call super.show();

Overrides:
show in class Container
Throws:
java.lang.Exception

onReceiveRequest

public void onReceiveRequest()
Event dispatched when the request is received.