uk.ac.ebi.intact.application.editor.struts.view.experiment
Class ExperimentViewBean

java.lang.Object
  |
  +--uk.ac.ebi.intact.application.editor.struts.framework.util.AbstractEditViewBean
        |
        +--uk.ac.ebi.intact.application.editor.struts.view.experiment.ExperimentViewBean
All Implemented Interfaces:
java.io.Serializable

public class ExperimentViewBean
extends AbstractEditViewBean

Experiment edit view bean.

Version:
$Id: ExperimentViewBean.java,v 1.37 2004/03/30 21:24:52 smudali Exp $
Author:
Sugath Mudali (smudali@ebi.ac.uk)
See Also:
Serialized Form

Constructor Summary
ExperimentViewBean()
           
 
Method Summary
 void addInteraction(Interaction inter)
          Adds an Interaction.
 void addInteractionToHold(java.util.Collection ints)
          Adds an Interaction to hold if the new interaction doesn't already exists in the interaction hold collection and in the current interaction collection for this experiment.
 void addToRecentList(EditUserI user)
          Adds the current edit object to the recent edited item list.
 void clear()
          Deletes all the links to sub objects of the current edit object.
 void clearInteractionToHold()
          Clears all the interactions on hold.
 void clearTransactions()
          Clears any pending xrefs and annotations stored in the transaction containers.
 void delInteraction(Interaction inter)
          Removes an Interaction
 java.lang.String getHelpTag()
          Returns the help tag link for the current view bean; subclasses must override this method to return the help tag (if necessary) or else the link to the CV editor is returned.
 int getHoldInteractionCount()
          Returns the number of interactions in the hold interaction collection.
 java.util.List getHoldInteractions()
          Returns a collection of Interaction objects on hold.
 java.lang.String getIdent()
           
 java.util.List getIdentMenu()
          The idetification menu list.
 java.lang.String getInter()
           
 java.util.List getInteractions()
          Returns a collection of Interactions for the current experiment.
 java.util.List getInterMenu()
          The interaction menu list.
 int getNumberOfInteractions()
          Returns the number of interactions for this experiment.
 java.lang.String getOrganism()
           
 java.util.List getOrganismMenu()
          The organism menu list.
 java.lang.Boolean getReadOnly()
          False as this object is editable.
 void hideInteractionToHold(Interaction inter)
          Hides an Interaction bean from hold.
 void removeFromRecentList(EditUserI user)
          Removes the current edit object from the recent edited item list.
protected  void reset(AnnotatedObject annobj)
          Resets with the bean using an existing Annotated object.
protected  void reset(java.lang.Class clazz)
          Resets the bean with the current edit class.
 void sanityCheck(EditUserI user)
          Performs sanity check on a bean.
 void setIdent(java.lang.String identification)
           
 void setInter(java.lang.String interaction)
           
 void setLayout(org.apache.struts.tiles.ComponentContext context)
          Sets the layout in given context.
 void setOrganism(java.lang.String organism)
           
protected  void updateAnnotatedObject(EditUserI user)
          Gathers values in the view bean and updates the existing AnnotatedObject if it exists or create a new annotated object for the view and sets the annotated object.
 void updateFromForm(org.apache.struts.action.DynaActionForm dynaform)
          Updates the internal data from given form.
 void validate(EditUserI user)
          Validates the data in the view bean.
 
Methods inherited from class uk.ac.ebi.intact.application.editor.struts.framework.util.AbstractEditViewBean
addAnnotation, addXref, delAnnotation, delXref, equals, getAc, getAcLink, getAddDatabaseMenu, getAddTopicMenu, getAddXrefMenus, getAnnotatedObject, getAnnotations, getDefaultXrefQualifier, getEditClass, getEditDatabaseMenu, getEditorMenus, getEditTopicMenu, getEditXrefMenus, getFullName, getMenuFactory, getShortLabel, getXrefs, persist, persistOthers, reset, saveComment, saveXref, setAnnotatedObject, setFullName, setMenuFactory, setShortLabel
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExperimentViewBean

