uk.ac.ebi.intact.application.hierarchView.business
Class IntactUser

java.lang.Object
  |
  +--uk.ac.ebi.intact.application.hierarchView.business.IntactUser
All Implemented Interfaces:
java.util.EventListener, javax.servlet.http.HttpSessionBindingListener, IntactUserI, IntactUserI, java.io.Serializable

public class IntactUser
extends java.lang.Object
implements IntactUserI

This class stores information about an Intact Web user session.
Instead of binding multiple objects, only an object of this class is bound to a session, thus serving a single access point for multiple information.

This class implements the HttpSessionBindingListener interface for it can be notified of session time outs.

Version:
$Id: IntactUser.java,v 1.32 2003/11/14 11:07:36 skerrien Exp $
Author:
Samuel Kerrien (skerrien@ebi.ac.uk)
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface uk.ac.ebi.intact.application.hierarchView.business.IntactUserI
GRAPH_PROPERTIES, GRAPH2MIF_PROPERTIES, HIGHLIGHTING_PROPERTIES, SEARCH_PROPERTIES, WEB_SERVICE_PROPERTIES
 
Constructor Summary
IntactUser(java.lang.String applicationPath)
          Constructs an instance of this class with given mapping file and the name of the data source class.
 
Method Summary
 void addHighlightOption(java.lang.String name, java.lang.Object value)
          Add a new option in the option set.
That new option is referenced by its name
 boolean clickBehaviourIsAdd()
          is the current behaviour is to Add when the user click on the image map
 boolean clickBehaviourIsCenter()
          is the current behaviour is to Center the view when the user click on the image map
 void desacreaseDepth()
          Desacrease the depth of the interraction network up to the defined minimum.
 java.lang.String getApplicationPath()
           
 java.lang.String getBehaviour()
           
 int getCurrentDepth()
           
 java.lang.String getDatabaseName()
          The name of the database connected to.
 IntactHelper getHelper()
           
 java.lang.Object getHighlightOption(java.lang.String name)
          Get the value associated to the option name.
 ImageBean getImageBean()
           
 InteractionNetwork getInteractionNetwork()
           
 java.util.Collection getKeys()
           
 int getMaximalDepth()
           
 java.lang.String getMethodClass()
           
 java.lang.String getMethodLabel()
           
 int getMinimalDepth()
           
 java.lang.String getQueryString()
           
 java.lang.String getSearchUrl()
           
 java.lang.String getSearchUrl(java.lang.String query, boolean addFullContext)
           
 java.lang.String getSelectedKey()
           
 java.lang.String getSourceURL()
           
 java.lang.String getUserName()
          Returns the Intact user.
 boolean hasSourceUrlToDisplay()
           
 void increaseDepth()
          Increase the depth of the interraction network up to the defined maximum.
 void init()
          Set the default value of user's data
 boolean InteractionNetworkReadyToBeDisplayed()
          Allows the user to know if an interaction network will be displayed
 boolean InteractionNetworkReadyToBeHighlighted()
          Allows the user to know if an interaction network is ready to be highlighted.
 boolean maximalDepthReached()
          says if the current depth is maximal
 boolean minimalDepthReached()
          says if the current depth is minimal
 void resetHighlightOptions()
          Clear all highlight options.
 void resetSourceURL()
           
 java.util.Collection search(java.lang.String objectType, java.lang.String searchParam, java.lang.String searchValue)
          This method provides a means of searching intact objects, within the constraints provided by the parameters to the method.
 void setBehaviour(java.lang.String behaviour)
           
 void setClickBehaviour(ClickBehaviourForm form)
           
 void setCurrentDepth(int depth)
           
 void setDepthToDefault()
           
 void setImageBean(ImageBean imageBean)
           
 void setInteractionNetwork(InteractionNetwork in)
           
 void setKeys(java.util.Collection keys)
           
 void setMethodClass(java.lang.String methodClass)
           
 void setMethodLabel(java.lang.String methodLabel)
           
 void setQueryString(java.lang.String queryString)
           
 void setSelectedKey(java.lang.String key)
           
 void setSourceURL(java.lang.String aSourceURL)
           
 InteractionNetwork subGraph(InteractionNetwork in, int graphDepth, java.util.Collection experiments, int complexExpansion)
          Returns a subgraph centered on startNode (stored in the interaction network).
 void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
          Will call this method when an object is bound to a session.
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
          Will call this method when an object is unbound from a session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntactUser

public IntactUser(java.lang.String applicationPath)
           throws DataSourceException,
                  IntactException
