Well, after upgrading to Firefox 3 I have realised one of the drawbacks present in the Open Source community - the XForms plugin is not released in concert with FF3. For now, this means a pause in development activity.
Of course I could get involved in the development of the plugin itself, and to this end I have been getting set up with Eclipse for C development. However accessing CVS for Firefox is a problem, as I am behind a firewall. Getting ProxyTunnel built for OS X is the next step, and this is almost complete. After that I hope to have access sorted out and be able to start some serious hacking of the code. Maybe then I can in some small way help to accelerate the release of the plugin for FF3.
Sunday, July 13, 2008
Tuesday, July 1, 2008
Debugging status of instances in XForms
Debugging XForms at runtime has not been easy. It seems difficult to get simple and convenient access to the XForms instance data while the user is interacting with the form. I find that I want to test an XPath expression or XForms action (e.g. setvalue).
My development environment is Eclipse, with embedded Tomcat as the server. Testing the interface is through FireFox, and I have Firebug installed to monitor web server calls. Firebug does provide access to the DOM, and I guess this should mean I can look into the instance nodes. However this is less than straightforward.
In the end I realised that I could create a simple debug tool to inspect the instance data. By adding a "Debug" button to the form, I can submit an instance data back to the server. I created a simple DebugXFormsSubmission JSP. The JSP does nothing more than output the submitted data to the server's stdout. Which Eclipse captures nicely from the embedded server and displays in the Console view.
The text of the JSP is:
<%@ page language="java" contentType="text/xml; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.io.BufferedReader" %>
<%
String xml = new String("");
String thisLine;
BufferedReader br = request.getReader();
while ((thisLine = br.readLine()) != null) {
xml = xml.concat(thisLine);
}
System.out.println("Received xml: ");
System.out.println(xml);
System.out.println("Done");
%>
The Debug submission in the form is:
<xf:submission id="submitDebug"
method="post"
replace="none"
ref="instance('data')"
action="/Leads/DebugXFormsSubmission.jsp"
omit-xml-declaration="true">
</xf:submission>
The Debug button is:
<xf:submit submission="submitDebug">
<xf:label>Debug</xf:label>
</xf:submit>
This has become a simple but invaluable means of getting quick access to the instance data. And it has no impact on the actual instance itself.
My development environment is Eclipse, with embedded Tomcat as the server. Testing the interface is through FireFox, and I have Firebug installed to monitor web server calls. Firebug does provide access to the DOM, and I guess this should mean I can look into the instance nodes. However this is less than straightforward.
In the end I realised that I could create a simple debug tool to inspect the instance data. By adding a "Debug" button to the form, I can submit an instance data back to the server. I created a simple DebugXFormsSubmission JSP. The JSP does nothing more than output the submitted data to the server's stdout. Which Eclipse captures nicely from the embedded server and displays in the Console view.
The text of the JSP is:
<%@ page language="java" contentType="text/xml; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.io.BufferedReader" %>
<%
String xml = new String("");
String thisLine;
BufferedReader br = request.getReader();
while ((thisLine = br.readLine()) != null) {
xml = xml.concat(thisLine);
}
System.out.println("Received xml: ");
System.out.println(xml);
System.out.println("Done");
%>
The Debug submission in the form is:
<xf:submission id="submitDebug"
method="post"
replace="none"
ref="instance('data')"
action="/Leads/DebugXFormsSubmission.jsp"
omit-xml-declaration="true">
</xf:submission>
The Debug button is:
<xf:submit submission="submitDebug">
<xf:label>Debug</xf:label>
</xf:submit>
This has become a simple but invaluable means of getting quick access to the instance data. And it has no impact on the actual instance itself.
Subscribe to:
Posts (Atom)