public ExperimentViewBean()
Method Detail

reset

protected void reset(java.lang.Class clazz)
Description copied from class: AbstractEditViewBean
Resets the bean with the current edit class. This method is called when creating a new annotated object (only the class or the type is known at that time).

Overrides:
reset in class AbstractEditViewBean
Parameters:
clazz - the Class of the new annotated object.

reset

protected void reset(AnnotatedObject annobj)
Description copied from class: AbstractEditViewBean
Resets with the bean using an existing Annotated object.

Overrides:
reset in class AbstractEditViewBean
Parameters:
annobj - AnnotatedObject object to set this bean.

updateAnnotatedObject

protected void updateAnnotatedObject(EditUserI user)
                              throws SearchException
Description copied from class: AbstractEditViewBean
Gathers values in the view bean and updates the existing AnnotatedObject if it exists or create a new annotated object for the view and sets the annotated object.

Specified by:
updateAnnotatedObject in class AbstractEditViewBean
Parameters:
user - to access the persistent system.
Throws:
SearchException - for errors in searching the persistent system.
 post: getAnnotatedObject() != null
 

addToRecentList

public void addToRecentList(EditUserI user)
Description copied from class: AbstractEditViewBean
Adds the current edit object to the recent edited item list. Interaction or Experiment beans must override this method.

Overrides:
addToRecentList in class AbstractEditViewBean
Parameters:
user - the user handle to add to the recent list.

removeFromRecentList

public void removeFromRecentList(EditUserI user)
Description copied from class: AbstractEditViewBean
Removes the current edit object from the recent edited item list. Interaction or Experiment beans must override this method.

Overrides:
removeFromRecentList in class AbstractEditViewBean
Parameters:
user - the user handle to remove from the recent list.

setLayout

public void setLayout(org.apache.struts.tiles.ComponentContext context)
Description copied from class: AbstractEditViewBean
Sets the layout in given context. This method is currently empty as the layout defaults to cv layout. Override this method to provide editor specific layout.

Overrides:
setLayout in class AbstractEditViewBean
Parameters:
context - the Tiles context to set the layout.

getHelpTag

public java.lang.String getHelpTag()
Description copied from class: AbstractEditViewBean
Returns the help tag link for the current view bean; subclasses must override this method to return the help tag (if necessary) or else the link to the CV editor is returned.

Overrides:
getHelpTag in class AbstractEditViewBean
Returns:
the tag as a String for the current view bean.

updateFromForm

public void updateFromForm(org.apache.struts.action.DynaActionForm dynaform)
Description copied from class: AbstractEditViewBean
Updates the internal data from given form.

Overrides:
updateFromForm in class AbstractEditViewBean
Parameters:
dynaform - the form to update the internal data.

getReadOnly

public java.lang.Boolean getReadOnly()
Description copied from class: AbstractEditViewBean
False as this object is editable. Sublcasses such as ExperimentViewBean must override this method if it has a large number of interactions. This method is used by actions.jsp to disable saving a large Intact object.

Overrides:
getReadOnly in class AbstractEditViewBean
Returns:
false as all the edit beans are editable by default.

sanityCheck

public void sanityCheck(EditUserI user)
                 throws ValidationException,
                        SearchException
Description copied from class: AbstractEditViewBean
Performs sanity check on a bean. Currently this method doesn't provide checks. Subclass must override this method to provide checks relevant to a view bean.

Overrides:
sanityCheck in class AbstractEditViewBean
Throws:
SearchException - for errors in searching for objects in the persistent system.
ValidationException - if sanity check fails.

validate

public void validate(EditUserI user)
              throws ValidationException,
                     SearchException
Description copied from class: AbstractEditViewBean
Validates the data in the view bean.

