uk.ac.ebi.intact.application.hierarchView.highlightment.source
Class HighlightmentSource

java.lang.Object
  |
  +--uk.ac.ebi.intact.application.hierarchView.highlightment.source.HighlightmentSource
Direct Known Subclasses:
GoHighlightmentSource

public abstract class HighlightmentSource
extends java.lang.Object

Abstract class allowing to wrap an highlightment source.

Author:
Samuel Kerrien (skerrien@ebi.ac.uk)

Constructor Summary
HighlightmentSource()
           
 
Method Summary
static HighlightmentSource getHighlightmentSource(java.lang.String aClassName)
          Provides a implementation of HighlightmentSource by its name.
abstract  java.lang.String getHtmlCodeOption(javax.servlet.http.HttpSession aSession)
          Return the html code for specific options of the source to be integrated in the highlighting form.
abstract  java.util.Collection getKeysFromIntAct(java.lang.String aProteinAC, javax.servlet.http.HttpSession aSession)
          Return a collection of keys specific to the selected protein and the current source.
abstract  java.util.List getSourceUrls(java.util.Collection xRefs, java.util.Collection selectedXRefs, java.lang.String applicationPath)
          Return a collection of URL corresponding to the selected protein and source eg.
abstract  java.util.Collection parseKeys(java.lang.String someKeys)
          Parse the set of key generate by the source and give back a collection of keys.
abstract  java.util.Collection proteinToHightlight(javax.servlet.http.HttpSession aSession, InteractionNetwork aGraph)
          Create a set of protein we must highlight in the graph given in parameter.
abstract  void saveOptions(javax.servlet.http.HttpServletRequest aRequest, javax.servlet.http.HttpSession aSession)
          Allows to update the session object with options stored in the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HighlightmentSource

public HighlightmentSource()
Method Detail

getHighlightmentSource

public static HighlightmentSource getHighlightmentSource(java.lang.String aClassName)
Provides a implementation of HighlightmentSource by its name. for example you have an implementation of this abstract class called : GoHighlightmentSource. so, you could call the following method to get an instance of this class :
HighlightmentSource.getHighlightmentSource ("mypackage.GoHighlightmentSource");
then you're able to use methods provided by this abstract class without to know what implementation you are using.

Parameters:
aClassName - the name of the implementation class you want to get
Returns:
an HighlightmentSource object, or null if an error occurs.

getHtmlCodeOption

public abstract java.lang.String getHtmlCodeOption(javax.servlet.http.HttpSession aSession)
Return the html code for specific options of the source to be integrated in the highlighting form. if the method return null, the source hasn't options.

Parameters:
aSession - the current session.
Returns:
the html code for specific options of the source.

getKeysFromIntAct

public abstract java.util.Collection getKeysFromIntAct(java.lang.String aProteinAC,
                                                       javax.servlet.http.HttpSession aSession)
Return a collection of keys specific to the selected protein and the current source. e.g. If the source is GO, we will send the collection of GO term owned by the given protein. Those informations are retreived from the Intact database

Parameters:
aProteinAC - a protein identifier (AC).
aSession - session in which we'll retreive the datasource
Returns:
a collection of keys

proteinToHightlight

public abstract java.util.Collection proteinToHightlight(javax.servlet.http.HttpSession aSession,
                                                         InteractionNetwork aGraph)
Create a set of protein we must highlight in the graph given in parameter. The protein selection is done according to the source keys stored in the IntactUser. Some options (specific to each implementation) could have been set and stored in the session, that method has to get them and care about.

Parameters:
aSession - the session where to find selected keys.
aGraph - the graph we want to highlight.
Returns:
a collection of nodes to highlight.

saveOptions

public abstract void saveOptions(javax.servlet.http.HttpServletRequest aRequest,
                                 javax.servlet.http.HttpSession aSession)
Allows to update the session object with options stored in the request. These parameters are specific of the implementation.

Parameters:
aRequest - request in which we have to get parameters to save in the session.
aSession - session in which we have to save the parameter.

getSourceUrls

public abstract java.util.List getSourceUrls(java.util.Collection xRefs,
                                             java.util.Collection selectedXRefs,
                                             java.lang.String applicationPath)
                                      throws IntactException
Return a collection of URL corresponding to the selected protein and source eg. produce a list of GO terms if GO is the source.
if the method send back no URL, the given parameter is wrong.

Parameters:
xRefs - The collection of XRef from which we want to get the list of corresponding URL
selectedXRefs - The collection of selected XRef
applicationPath - our application path
Returns:
a set of URL pointing on the highlightment source.
IntactException

parseKeys

public abstract java.util.Collection parseKeys(java.lang.String someKeys)
Parse the set of key generate by the source and give back a collection of keys.

Parameters:
someKeys - a string which contains some key separates by a character.
Returns:
the splitted version of the key string as a collection of String.


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