org.sandev.TaskHeap.TaskHeapUI
Class ReportWriter

java.lang.Object
  extended by org.sandev.TaskHeap.TaskHeapUI.ReportWriter

public class ReportWriter
extends java.lang.Object

Write out TaskHeap reports. Eventually we should probably dump out each element using the standard XHTML rendering, and then apply transform templates to each one to produce output. Either that or use a reporting tool. For now we just write out XHTML directly since it's pretty simple.


Constructor Summary
ReportWriter()
           
 
Method Summary
protected  java.lang.String convertSandUILinksToAnchors(java.lang.String value)
          Convert links within a SandUI as specified in the UIFormAdaptor conventions.
protected  java.lang.String convertToHTML(java.lang.String text, org.sandev.basics.util.UIFormOwner owner)
          Convert the given text to HTML.
protected  java.lang.String convertToXML(java.lang.String text, org.sandev.basics.util.UIFormOwner owner)
          Convert the given text to XML.
static void describeAccess(org.sandev.basics.util.UIFormContext uifc, java.io.File outfile)
          If the output area is access protected, then provide some information about what login information to use.
protected  void dumpChromacodingKey(java.io.PrintWriter out, org.sandev.basics.util.AuthUser user)
          Write out the chromacoding key explanation and generation time info.
protected  void dumpPlanComponent(java.io.PrintWriter out, PlanTreeElement elem, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser user, HeapAttributes ha)
           
protected  void dumpPlanTreeElement(java.io.PrintWriter out, PlanTreeElement elem, java.lang.String indent, boolean recurse, HeapAttributes ha)
          Write out the given PlanTreeElement and its children recursively.
protected  void dumpReport(java.io.PrintWriter out, PlanTreeElement heap, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser user, HeapAttributes ha)
          Dump the entire TaskHeap to a Writer as a single web page.
protected  void dumpTOCAccess(java.io.PrintWriter out)
          Dump out a link to return to the top of the page.
protected  void getNoteSummary(java.lang.StringBuffer out, Note[] notes, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser authUser, boolean asXML, PlanComponentInterface parent)
          Dump out a note summary into the given buffer.
 org.sandev.basics.util.UIFormContext heapReport(org.sandev.basics.util.UIFormContext uifc, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser user, PlanTreeElement heap, java.io.PrintWriter out)
          Write the entire TaskHeap as a single web page for easy offline reference or CVS storage.
 org.sandev.basics.util.UIFormContext heapReport(org.sandev.basics.util.UIFormContext uifc, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser user, PlanTreeElement heap, java.lang.String subdirname, java.lang.String reportfilename)
          Write out the entire TaskHeap as a single web page for easy offline reference or CVS storage.
static void writeXHTMLFooter(java.io.PrintWriter out)
          Write out standard XHTML footer information.
static void writeXHTMLHeader(java.io.PrintWriter out, java.lang.String title)
          Write out standard XHTML header information with the given title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportWriter

public ReportWriter()
Method Detail

heapReport

public org.sandev.basics.util.UIFormContext heapReport(org.sandev.basics.util.UIFormContext uifc,
                                                       org.sandev.basics.util.UIFormOwner owner,
                                                       org.sandev.basics.util.AuthUser user,
                                                       PlanTreeElement heap,
                                                       java.lang.String subdirname,
                                                       java.lang.String reportfilename)
                                                throws org.sandev.basics.util.UIFormManagerException
Write out the entire TaskHeap as a single web page for easy offline reference or CVS storage.

Throws:
org.sandev.basics.util.UIFormManagerException

describeAccess

public static void describeAccess(org.sandev.basics.util.UIFormContext uifc,
                                  java.io.File outfile)
If the output area is access protected, then provide some information about what login information to use. This looks for a .logintxt file holding username:password and adds this info to the uifc if found.

This exists to avoid the scenario where a resource has exported the data and then has no idea how to access the resulting link since the general data access username/password was set up by an admin. Unless the admin wants write-only access, then it helps to provide the access info at the time when the file is exported.


heapReport

public org.sandev.basics.util.UIFormContext heapReport(org.sandev.basics.util.UIFormContext uifc,
                                                       org.sandev.basics.util.UIFormOwner owner,
                                                       org.sandev.basics.util.AuthUser user,
                                                       PlanTreeElement heap,
                                                       java.io.PrintWriter out)
                                                throws org.sandev.basics.util.UIFormManagerException,
                                                       java.io.IOException
Write the entire TaskHeap as a single web page for easy offline reference or CVS storage.

Throws:
org.sandev.basics.util.UIFormManagerException
java.io.IOException

dumpReport

protected void dumpReport(java.io.PrintWriter out,
                          PlanTreeElement heap,
                          org.sandev.basics.util.UIFormOwner owner,
                          org.sandev.basics.util.AuthUser user,
                          HeapAttributes ha)
                   throws java.io.IOException,
                          org.sandev.basics.util.UIFormManagerException
Dump the entire TaskHeap to a Writer as a single web page.

Throws:
java.io.IOException
org.sandev.basics.util.UIFormManagerException

writeXHTMLHeader

public static void writeXHTMLHeader(java.io.PrintWriter out,
                                    java.lang.String title)
                             throws java.io.IOException
Write out standard XHTML header information with the given title.

Throws:
java.io.IOException

writeXHTMLFooter

public static void writeXHTMLFooter(java.io.PrintWriter out)
                             throws java.io.IOException
Write out standard XHTML footer information.

Throws:
java.io.IOException

dumpPlanTreeElement

protected void dumpPlanTreeElement(java.io.PrintWriter out,
                                   PlanTreeElement elem,
                                   java.lang.String indent,
                                   boolean recurse,
                                   HeapAttributes ha)
Write out the given PlanTreeElement and its children recursively.


dumpChromacodingKey

protected void dumpChromacodingKey(java.io.PrintWriter out,
                                   org.sandev.basics.util.AuthUser user)
Write out the chromacoding key explanation and generation time info.


dumpPlanComponent

protected void dumpPlanComponent(java.io.PrintWriter out,
                                 PlanTreeElement elem,
                                 org.sandev.basics.util.UIFormOwner owner,
                                 org.sandev.basics.util.AuthUser user,
                                 HeapAttributes ha)
                          throws org.sandev.basics.util.UIFormManagerException
Throws:
org.sandev.basics.util.UIFormManagerException

dumpTOCAccess

protected void dumpTOCAccess(java.io.PrintWriter out)
Dump out a link to return to the top of the page.


convertToHTML

protected java.lang.String convertToHTML(java.lang.String text,
                                         org.sandev.basics.util.UIFormOwner owner)
Convert the given text to HTML.


convertToXML

protected java.lang.String convertToXML(java.lang.String text,
                                        org.sandev.basics.util.UIFormOwner owner)
Convert the given text to XML.


convertSandUILinksToAnchors

protected java.lang.String convertSandUILinksToAnchors(java.lang.String value)
Convert links within a SandUI as specified in the UIFormAdaptor conventions. Replacement groups:


getNoteSummary

protected void getNoteSummary(java.lang.StringBuffer out,
                              Note[] notes,
                              org.sandev.basics.util.UIFormOwner owner,
                              org.sandev.basics.util.AuthUser authUser,
                              boolean asXML,
                              PlanComponentInterface parent)
                       throws org.sandev.basics.util.UIFormManagerException
Dump out a note summary into the given buffer.

Throws:
org.sandev.basics.util.UIFormManagerException