Index: trunk/autoquest-plugin-html/data/guimappings/guimapping-html-dummy.txt
===================================================================
--- trunk/autoquest-plugin-html/data/guimappings/guimapping-html-dummy.txt	(revision 1059)
+++ trunk/autoquest-plugin-html/data/guimappings/guimapping-html-dummy.txt	(revision 1059)
@@ -0,0 +1,14 @@
+document = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+head = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+title = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+script = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+style = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+link = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+meta = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+iframe = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+input_hidden = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+option = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+tt = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+br = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+colgroup = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
+col = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/NewHTMLLogParser.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/NewHTMLLogParser.java	(revision 1054)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/NewHTMLLogParser.java	(revision 1059)
@@ -38,4 +38,5 @@
 
 import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.IEventType;
 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree;
 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
@@ -44,4 +45,7 @@
 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement;
 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElementSpec;
+import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageElementSpec;
+import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageSpec;
+import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLServerSpec;
 import de.ugoe.cs.util.console.Console;
 
@@ -72,5 +76,5 @@
      */
     private Collection<List<Event>> sequences;
-    
+
     /**
      * <p>
@@ -79,5 +83,5 @@
      */
     private GUIElementTree<String> currentGUIElementTree;
-    
+
     /**
      * <p>
@@ -86,5 +90,5 @@
      */
     private String currentGUIElementPath;
-    
+
     /**
      * <p>
@@ -93,5 +97,5 @@
      */
     private String currentParentPath;
-    
+
     /**
      * <p>
@@ -100,5 +104,5 @@
      */
     private String currentEventSource;
-    
+
     /**
      * <p>
@@ -107,5 +111,5 @@
      */
     private Long currentEventTimestamp;
-    
+
     /**
      * <p>
@@ -114,5 +118,11 @@
      */
     private Map<String, String> currentEventParameters;
-    
+
+    /**
+     * <p>
+     * Internal handle to the parameters of the GUI element currently being parsed.
+     * </p>
+     */
+    private Map<String, String> currentGUIElementParameters;
     /**
      * <p>
@@ -121,5 +131,5 @@
      */
     private List<Event> currentSequence;
-    
+
     /**
      * <p>
@@ -128,5 +138,5 @@
      */
     private String currentEventType;
-    
+
     /**
      * <p>
@@ -135,5 +145,5 @@
      */
     private String currentGUIElementClass;
-    
+
     /**
      * <p>
@@ -142,10 +152,5 @@
      */
     private String currentGUIElementIndex;
-    
-    /**
-     * Internal handle to the specification of the GUI element currently being parsed.
-     */
-    private HTMLGUIElementSpec currentGUIElementSpec;
-    
+
     /**
      * <p>
@@ -155,5 +160,12 @@
      */
     private IGUIElement lastGUIElement;