Overrides:
validate in class AbstractEditViewBean
Parameters:
user - handler to the user to access the DB.
Throws:
ValidationException - thrown when this bean contains invalid data. For example, an experiment must contain non null values for organism, interaction and identification. Currently this method is empty as no validations are preformed.
SearchException

clear

public void clear()
Description copied from class: AbstractEditViewBean
Deletes all the links to sub objects of the current edit object.

Overrides:
clear in class AbstractEditViewBean

getOrganismMenu

public java.util.List getOrganismMenu()
                               throws SearchException
The organism menu list.

Returns:
the organism menu consisting of organism short labels. The first item in the menu may contain '---Select---' if the current organism is not set.
Throws:
SearchException - for errors in generating menus.

getInterMenu

public java.util.List getInterMenu()
                            throws SearchException
The interaction menu list.

Returns:
the interaction menu consisting of interaction short labels. The first item in the menu may contain '---Select---' if the current interaction is not set.
Throws:
SearchException - for errors in generating menus.

getIdentMenu

public java.util.List getIdentMenu()
                            throws SearchException
The idetification menu list.

Returns:
the idetification menu consisting of idetification short labels. The first item in the menu may contain '---Select---' if the current idetification is not set.
Throws:
SearchException - for errors in generating menus.

getOrganism

public java.lang.String getOrganism()

setOrganism

public void setOrganism(java.lang.String organism)

getInter

public java.lang.String getInter()

setInter

public void setInter(java.lang.String interaction)

getIdent

public java.lang.String getIdent()

setIdent

public void setIdent(java.lang.String identification)

addInteraction

public void addInteraction(Interaction inter)
Adds an Interaction.

Parameters:
inter - the Interaction to add.
 post: myInteractionsToAdd = myInteractionsToAdd@pre + 1
 post: myInteractions = myInteractions@pre + 1
 

delInteraction

public void delInteraction(Interaction inter)
Removes an Interaction

Parameters:
inter - the Interaction to remove.
 post: myInteractionsToDel = myInteractionsToDel@pre - 1
 post: myInteractions = myInteractions@pre - 1
 

addInteractionToHold

public void addInteractionToHold(java.util.Collection ints)
Adds an Interaction to hold if the new interaction doesn't already exists in the interaction hold collection and in the current interaction collection for this experiment.

Parameters:
ints - a collection of Interaction to add.
 pre:  forall(obj : Object | obj.oclIsTypeOf(Interaction))
 

getInteractions

public java.util.List getInteractions()
Returns a collection of Interactions for the current experiment.
 post: return != null
 post: return->forall(obj : Object | obj.oclIsTypeOf(Interaction))
 


getHoldInteractions

public java.util.List getHoldInteractions()
Returns a collection of Interaction objects on hold.
 post: return != null
 post: return->forall(obj : Object | obj.oclIsTypeOf(Interaction))
 


getHoldInteractionCount

public int getHoldInteractionCount()
Returns the number of interactions in the hold interaction collection.

Returns:
the number of interactions in the hold interaction collection.

hideInteractionToHold

public void hideInteractionToHold(Interaction inter)
Hides an Interaction bean from hold.

Parameters:
inter - an Interaction to hide.
 pre: myInteractionsToHold->includes(intbean)
 post: myInteractionsToHold = myInteractionsToHold@pre - 1
 

clearInteractionToHold

public void clearInteractionToHold()
Clears all the interactions on hold.


clearTransactions

public void clearTransactions()
Description copied from class: AbstractEditViewBean
Clears any pending xrefs and annotations stored in the transaction containers.
 post: myAnnotsToAdd->isEmpty
 post: myAnnotsToDel->isEmpty
 post: myAnnotsToUpdate->isEmpty
 post: myXrefsToAdd->isEmpty
 post: myXrefsToDel->isEmpty
 post: myXrefsToUpdate->isEmpty
 

Overrides:
clearTransactions in class AbstractEditViewBean

getNumberOfInteractions

public int getNumberOfInteractions()
Returns the number of interactions for this experiment.

Returns:
the number of interactions for this experiment.


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