Constructs an instance of this class with given mapping file and the name of the data source class.

Parameters:
applicationPath - the current application path
Throws:
DataSourceException - for error in getting the data source; this could be due to the errors in repository files or the underlying persistent mechanism rejected user and password combination.
IntactException - thrown for any error in creating lists such as topics, database names etc.
Method Detail

getQueryString

public java.lang.String getQueryString()
Specified by:
getQueryString in interface IntactUserI

getApplicationPath

public java.lang.String getApplicationPath()
Specified by:
getApplicationPath in interface IntactUserI

getCurrentDepth

public int getCurrentDepth()
Specified by:
getCurrentDepth in interface IntactUserI

getMinimalDepth

public int getMinimalDepth()

getMaximalDepth

public int getMaximalDepth()

minimalDepthReached

public boolean minimalDepthReached()
says if the current depth is minimal

Specified by:
minimalDepthReached in interface IntactUserI
Returns:
boolean true is the current depth is minimal, esle false.

maximalDepthReached

public boolean maximalDepthReached()
says if the current depth is maximal

Specified by:
maximalDepthReached in interface IntactUserI
Returns:
boolean true is the current depth is maximal, esle false.

getMethodLabel

public java.lang.String getMethodLabel()
Specified by:
getMethodLabel in interface IntactUserI

getMethodClass

public java.lang.String getMethodClass()
Specified by:
getMethodClass in interface IntactUserI

getBehaviour

public java.lang.String getBehaviour()
Specified by:
getBehaviour in interface IntactUserI

InteractionNetworkReadyToBeDisplayed

public boolean InteractionNetworkReadyToBeDisplayed()
Allows the user to know if an interaction network will be displayed

Specified by:
InteractionNetworkReadyToBeDisplayed in interface IntactUserI
Returns:

InteractionNetworkReadyToBeHighlighted

public boolean InteractionNetworkReadyToBeHighlighted()
Allows the user to know if an interaction network is ready to be highlighted. i.e. all data needed to highlight the current interaction network are available.

Specified by:
InteractionNetworkReadyToBeHighlighted in interface IntactUserI
Returns:
boolean true if the interaction network can be highlighted, esle false.

setClickBehaviour

public void setClickBehaviour(ClickBehaviourForm form)
Specified by:
setClickBehaviour in interface IntactUserI

clickBehaviourIsAdd

public boolean clickBehaviourIsAdd()
is the current behaviour is to Add when the user click on the image map

Specified by:
clickBehaviourIsAdd in interface IntactUserI
Returns:
true if Add the view is the current behaviour

clickBehaviourIsCenter

public boolean clickBehaviourIsCenter()
is the current behaviour is to Center the view when the user click on the image map

Specified by:
clickBehaviourIsCenter in interface IntactUserI
Returns:
true if Center the view is the current behaviour

getInteractionNetwork

public InteractionNetwork getInteractionNetwork()
Specified by:
getInteractionNetwork in interface IntactUserI

getImageBean

public ImageBean getImageBean()
Specified by:
getImageBean in interface IntactUserI

getKeys

public java.util.Collection getKeys()
Specified by:
getKeys in interface IntactUserI

getSelectedKey

public java.lang.String getSelectedKey()
Specified by:
getSelectedKey in interface IntactUserI

getHelper

public IntactHelper getHelper()
Specified by:
getHelper in interface IntactUserI

getSourceURL

public java.lang.String getSourceURL()
Specified by:
getSourceURL in interface IntactUserI

hasSourceUrlToDisplay

public boolean hasSourceUrlToDisplay()
Specified by:
hasSourceUrlToDisplay in interface IntactUserI

setQueryString

public void setQueryString(java.lang.String queryString)
Specified by:
setQueryString in interface IntactUserI

increaseDepth

public void increaseDepth()
Increase the depth of the interraction network up to the defined maximum.

Specified by:
increaseDepth in interface IntactUserI

desacreaseDepth

public void desacreaseDepth()
Desacrease the depth of the interraction network up to the defined minimum.

Specified by:
desacreaseDepth in interface IntactUserI

setDepthToDefault

public void setDepthToDefault()
Specified by:
setDepthToDefault in interface IntactUserI

setMethodLabel

public void setMethodLabel(java.lang.String methodLabel)
Specified by:
setMethodLabel in interface IntactUserI

setMethodClass

public void setMethodClass(java.lang.String methodClass)
Specified by:
setMethodClass in interface IntactUserI

setBehaviour