-    
+
+    /**
+     * <p>
+     * internal handle to the server specification currently being used.
+     * </p>
+     */
+    private HTMLServerSpec currentServerSpec;
+
     /**
      * <p>
@@ -162,22 +174,24 @@
      * 
      * @param filename
-     *          name and path of the log file
+     *            name and path of the log file
      */
     public void parseFile(String filename) {
-        if (filename == null){
+        if (filename == null) {
             throw new IllegalArgumentException("filename must not be null");
         }
-        
+
         parseFile(new File(filename));
     }
+
     /**
      * <p>
      * Parses a log file written by the HTMLMonitor and creates a collection of event sequences.
      * </p>
+     * 
      * @param file
-     *          file to be parsed
+     *            file to be parsed
      */
     public void parseFile(File file) {
-        if (file == null){
+        if (file == null) {
             throw new IllegalArgumentException("file must not be null");
         }
@@ -186,55 +200,58 @@
         SAXParser saxParser = null;
         InputSource inputSource = null;
-        try{
+        try {
             saxParser = spf.newSAXParser();
             inputSource =
-                    new InputSource(new InputStreamReader(new FileInputStream(file), "UTF-8"));
-        }
-        catch (UnsupportedEncodingException e){
+                new InputSource(new InputStreamReader(new FileInputStream(file), "UTF-8"));
+        }
+        catch (UnsupportedEncodingException e) {
             Console.printerr("Error parsing file " + file.getName());
             Console.logException(e);
             return;
         }
-        catch (ParserConfigurationException e){
+        catch (ParserConfigurationException e) {
             Console.printerr("Error parsing file " + file.getName());
             Console.logException(e);
             return;
         }
-        catch (SAXException e){
+        catch (SAXException e) {
             Console.printerr("Error parsing file " + file.getName());
             Console.logException(e);
         }
-        catch (FileNotFoundException e){
+        catch (FileNotFoundException e) {
             Console.printerr("Error parsing file " + file.getName());
             Console.logException(e);
         }
-        if (inputSource != null){
-           inputSource.setSystemId("file://" + file.getAbsolutePath());
-           try{
-               if (saxParser == null){
-                   throw new RuntimeException("SaxParser creation failed");
-               }
-               saxParser.parse(inputSource, this);
-           }
-           catch (SAXParseException e){
-               Console.printerrln("Failure parsing file in line " + e.getLineNumber() +
-                                  ", column " + e.getColumnNumber() + ".");
-               Console.logException(e);
-           }
-           catch (SAXException e){
-               Console.printerr("Error parsing file " + file.getName());
-               Console.logException(e);
-               return;
-           }
-           catch (IOException e){
-               Console.printerr("Error parsing file " + file.getName());
-               Console.logException(e);
-               return;
-           }
-        }  
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
+        if (inputSource != null) {
+            inputSource.setSystemId("file://" + file.getAbsolutePath());
+            try {
+                if (saxParser == null) {
+                    throw new RuntimeException("SaxParser creation failed");
+                }
+                saxParser.parse(inputSource, this);
+            }
+            catch (SAXParseException e) {
+                Console.printerrln("Failure parsing file in line " + e.getLineNumber() +
+                    ", column " + e.getColumnNumber() + ".");
+                Console.logException(e);
+            }
+            catch (SAXException e) {
+                Console.printerr("Error parsing file " + file.getName());
+                Console.logException(e);
+                return;
+            }
+            catch (IOException e) {
+                Console.printerr("Error parsing file " + file.getName());
+                Console.logException(e);
+                return;
+            }
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String,
+     * java.lang.String, org.xml.sax.Attributes)
      */
     @Override
@@ -243,10 +260,11 @@
     {
         if (qName.equals("session")) {
-             currentSequence = new LinkedList<Event>();
-             if (currentGUIElementTree == null)
-                     currentGUIElementTree = new GUIElementTree<String>();
+            currentSequence = new LinkedList<Event>();
+            if (currentGUIElementTree == null)
+                currentGUIElementTree = new GUIElementTree<String>();
         }
         else if (qName.equals("component")) {
             currentGUIElementPath = atts.getValue("path");
+            currentGUIElementParameters = new HashMap<String, String>();
         }
         else if (qName.equals("event")) {
@@ -254,31 +272,32 @@
             currentEventParameters = new HashMap<String, String>();
         }
-        else if (qName.equals("param")){
+        else if (qName.equals("param")) {
             String paramName = atts.getValue("name");
-            if (currentGUIElementPath != null){
-                if ("parent".equals(paramName)){
+            if (currentGUIElementPath != null) {
+                if ("parent".equals(paramName)) {
                     currentParentPath = atts.getValue("value");
                 }
-                if ("class".equals(paramName)){
+                if ("class".equals(paramName)) {
                     currentGUIElementClass = atts.getValue("value");
                 }
-                if ("index".equals(paramName)){
+                if ("index".equals(paramName)) {
                     currentGUIElementIndex = atts.getValue("value");
                 }
-            }
-            else if (currentEventType != null){
-                if ("target".equals(paramName)){
+                currentGUIElementParameters.put(paramName, atts.getValue("value"));
+            }
+            else if (currentEventType != null) {
+                if ("target".equals(paramName)) {
                     currentEventSource = atts.getValue("value");
                 }
-                if ("timestamp".equals(paramName)){
+                if ("timestamp".equals(paramName)) {
                     currentEventTimestamp = Long.parseLong(atts.getValue("value"));
                 }
                 currentEventParameters.put(paramName, atts.getValue("value"));
             }
-            else{
+            else {
                 throw new SAXException("param tag found where it should not be.");
             }
         }
-        else{
+        else {
             throw new SAXException("unknown tag found: " + qName);
         }
@@ -286,11 +305,14 @@
     }
 
-    /* (non-Javadoc)
-     * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String,
+     * java.lang.String)
      */
     @Override
     public void endElement(String uri, String localName, String qName) throws SAXException {
         if (qName.equals("session")) {
-            if (currentSequence != null && !currentSequence.isEmpty()){
+            if (currentSequence != null && !currentSequence.isEmpty()) {
                 sequences.add(currentSequence);
             }
@@ -298,46 +320,53 @@
         }
         else if (qName.equals("component") && currentGUIElementPath != null) {
-            HTMLGUIElementSpec guiElementSpec = new HTMLGUIElementSpec(currentGUIElementClass);
+            HTMLGUIElementSpec guiElementSpec =
+                getGUIElementSpec(currentGUIElementClass, currentGUIElementParameters);
             currentGUIElementTree.add(currentGUIElementPath, currentParentPath, guiElementSpec);
-            
+
             currentParentPath = null;
             currentGUIElementPath = null;
+            currentGUIElementParameters = null;
         }
         else if (qName.equals("event")) {
             IGUIElement currentGUIElement;
             currentGUIElement = currentGUIElementTree.find(currentEventSource);
-            
-            Event event = new Event(HTMLEventTypeFactory.
-                                    getInstance().getEventType(currentEventType, currentEventParameters),
-                                    (currentGUIElement == null ? lastGUIElement : currentGUIElement));
-            
+
+            IEventType eventType =
+                HTMLEventTypeFactory.getInstance().getEventType(currentEventType,
+                                                                currentEventParameters,
+                                                                currentGUIElement);
+            Event event =
+                new Event(eventType, (currentGUIElement == null ? lastGUIElement
+                    : currentGUIElement));
+
             event.setTimestamp(currentEventTimestamp);
             HTMLGUIElement currentEventTarget = (HTMLGUIElement) event.getTarget();
             currentEventTarget.markUsed();
             currentSequence.add(event);
-            
+
             currentEventSource = null;
             currentEventTimestamp = -1l;
             currentEventParameters = null;
             currentEventType = null;
-            
-            if (currentGUIElement != null){
+
+            if (currentGUIElement != null) {
                 lastGUIElement = currentGUIElement;
             }
-            
+
             currentGUIElement = null;
         }
     }
-   
+
     /**
      * <p>
      * Returns a collection of event sequences that was obtained from parsing log files.
      * </p>
+     * 
      * @return
      */
-    public Collection<List<Event>> getSequences(){
+    public Collection<List<Event>> getSequences() {
         return sequences;
     }
-    
+
     /**
      * <p>
@@ -347,7 +376,46 @@
      * @return GUIModel
      */
-    public GUIModel getGuiModel(){
+    public GUIModel getGuiModel() {
         return currentGUIElementTree.getGUIModel();
     }
 
+    /**
+     * Returns the HTMLGUIElementSpecification for a GUI Element described
+     * by its class name and its parameters.
+     * @param guiElementClass
+     * @param guiElementParameters
+     * @return
+     */
+    private HTMLGUIElementSpec getGUIElementSpec(String guiElementClass,
+                                                 Map<String, String> guiElementParameters)
+    {
+        HTMLGUIElementSpec specification = null;
+        if ("server".equals(guiElementClass)) {
+            // TODO: add correct port handling
+            specification = new HTMLServerSpec(guiElementParameters.get("htmlId"), 0);
+            currentServerSpec = (HTMLServerSpec) specification;
+        }
+
+        else {
+            String id = guiElementParameters.get("htmlId");
+            if (id == null) {
+                HTMLPageElementSpec parentSpec =
+                    (HTMLPageElementSpec) currentGUIElementTree.find(currentParentPath)
+                        .getSpecification();
+                id = parentSpec.getPage().getPagePath();
+            }
+
+            int index = -1;
+            String indexStr = guiElementParameters.get("index");
+
+            if ((indexStr != null) && (!"".equals(indexStr))) {
+                index = Integer.parseInt(indexStr);
+            }
+            String title = guiElementParameters.get("title");
+            HTMLPageSpec page = new HTMLPageSpec(currentServerSpec, id, title);
+            specification = new HTMLPageElementSpec(page, guiElementClass, id, index);
+        }
+
+        return specification;
+    }
 }
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/eventcore/HTMLEventTypeFactory.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/eventcore/HTMLEventTypeFactory.java	(revision 1054)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/eventcore/HTMLEventTypeFactory.java	(revision 1059)
@@ -24,4 +24,8 @@
 import de.ugoe.cs.autoquest.eventcore.gui.MouseClick;
 import de.ugoe.cs.autoquest.eventcore.gui.Scroll;
+import de.ugoe.cs.autoquest.eventcore.gui.TextInput;
+import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement;
+import de.ugoe.cs.autoquest.eventcore.guimodel.ITextArea;
+import de.ugoe.cs.autoquest.eventcore.guimodel.ITextField;
 import de.ugoe.cs.util.console.Console;
 
@@ -32,4 +36,5 @@
  * 
  * @author Patrick Harms
+ * @author Fabian Glaser
  */
 public class HTMLEventTypeFactory {
@@ -66,5 +71,6 @@
      * @return
      */
-    public IEventType getEventType(String eventName, Map<String, String> eventParameters) {
+    public IEventType getEventType(String eventName, Map<String, String> eventParameters, 
+                                   IGUIElement guiElement) {
         IInteraction result = null;
 
@@ -79,6 +85,13 @@
         }
         else if ("onchange".equals(eventName)) {
-            // TODO: Implement "onchange" event handling
-            Console.traceln(Level.FINE, "Unhandled event of type \"" + eventName + "\"");
+            String value = eventParameters.get("selectedValue");
+            
+            if ((guiElement instanceof ITextArea) || (guiElement instanceof ITextField)) {
+                result = new TextInput(value, null);
+            }
+            else {
+                throw new IllegalArgumentException("can not handle onchange events on GUI " +
+                                                   "elements of type " + guiElement.getClass()); 
+            }
         }
         else if ("onfocus".equals(eventName)) {
@@ -125,3 +138,6 @@
         }
     }
+    
+    
+    
 }
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElementSpec.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElementSpec.java	(revision 1054)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElementSpec.java	(revision 1059)
@@ -106,5 +106,5 @@
      * @return
      */
-    HTMLPageSpec getPage() {
+    public HTMLPageSpec getPage() {
         return page;
     }
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageSpec.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageSpec.java	(revision 1054)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageSpec.java	(revision 1059)
@@ -58,7 +58,7 @@
             throw new IllegalArgumentException("pagePath must not be null");
         }
-        else if (pageTitle == null) {
-            throw new IllegalArgumentException("pageTitle must not be null");
-        }
+//        else if (pageTitle == null) {
+//            throw new IllegalArgumentException("pageTitle must not be null");
+//        }
         
         this.server = server;
@@ -134,5 +134,5 @@
      * @return
      */
-    String getPagePath() {
+    public String getPagePath() {
         return pagePath;
     }
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServerSpec.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServerSpec.java	(revision 1054)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServerSpec.java	(revision 1059)
@@ -45,5 +45,5 @@
      * @param port
      */
-    HTMLServerSpec(String host, int port) {
+    public HTMLServerSpec(String host, int port) {
         super("server");
         
@@ -67,5 +67,5 @@
      * @param pageURL
      */
-    HTMLServerSpec(URL pageURL) {
+    public HTMLServerSpec(URL pageURL) {
         super("server");
 
