uk.ac.ebi.intact.application.editor.business
Interface EditUserI

All Superinterfaces:
IntactUserI, java.io.Serializable
All Known Implementing Classes:
EditUser

public interface EditUserI
extends IntactUserI, java.io.Serializable

Provides methods specific to a user editing an Annotated object.

Version:
$Id: EditUserI.java,v 1.37 2004/03/30 21:31:04 smudali Exp $
Author:
Sugath Mudali (smudali@ebi.ac.uk)

Method Summary
 void addToCurrentExperiment(Experiment exp)
          Adds the experiment to the currently edited/added experiment list.
 void addToCurrentInteraction(Interaction intact)
          Adds the interaction to the currently edited/added interaction list.
 void addToSearchCache(java.util.Collection results)
          Collection of AnnotatedObjects to add to the search cache.
 void begin()
           
 void cancelEdit()
           
 void commit()
           
 void create(java.lang.Object object)
           
 void delete()
          This method clears the view of the current edit object, remove it from the search cache, deletes from the experiment list (if the current edit is an instance of an Experiment class), tand finally delete the current edit object.
 void delete(java.lang.Object object)
           
 void fillSearchResult(org.apache.commons.beanutils.DynaBean dynaForm)
          Popluate the given form with search result.
 Annotation getAnnotation(CommentBean cb)
          Returns an Annotation constructed from the given bean.
 java.util.Set getCurrentExperiments()
          Returns a list of currently edited/added experiments.
 java.util.Set getCurrentInteractions()
          Returns a list of currently edited/added interactions.
 GoServerProxy getGoProxy()
          Returns the Go server proxy assigned for the current session.
 java.lang.String getHelpTag()
          Returns the help tag for the current view bean.
 Institution getInstitution()
          Returns the Institution.
 NewtServerProxy getNewtProxy()
          Returns the Newt server proxy assigned for the current session.
 java.lang.Object getObjectByAc(java.lang.Class clazz, java.lang.String ac)
          Return an Object by ac for given class.
 java.lang.Object getObjectByLabel(java.lang.Class clazz, java.lang.String label)
          Return an Object by classname and shortLabel.
 java.lang.Object getObjectByLabel(java.lang.String className, java.lang.String label)
          Return an Object by classname and shortLabel.
 java.lang.Exception getProteinParseException()
          Returns the last protein parse exception.
 java.lang.String getSearchQuery()
          Returns the latest search query.
 java.util.List getSearchResult()
          Returns the search result as a list.
 java.lang.String getSelectedTopic()
           
 java.util.Collection getSPTRProteins(java.lang.String pid)
          Gets SPTR Proteins via SRS.
 java.lang.String getUniqueShortLabel(java.lang.String shortlabel)
          Returns a unique short label.
 java.lang.String getUniqueShortLabel(java.lang.String shortlabel, java.lang.String extAc)
          Returns a unique short label.
 AbstractEditViewBean getView()
          Returns the user's current edit view.
 Xref getXref(XreferenceBean xb)
          Returns a new instance of Xref constructed from the given bean.
 boolean isEditing()
          Returns the state of editing.
 boolean isPersistent()
          True if the current edit object is persistent.
 boolean isPersistent(java.lang.Object obj)
          True if given object is persistent.
 java.util.Date loginTime()
           
 void logoff()
          Logs off from the application.
 java.util.Date logoffTime()
           
 java.util.Collection lookup(java.lang.String className, java.lang.String value)
          Utility method to handle the logic for lookup, ie trying AC, label etc.
 void persist()
          Persists the object the user is editing.
 void releaseLock()
          Releases the lock held by the user.
 void removeFromCurrentExperiment(Experiment exp)
          Removes the current experiment from the currently edited/added experiment list.
 void removeFromCurrentInteraction(Interaction intact)
          Removes the current interaction from the currently edited/added interaction list.
 void rollback()
           
 java.util.Collection search1(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 setSelectedTopic(java.lang.String topic)
           
 void setView(java.lang.Object obj)
          Sets the view using given object.
 boolean shortLabelExists(java.lang.String shortlabel)
          Check for duplicity of short label for the current edit object.
 void startEditing()
          Starts editing session.
 void update(java.lang.Object object)
           
 void updateSearchCache(AnnotatedObject annotobj)
          Clears existing search cache and replace it with given bean.
 
Methods inherited from interface uk.ac.ebi.intact.application.commons.business.IntactUserI
getDatabaseName, getUserName, search
 

Method Detail

getSelectedTopic

public java.lang.String getSelectedTopic()

setSelectedTopic

public void setSelectedTopic(java.lang.String topic)

getInstitution

public Institution getInstitution()
Returns the Institution.


isEditing

public boolean isEditing()
Returns the state of editing.

Returns:
true if the user is in edit screen; false is returned for all other instances.

startEditing

public void startEditing()
Starts editing session. This is needed for Save & Continue operation as editing is turned off automatically upon comitting.


begin

public void begin()
           throws IntactException
IntactException

commit

public void commit()
            throws IntactException
IntactException

rollback

public void rollback()
              throws IntactException
IntactException

create

public void create(java.lang.Object object)
            throws IntactException
IntactException

update

public void update(java.lang.Object object)
            throws IntactException
IntactException

delete

public void delete(java.lang.Object object)
            throws IntactException
IntactException

persist

public void persist()
             throws IntactException,
                    SearchException
Persists the object the user is editing.

Throws:
IntactException - for errors in updating the persistent system.
SearchException - for search errors (unable to find an object to update).

delete

public void delete()
            throws IntactException
This method clears the view of the current edit object, remove it from the search cache, deletes from the experiment list (if the current edit is an instance of an Experiment class), tand finally delete the current edit object.

Throws:
IntactException - for errors in deleting the current edit object.

cancelEdit

public void cancelEdit()

isPersistent

public boolean isPersistent(java.lang.Object obj)
True if given object is persistent.

Parameters:
obj - the object to check for persistency.
Returns:
true if obj is persistent.

isPersistent

public boolean isPersistent()
True if the current edit object is persistent. When a new edit object is created, it is not persistent until the form is submitted.

Returns:
true if the current edit object is persistent.

getView

public AbstractEditViewBean getView()
Returns the user's current edit view.

Returns:
user's current edit view.

setView

public void setView(java.lang.Object obj)
Sets the view using given object.

Parameters:
obj - either an Annotated object or a Class. The class type is used when creating a view for a new object. For an existing object, AnnotatedObject is used.

getObjectByLabel

public java.lang.Object getObjectByLabel(java.lang.String className,
                                         java.lang.String label)
                                  throws SearchException
Return an Object by classname and shortLabel.

Parameters:
className - the name of the class to search.
label - the short label to search for.
Throws:
SearchException - thrown for a search failure; also thrown if label already exists in className.

getObjectByLabel

public java.lang.Object getObjectByLabel(java.lang.Class clazz,
                                         java.lang.String label)
                                  throws SearchException
Return an Object by classname and shortLabel.

Parameters:
clazz - the class object to search.
label - the short label to search for.
Throws:
SearchException - thrown for a search failure; also thrown if label occurrs more than once for clazz.

getObjectByAc

public java.lang.Object getObjectByAc(java.lang.Class clazz,
                                      java.lang.String ac)
                               throws SearchException
Return an Object by ac for given class.

Parameters:
clazz - the class to search for.
ac - the accession number to search for.
Returns:
an Object of clazz type for ac.
Throws:
SearchException - thrown for a search failure; also thrown if ac occurs more than once for clazz; highly unlikely given that ac is the primary key!

getSPTRProteins

public java.util.Collection getSPTRProteins(java.lang.String pid)
Gets SPTR Proteins via SRS.

Parameters:
pid - the primary id to search for.
Returns:
collection of Protein instances for pid.

getProteinParseException

public java.lang.Exception getProteinParseException()
Returns the last protein parse exception.

Returns:
the last protein parse exception`.

search1

public java.util.Collection search1(java.lang.String objectType,
                                    java.lang.String searchParam,
                                    java.lang.String searchValue)
                             throws SearchException
This method provides a means of searching intact objects, within the constraints provided by the parameters to the method.

This method is named as search1 to avoid conflict with the similar named method (with diffrent exception) of the super interface.

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:
SearchException - thrown if problems are encountered during the search process.

lookup

public java.util.Collection lookup(java.lang.String className,
                                   java.lang.String value)
                            throws SearchException
Utility method to handle the logic for lookup, ie trying AC, label etc.

Parameters:
className - the intact type to search on
value - the user-specified value.
Returns:
Collection the results of the search - an empty Collection if no results found
Throws:
SearchException - thrown if there were any search problems

getSearchQuery

public java.lang.String getSearchQuery()
Returns the latest search query.

Returns:
the latest search query.

addToSearchCache

public void addToSearchCache(java.util.Collection results)
Collection of AnnotatedObjects to add to the search cache. Previous results are removed before adding the new result.

Parameters:
results - a collection of AnnotatedObjects from the search.
 pre: results->forall(obj: Object | obj.oclIsTypeOf(AnnotatedObjects))
 

updateSearchCache

public void updateSearchCache(AnnotatedObject annotobj)
Clears existing search cache and replace it with given bean.

Parameters:
annotobj - the AnnotatedObject to set as the search cache.

getUniqueShortLabel

public java.lang.String getUniqueShortLabel(java.lang.String shortlabel)
                                     throws SearchException
Returns a unique short label.

Parameters:
shortlabel - the new short label.
Returns:
a unique short label as a String instance. This could be shortlabel if it is unique or current object's AC for otherwise.
Throws:
SearchException - for problems with searching the database.
See Also:
getUniqueShortLabel(String, String)

getUniqueShortLabel

public java.lang.String getUniqueShortLabel(java.lang.String shortlabel,
                                            java.lang.String extAc)
                                     throws SearchException
Returns a unique short label.

Parameters:
shortlabel - the new short label.
extAc - the external ac to be used if shortlabel is not unique.
Returns:
a unique short label as a String instance.
Throws:
SearchException - for problems with searching the database.
See Also:
GoTools.getUniqueShortLabel( uk.ac.ebi.intact.business.IntactHelper, Class, String, String, String)

shortLabelExists

public boolean shortLabelExists(java.lang.String shortlabel)
                         throws SearchException
Check for duplicity of short label for the current edit object.

Parameters:
shortlabel - the short label to check for duplicity.
Returns:
true if shortlabel already exists (for the current edit object) in the database.
Throws:
SearchException - for errors in acccessing the database.

fillSearchResult

public void fillSearchResult(org.apache.commons.beanutils.DynaBean dynaForm)
Popluate the given form with search result.

Parameters:
dynaForm - the form to populate.

getSearchResult

public java.util.List getSearchResult()
Returns the search result as a list.

Returns:
the search result; an empty list is returned if there are no search results.
 post: return != Null
 post: return->forall(obj: Object | obj.oclIsTypeOf(ResultBean))
 

getNewtProxy

public NewtServerProxy getNewtProxy()
Returns the Newt server proxy assigned for the current session.

Returns:
an instance of Newt server. A new instance is created if no server is created for the current session.

getGoProxy

public GoServerProxy getGoProxy()
Returns the Go server proxy assigned for the current session.

Returns:
an instance of Go server. A new instance is created if no server is created for the current session.

getHelpTag

public java.lang.String getHelpTag()
Returns the help tag for the current view bean.

Returns:
the help tag for the current view bean as a String object.

logoff

public void logoff()
            throws IntactException
Logs off from the application. This will close the connection to the persistent storage.

Throws:
IntactException - for problems with logging off.

loginTime

public java.util.Date loginTime()

logoffTime

public java.util.Date logoffTime()

addToCurrentExperiment

public void addToCurrentExperiment(Experiment exp)
Adds the experiment to the currently edited/added experiment list.

Parameters:
exp - the experiment to add to the list.

removeFromCurrentExperiment

public void removeFromCurrentExperiment(Experiment exp)
Removes the current experiment from the currently edited/added experiment list.

Parameters:
exp - the experiment to remove from the list.

getCurrentExperiments

public java.util.Set getCurrentExperiments()
Returns a list of currently edited/added experiments.

Returns:
a set consists currently edited/added experiments. An empty set is returned if there are no experiments added or edited during the current session.
 post: results->forall(obj: Object | obj.oclIsTypeOf(Experiment))
 

addToCurrentInteraction

public void addToCurrentInteraction(Interaction intact)
Adds the interaction to the currently edited/added interaction list.

Parameters:
intact - the interaction to add to the list.

removeFromCurrentInteraction

public void removeFromCurrentInteraction(Interaction intact)
Removes the current interaction from the currently edited/added interaction list.

Parameters:
intact - the interaction to remove from the list.

getCurrentInteractions

public java.util.Set getCurrentInteractions()
Returns a list of currently edited/added interactions.

Returns:
a set consists currently edited/added interactions. An empty set is returned if there are no interactions added or edited during the current session.
 post: results->forall(obj: Object | obj.oclIsTypeOf(Interaction))
 

getAnnotation

public Annotation getAnnotation(CommentBean cb)
                         throws SearchException
Returns an Annotation constructed from the given bean.

Parameters:
cb - the bean to extract information to construct an Anotation.
Returns:
an Annotation constructed from cb.
Throws:
SearchException - for errors in searching the database.

getXref

public Xref getXref(XreferenceBean xb)
             throws SearchException
Returns a new instance of Xref constructed from the given bean.

Parameters:
xb - the bean to extract information to construct an Xref.
Returns:
an instance of Xref constructed from xb.
Throws:
SearchException - for errors in searching the database.

releaseLock

public void releaseLock()
Releases the lock held by the user.



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