public void setBehaviour(java.lang.String behaviour)
Specified by:
setBehaviour in interface IntactUserI

setInteractionNetwork

public void setInteractionNetwork(InteractionNetwork in)
Specified by:
setInteractionNetwork in interface IntactUserI

setImageBean

public void setImageBean(ImageBean imageBean)
Specified by:
setImageBean in interface IntactUserI

setKeys

public void setKeys(java.util.Collection keys)
Specified by:
setKeys in interface IntactUserI

setSelectedKey

public void setSelectedKey(java.lang.String key)
Specified by:
setSelectedKey in interface IntactUserI

setSourceURL

public void setSourceURL(java.lang.String aSourceURL)
Specified by:
setSourceURL in interface IntactUserI

resetSourceURL

public void resetSourceURL()
Specified by:
resetSourceURL in interface IntactUserI

init

public void init()
Set the default value of user's data

Specified by:
init in interface IntactUserI

subGraph

public InteractionNetwork subGraph(InteractionNetwork in,
                                   int graphDepth,
                                   java.util.Collection experiments,
                                   int complexExpansion)
                            throws IntactException
Returns a subgraph centered on startNode (stored in the interaction network). The subgraph will contain all nodes which are up to graphDepth interactions away from startNode. Only Interactions which belong to one of the Experiments in experiments will be taken into account. If experiments is empty, all Interactions are taken into account. Graph depth: This parameter limits the size of the returned interaction graph. All baits are shown with all the interacting preys, even if they would normally be on the "rim" of the graph. Therefore the actual diameter of the graph may be 2*(graphDepth+1). Expansion: If an Interaction has more than two interactors, it has to be defined how pairwise interactions are generated from the complex data. The possible values are defined in the beginning of this file.

Specified by:
subGraph in interface IntactUserI
Parameters:
in - - the interaction network.
graphDepth - - depth of the graph
experiments - - Experiments which should be taken into account
complexExpansion - - Mode of expansion of complexes into pairwise interactions
Returns:
a InteractionNetwork object.
Throws:
IntactException - - thrown if problems are encountered

resetHighlightOptions

public void resetHighlightOptions()
Description copied from interface: IntactUserI
Clear all highlight options.

Specified by:
resetHighlightOptions in interface IntactUserI

addHighlightOption

public void addHighlightOption(java.lang.String name,
                               java.lang.Object value)
Description copied from interface: IntactUserI
Add a new option in the option set.
That new option is referenced by its name

Specified by:
addHighlightOption in interface IntactUserI
Parameters:
name - name of the option
value - value taken by the option

getHighlightOption

public java.lang.Object getHighlightOption(java.lang.String name)
Description copied from interface: IntactUserI
Get the value associated to the option name.

Specified by:
getHighlightOption in interface IntactUserI
Parameters:
name - the name of the option we want the value
Returns:
the value associated to the name

setCurrentDepth

public void setCurrentDepth(int depth)
Specified by:
setCurrentDepth in interface IntactUserI

getSearchUrl

public java.lang.String getSearchUrl(java.lang.String query,
                                     boolean addFullContext)
Specified by:
getSearchUrl in interface IntactUserI

getSearchUrl

public java.lang.String getSearchUrl()
Specified by:
getSearchUrl in interface IntactUserI

valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
Will call this method when an object is bound to a session. Not doing anything.

Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
Will call this method when an object is unbound from a session.

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener

search

public java.util.Collection search(java.lang.String objectType,
                                   java.lang.String searchParam,
                                   java.lang.String searchValue)
                            throws IntactException
Description copied from interface: IntactUserI
This method provides a means of searching intact objects, within the constraints provided by the parameters to the method.

Specified by:
search in interface IntactUserI
Parameters:
objectType - the object type to be searched
searchParam - the parameter to search on (eg field)
searchValue - the search value to match with the parameter
Returns:
the results of the search (empty if no matches were found).
Throws:
IntactException - thrown if problems are encountered during the search process.

getUserName

public java.lang.String getUserName()
Description copied from interface: IntactUserI
Returns the Intact user.

Specified by:
getUserName in interface IntactUserI
Returns:
the Intact user currently logged in. This methods could return null if there is no user associated with the current session (e.g., Editor) or for errors in retrieving user information from the database.

getDatabaseName

public java.lang.String getDatabaseName()
Description copied from interface: IntactUserI
The name of the database connected to.

Specified by:
getDatabaseName in interface IntactUserI
Returns:
the name of the database. Could be null for an error in getting the information from the database.


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