|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.ac.ebi.intact.application.editor.business.EditUser
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 also implements the HttpSessionBindingListener interface for it can be notified of session time outs.
| Constructor Summary | |
EditUser(java.lang.String mapping,
java.lang.String dsClass)
This constructor for Seralization test class. |
|
EditUser(java.lang.String mapping,
java.lang.String dsClass,
java.lang.String user,
java.lang.String password)
Constructs an instance of this class with given mapping file and the name of the data source class. |
|
| 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)
|
boolean |
equals(java.lang.Object obj)
Compares obj with this object according to
Java's equals() contract. |
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. |
java.lang.String |
getDatabaseName()
The name of the database connected to. |
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. |
java.lang.String |
getUserName()
Returns the Intact user. |
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 |
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. |
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 label)
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. |
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public EditUser(java.lang.String mapping,
java.lang.String dsClass,
java.lang.String user,
java.lang.String password)
throws DataSourceException,
IntactException
mapping - the name of the mapping file.dsClass - the class name of the Data Source.user - the userpassword - the password of user.
DataSourceException - for error in getting the data source; this
could be due to the errors in repository files.
IntactException - for errors in creating IntactHelper; possibly
due to an invalid user.
public EditUser(java.lang.String mapping,
java.lang.String dsClass)
throws IntactException,
DataSourceException
EditUser(String, String, String, String) with null values for
user and password.
mapping - the name of the mapping file.dsClass - the class name of the Data Source.
DataSourceException - for error in getting the data source; this
could be due to the errors in repository files.
IntactException - for errors in creating IntactHelper.uk.ac.ebi.intact.application.editor.test.SessionSerializationTest| Method Detail |
public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
valueBound in interface javax.servlet.http.HttpSessionBindingListenerpublic void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
valueUnbound in interface javax.servlet.http.HttpSessionBindingListenerpublic boolean equals(java.lang.Object obj)
obj with this object according to
Java's equals() contract. Delegates the task to
AbstractEditViewBean.equals(Object).
equals in class java.lang.Objectobj - the object to compare.
obj is an instance of this class
and its wrapped view equals to this object's view. For all
other instances, false is returned.public java.lang.String getUserName()
IntactUserI
getUserName in interface IntactUserIpublic java.lang.String getDatabaseName()
IntactUserI
getDatabaseName in interface IntactUserI
public java.util.Collection search(java.lang.String objectType,
java.lang.String searchParam,
java.lang.String searchValue)
throws IntactException
IntactUserI
search in interface IntactUserIobjectType - the object type to be searchedsearchParam - the parameter to search on (eg field)searchValue - the search value to match with the parameter
IntactException - thrown if problems are encountered during the
search process.public AbstractEditViewBean getView()
EditUserI
getView in interface EditUserIpublic void setView(java.lang.Object obj)
EditUserI
setView in interface EditUserIobj - 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.public java.lang.String getSelectedTopic()
getSelectedTopic in interface EditUserIpublic void setSelectedTopic(java.lang.String topic)
setSelectedTopic in interface EditUserIpublic Institution getInstitution()
EditUserI
getInstitution in interface EditUserIpublic boolean isEditing()
EditUserI
isEditing in interface EditUserItrue if the user is in edit screen;
false is returned for all other instances.public void startEditing()
EditUserI
startEditing in interface EditUserI
public void begin()
throws IntactException
begin in interface EditUserIIntactException
public void commit()
throws IntactException
commit in interface EditUserIIntactException
public void rollback()
throws IntactException
rollback in interface EditUserIIntactException
public void create(java.lang.Object object)
throws IntactException
create in interface EditUserIIntactException
public void update(java.lang.Object object)
throws IntactException
update in interface EditUserIIntactException
public void delete(java.lang.Object object)
throws IntactException
delete in interface EditUserIIntactException
public void persist()
throws IntactException,
SearchException
EditUserI
persist in interface EditUserISearchException - for search errors (unable to find an object
to update).
IntactException - for errors in updating the persistent system.
public void delete()
throws IntactException
EditUserI
delete in interface EditUserIIntactException - for errors in deleting the current edit object.public void cancelEdit()
cancelEdit in interface EditUserIpublic boolean isPersistent(java.lang.Object obj)
EditUserI
isPersistent in interface EditUserIobj - the object to check for persistency.
obj is persistent.public boolean isPersistent()
EditUserI
isPersistent in interface EditUserI
public java.lang.Object getObjectByLabel(java.lang.String className,
java.lang.String label)
throws SearchException
EditUserI
getObjectByLabel in interface EditUserIclassName - the name of the class to search.label - the short label to search for.
SearchException - thrown for a search failure; also thrown
if label already exists in className.
public java.lang.Object getObjectByLabel(java.lang.Class clazz,
java.lang.String label)
throws SearchException
EditUserI
getObjectByLabel in interface EditUserIclazz - the class object to search.label - the short label to search for.
SearchException - thrown for a search failure; also thrown
if label occurrs more than once for clazz.
public java.lang.Object getObjectByAc(java.lang.Class clazz,
java.lang.String ac)
throws SearchException
EditUserI
getObjectByAc in interface EditUserIclazz - the class to search for.ac - the accession number to search for.
clazz type for ac.
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!public java.util.Collection getSPTRProteins(java.lang.String pid)
EditUserI
getSPTRProteins in interface EditUserIpid - the primary id to search for.
Protein instances for pid.public java.lang.Exception getProteinParseException()
EditUserI
getProteinParseException in interface EditUserI
public java.util.Collection search1(java.lang.String objectType,
java.lang.String searchParam,
java.lang.String searchValue)
throws SearchException
EditUserIThis method is named as search1 to avoid conflict with the similar named method (with diffrent exception) of the super interface.
search1 in interface EditUserIobjectType - the object type to be searchedsearchParam - the parameter to search on (eg field)searchValue - the search value to match with the parameter
SearchException - thrown if problems are encountered during the
search process.public java.lang.String getSearchQuery()
EditUserI
getSearchQuery in interface EditUserIpublic void addToSearchCache(java.util.Collection results)
EditUserI
addToSearchCache in interface EditUserIresults - a collection of AnnotatedObjects from
the search.
pre: results->forall(obj: Object | obj.oclIsTypeOf(AnnotatedObjects))
public void updateSearchCache(AnnotatedObject annotobj)
EditUserI
updateSearchCache in interface EditUserIannotobj - the AnnotatedObject to set as the search cache.
public java.util.Collection lookup(java.lang.String className,
java.lang.String value)
throws SearchException
EditUserI
lookup in interface EditUserIclassName - the intact type to search onvalue - the user-specified value.
SearchException - thrown if there were any search problems
public java.lang.String getUniqueShortLabel(java.lang.String shortlabel)
throws SearchException
EditUserI
getUniqueShortLabel in interface EditUserIshortlabel - the new short label.
String instance. This
could be shortlabel if it is unique or current object's
AC for otherwise.
SearchException - for problems with searching the database.EditUserI.getUniqueShortLabel(String, String)
public java.lang.String getUniqueShortLabel(java.lang.String shortlabel,
java.lang.String extAc)
throws SearchException
EditUserI
getUniqueShortLabel in interface EditUserIshortlabel - the new short label.extAc - the external ac to be used if shortlabel is not
unique.
String instance.
SearchException - for problems with searching the database.GoTools.getUniqueShortLabel(
uk.ac.ebi.intact.business.IntactHelper, Class, String, String, String)
public boolean shortLabelExists(java.lang.String label)
throws SearchException
EditUserI
shortLabelExists in interface EditUserIlabel - the short label to check for duplicity.
shortlabel already exists (for the current edit object)
in the database.
SearchException - for errors in acccessing the database.public void fillSearchResult(org.apache.commons.beanutils.DynaBean dynaForm)
EditUserI
fillSearchResult in interface EditUserIdynaForm - the form to populate.public java.util.List getSearchResult()
EditUserI
getSearchResult in interface EditUserIpost: return != Null post: return->forall(obj: Object | obj.oclIsTypeOf(ResultBean))
public void logoff()
throws IntactException
EditUserI
logoff in interface EditUserIIntactException - for problems with logging off.public java.util.Date loginTime()
loginTime in interface EditUserIpublic java.util.Date logoffTime()
logoffTime in interface EditUserIpublic NewtServerProxy getNewtProxy()
EditUserI
getNewtProxy in interface EditUserIpublic GoServerProxy getGoProxy()
EditUserI
getGoProxy in interface EditUserIpublic java.lang.String getHelpTag()
EditUserI
getHelpTag in interface EditUserIpublic void addToCurrentExperiment(Experiment exp)
EditUserI
addToCurrentExperiment in interface EditUserIexp - the experiment to add to the list.public void removeFromCurrentExperiment(Experiment exp)
EditUserI
removeFromCurrentExperiment in interface EditUserIexp - the experiment to remove from the list.public java.util.Set getCurrentExperiments()
EditUserI
getCurrentExperiments in interface EditUserIpost: results->forall(obj: Object | obj.oclIsTypeOf(Experiment))
public void addToCurrentInteraction(Interaction intact)
EditUserI
addToCurrentInteraction in interface EditUserIintact - the interaction to add to the list.public void removeFromCurrentInteraction(Interaction intact)
EditUserI
removeFromCurrentInteraction in interface EditUserIintact - the interaction to remove from the list.public java.util.Set getCurrentInteractions()
EditUserI
getCurrentInteractions in interface EditUserIpost: results->forall(obj: Object | obj.oclIsTypeOf(Interaction))
public Annotation getAnnotation(CommentBean cb)
throws SearchException
EditUserIAnnotation constructed from the given bean.
getAnnotation in interface EditUserIcb - the bean to extract information to construct an Anotation.
cb.
SearchException - for errors in searching the database.
public Xref getXref(XreferenceBean xb)
throws SearchException
EditUserIXref constructed from the given bean.
getXref in interface EditUserIxb - the bean to extract information to construct an Xref.
Xref constructed from xb.
SearchException - for errors in searching the database.public void releaseLock()
EditUserI
releaseLock in interface EditUserI
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||