uk.ac.ebi.intact.application.search2.struts.view.html
Class HtmlBuilder

java.lang.Object
  |
  +--uk.ac.ebi.intact.application.search2.struts.view.html.HtmlBuilder

public class HtmlBuilder
extends java.lang.Object

This class generates an HTML view of search results.

This should be used from within the Web framework. The main method only serves as a usage example and for quick development.

For each request, one HtmlBuilder object should be instantiated.

There is one public htmlView method for each of the major IntAct classes:
AnnotatedObject, Experiment, Interaction, Protein.
Each of these normally call
htmlViewHead: Display the object's "administrative data"
htmlViewData: Display the object's attributes
htmlViewAnnotation: Display annotation
htmlViewXref: Display xrefs
Rest of the htmlView method: Display additional "bulk" data,
e.g. the list of interactors for an Interaction, or the amino acid sequence for a Protein.

Private html* methods display partial objects which need to be surrounded by the appropriate context.

htmlViewPartial methods indicate that this method only displays an object partially, usually used in the context of another htmlView. Example: htmlViewPartial(CvObject) will only display the hyperlinked shortLabel, while htmlView(CvObject) shows the full object on its own.

Layout: The Layout is based on a table layout with four columns in all tables.

Status: The "experiment" view is produced.

todo: specific htmlView for BioSource, CvDagObject

Version:
$Id: HtmlBuilder.java,v 1.16 2004/03/19 11:23:45 clewing Exp $
Author:
Henning Hermjakob, hhe@ebi.ac.uk

Field Summary
static int MAX_CHUNK_IN_INDEX
           
 
Constructor Summary
HtmlBuilder(java.io.Writer writer, java.util.Set highlight, java.lang.String link, java.lang.String contextPath)
          Instantiate a new view object
 
Method Summary
 void buildChunkIndex(java.lang.Object object, java.lang.String link, int currentChunk, int maxChunk, int objectCount, java.lang.String chunkedObjectType)
          Display the chunk index.
 void htmlView(AnnotatedObject anAnnotatedObject)
          The default html view for an AnnotatedObject.
 void htmlView(BinaryDetailsViewBean.BinaryData binaryData)
          Displays a interaction partner table for BinaryData data structure.
 void htmlView(BioSource bioSource)
          TODO as to be refined
 void htmlView(CvComponentRole componentRole)
          TODO as to be refined
 void htmlView(CvDatabase cvDatabase)
          TODO as to be refined
 void htmlView(CvIdentification cvIdentification)
          TODO as to be refined
 void htmlView(CvInteraction interaction)
          TODO as to be refined
 void htmlView(CvInteractionType interactionType)
          TODO as to be refined
 void htmlView(CvTopic topic)
          TODO as to be refined
 void htmlView(CvXrefQualifier qualifier)
          TODO as to be refined
 void htmlView(Experiment ex)
          HTML view of an experiment.
 void htmlView(Interaction act)
          HTML view of an Interaction object.
 void htmlView(InteractionImpl act)
          HTML view of an InteractionProxy object.
 void htmlView(Protein aProtein)
          HTML view of a Protein object.
 void htmlView(ProteinImpl aProtein)
          HTML view of a ProteinProxy object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_CHUNK_IN_INDEX

public static final int MAX_CHUNK_IN_INDEX
See Also:
Constant Field Values
Constructor Detail

HtmlBuilder

public HtmlBuilder(java.io.Writer writer,
                   java.util.Set highlight,
                   java.lang.String link,
                   java.lang.String contextPath)
Instantiate a new view object

Parameters:
writer - The Writer all html output is written to.
highlight - A HashSet containing all shortLabels which should be highlighted in the result set.
link - the link to the help page.
Method Detail

htmlView

public void htmlView(AnnotatedObject anAnnotatedObject)
              throws java.io.IOException
The default html view for an AnnotatedObject.

Parameters:
anAnnotatedObject -
Throws:
java.io.IOException

htmlView

public void htmlView(BinaryDetailsViewBean.BinaryData binaryData)
              throws java.io.IOException
Displays a interaction partner table for BinaryData data structure.

Parameters:
binaryData - representation of the interaction partners.
Throws:
java.io.IOException

htmlView

public void htmlView(ProteinImpl aProtein)
              throws java.io.IOException
HTML view of a ProteinProxy object.
Just forward to the Protein view.

Parameters:
aProtein -
Throws:
java.io.IOException

htmlView

public void htmlView(Protein aProtein)
              throws java.io.IOException
HTML view of a Protein object.

Parameters:
aProtein -
Throws:
java.io.IOException

htmlView

public void htmlView(CvDatabase cvDatabase)
              throws java.io.IOException
TODO as to be refined

Parameters:
cvDatabase -
Throws:
java.io.IOException

htmlView

public void htmlView(CvXrefQualifier qualifier)
              throws java.io.IOException
TODO as to be refined

Parameters:
qualifier -
Throws:
java.io.IOException

htmlView

public void htmlView(BioSource bioSource)
              throws java.io.IOException
TODO as to be refined

Parameters:
bioSource -
Throws:
java.io.IOException

htmlView

public void htmlView(CvTopic topic)
              throws java.io.IOException
TODO as to be refined

Parameters:
topic -
Throws:
java.io.IOException

htmlView

public void htmlView(CvInteraction interaction)
              throws java.io.IOException
TODO as to be refined

Parameters:
interaction -
Throws:
java.io.IOException

htmlView

public void htmlView(CvInteractionType interactionType)
              throws java.io.IOException
TODO as to be refined

Parameters:
interactionType -
Throws:
java.io.IOException

htmlView

public void htmlView(CvComponentRole componentRole)
              throws java.io.IOException
TODO as to be refined

Parameters:
componentRole -
Throws:
java.io.IOException

htmlView

public void htmlView(CvIdentification cvIdentification)
              throws java.io.IOException
TODO as to be refined

Parameters:
cvIdentification -
Throws:
java.io.IOException

htmlView

public void htmlView(InteractionImpl act)
              throws java.io.IOException
HTML view of an InteractionProxy object.
Just forward to the Interaction view.

Parameters:
act -
Throws:
java.io.IOException

htmlView

public void htmlView(Interaction act)
              throws java.io.IOException
HTML view of an Interaction object.

Parameters:
act -
Throws:
java.io.IOException

htmlView

public void htmlView(Experiment ex)
              throws java.io.IOException
HTML view of an experiment.

Parameters:
ex -
Throws:
java.io.IOException

buildChunkIndex

public void buildChunkIndex(java.lang.Object object,
                            java.lang.String link,
                            int currentChunk,
                            int maxChunk,
                            int objectCount,
                            java.lang.String chunkedObjectType)
                     throws java.io.IOException
Display the chunk index.
1. displays the context: "Results x to y of about z objects." 2. displays the chunk index table, it contains MAX_CHUNK_IN_INDEX chunk maximum.

Parameters:
object - the object for which we create that index of its chunk.
link - the help link
currentChunk - the user selected chunk to display
maxChunk - the maximum number of chunk (ie. objectCount / uk.ac.ebi.intact.application.search2.business.Constants.MAX_CHUNK_SIZE)
objectCount - the count of object (those we display in chunks).
chunkedObjectType - the type of the object we chunk. Used to give a context to the user.
Throws:
java.io.IOException


IntAct Project - EMBL-EBI 2004 - intact-help@ebi.ac.uk