se.kmr.scam.client.http.util
Class ViewConfigParser

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byse.kmr.scam.client.http.util.ViewConfigParser
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class ViewConfigParser
extends DefaultHandler

View configuration parser.
The configuration file ("views.xml") must made available either in classpath, $JAVA_HOME/lib or in the jar-file. Example of preference configuration XML contents:


  <views beanName="beanName">

    <!-- Edit configuration -->
    <editViews>
        <view name="foo">
            <form value="form.xml"/>
            <query value="query.xml"/>
            <page value="page.jsp"/>
            <external  value="ontology.xml"/>
        </view>
    </editViews>

    <!-- Pages configuration -->
    <staticViews>
        <view name="foo">
            <page value="page.jsp"/>
        </view>
    </staticViews>

  </views>
 

Version:
$Revision: 1.10 $
Author:
Jöran
Created:
2003-04-03

Constructor Summary
ViewConfigParser()
           
 
Method Summary
 void endElement(String namespaceURI, String localName, String qName)
          Handles the ending of an element
 String getBeanName()
          Gets current preferences bean name for application scope attribute.
 HashMap getEditViewsConfiguration()
          Gets current editable views configuration.
 HashMap getStaticViewConfiguration()
          Gets current queeries map.
 void parse()
           
 void parse(InputStream is)
          Parse the given input stream.
 void parse(String filename)
          Parses the given XML-file.
 void startElement(String namespaceURI, String localName, String qName, Attributes atts)
          Receives notifiacation of the start of an element.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewConfigParser

public ViewConfigParser()
Method Detail

parse

public void parse(String filename)
Parses the given XML-file.

Parameters:
filename -

parse

public void parse(InputStream is)
Parse the given input stream.

Parameters:
is - Parse this stream.

parse

public void parse()

getBeanName

public String getBeanName()
Gets current preferences bean name for application scope attribute.

Returns:
The bean instance attribute name.

getEditViewsConfiguration

public HashMap getEditViewsConfiguration()
Gets current editable views configuration.

Returns:
forms name/value map

getStaticViewConfiguration

public HashMap getStaticViewConfiguration()
Gets current queeries map.

Returns:
queries name/value map

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Receives notifiacation of the start of an element.

Parameters:
localName - - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - - The qualified name (with prefix), or the empty string if qualified names are not available.
atts - - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
SAXException

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
                throws SAXException
Handles the ending of an element

Parameters:
namespaceURI - The namespace of the element
localName - The local name of the element
qName - The element name
Throws:
SAXException - thrown in case of missmatch in configuration


Copyright © 2003 SCAM. All Rights Reserved.