|
|||||||||||
| 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.struts.framework.util.AbstractEditViewBean
This super bean encapsulates behaviour for a common editing session. This class must be extended to provide editor specific behaviour.
| Constructor Summary | |
AbstractEditViewBean()
|
|
| Method Summary | |
void |
addAnnotation(CommentBean cb)
Adds an annotation. |
void |
addToRecentList(EditUserI user)
Adds the current edit object to the recent edited item list. |
void |
addXref(XreferenceBean xb)
Adds an xref. |
void |
clear()
Deletes all the links to sub objects of the current edit object. |
void |
clearTransactions()
Clears any pending xrefs and annotations stored in the transaction containers. |
void |
delAnnotation(CommentBean cb)
Removes an annotation |
void |
delXref(XreferenceBean xb)
Removes a xref. |
boolean |
equals(java.lang.Object obj)
Compares obj with this object according to
Java's equals() contract. |
java.lang.String |
getAc()
Returns accession number. |
java.lang.String |
getAcLink()
Returns a link to the search application. |
java.util.List |
getAddDatabaseMenu()
|
java.util.List |
getAddTopicMenu()
Returns the add menu for annotations. |
java.util.Map |
getAddXrefMenus()
Returns the add menu for xrefs. |
AnnotatedObject |
getAnnotatedObject()
Returns the Annotated object. |
java.util.List |
getAnnotations()
Returns a collection of CommentBean objects. |
java.lang.String |
getDefaultXrefQualifier()
Returns the default xref qualifier. |
java.lang.Class |
getEditClass()
Returns the edit class. |
java.util.List |
getEditDatabaseMenu()
|
java.util.Map |
getEditorMenus()
Returns the editor specific menus. |
java.util.List |
getEditTopicMenu()
Returns the topic menu for editing an existing annotation. |
java.util.Map |
getEditXrefMenus()
Returns the edit menu for xrefs. |
java.lang.String |
getFullName()
Return the full name. |
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. |
protected EditorMenuFactory |
getMenuFactory()
Allows access to menu factory. |
java.lang.Boolean |
getReadOnly()
False as this object is editable. |
java.lang.String |
getShortLabel()
Returns the short label. |
java.util.List |
getXrefs()
Returns a collection Xref objects. |
void |
persist(EditUserI user)
Persists the current state to the persistent system. |
void |
persistOthers(EditUserI user)
Persist any sub objects of the edited object. |
void |
removeFromRecentList(EditUserI user)
Removes the current edit object from the recent edited item list. |
protected void |
reset(AnnotatedObject annot)
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 |
reset(java.lang.Object obj)
Resets the bean with given object. |
void |
sanityCheck(EditUserI user)
Performs sanity check on a bean. |
void |
saveComment(CommentBean oldcb,
CommentBean newcb)
Replaces an existing annotation bean with a new bean. |
void |
saveXref(XreferenceBean oldxb,
XreferenceBean newxb)
Replaces an existing xref bean with a new bean. |
protected void |
setAnnotatedObject(AnnotatedObject annot)
Sets the annotated object for the bean. |
void |
setFullName(java.lang.String fullName)
Sets the full name. |
void |
setLayout(org.apache.struts.tiles.ComponentContext context)
Sets the layout in given context. |
void |
setMenuFactory(EditorMenuFactory factory)
Sets the menu factory to create menus. |
void |
setShortLabel(java.lang.String shortLabel)
Sets the short label. |
protected abstract 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 java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractEditViewBean()
| Method Detail |
public boolean equals(java.lang.Object obj)
obj with this object according to
Java's equals() contract. Only used for testing a serialized
objects.
equals in class java.lang.Objectobj - the object to compare.
obj is an instance of this class
and all non transient fields are equal to given object's non tranient
fields. For all other instances, false is returned.public void reset(java.lang.Object obj)
obj - either an Annotated object or a Class. The class type is used
when creating a view bean for a new object. For an existing object,
AnnotatedObject is used.protected void reset(java.lang.Class clazz)
clazz - the Class of the new annotated object.protected void reset(AnnotatedObject annot)
annot - AnnotatedObject object to set this bean.public void setMenuFactory(EditorMenuFactory factory)
factory - the factory to create menus.public AnnotatedObject getAnnotatedObject()
AnnotatedObject this instace is wrapped around.public java.lang.String getAc()
String instance; null if
the current view is not persisted.public java.lang.String getAcLink()
public java.lang.Class getEditClass()
public final void setShortLabel(java.lang.String shortLabel)
shortLabel - the short label to set.public java.lang.String getShortLabel()
String instance.public final void setFullName(java.lang.String fullName)
fullName - the full name to set for the current edit object.
An empty name (set by tag library when submitting the form) is set
to null to avoid equals method returning false for identical objects
apart from the full name.public java.lang.String getFullName()
String instance.public java.util.List getAnnotations()
CommentBean objects.
post: return != null post: return->forall(obj : Object | obj.oclIsTypeOf(CommentBean))
public void addAnnotation(CommentBean cb)
cb - the bean to add.
post: myAnnotsToAdd = myAnnotsToAdd@pre + 1 post: myAnnotations = myAnnotations@pre + 1
public void delAnnotation(CommentBean cb)
cb - the comment bean to remove.
post: myAnnotsToDel = myAnnotsToDel@pre - 1 post: myAnnotations = myAnnotations@pre - 1
public java.util.List getXrefs()
Xref objects.
post: return->forall(obj: Object | obj.oclIsTypeOf(XreferenceBean))
public void addXref(XreferenceBean xb)
xb - the bean to add.
post: myXrefsToAdd = myXrefsToAdd@pre + 1 post: myXrefs = myXrefs@pre + 1
public void delXref(XreferenceBean xb)
xb - the X'reference bean to remove.
post: myXrefsToDel = myXrefsToDel@pre + 1 post: myXrefs = myXrefs@pre - 1
public void saveComment(CommentBean oldcb,
CommentBean newcb)
oldcb - the existing bean to replace.newcb - the new bean to replace oldcb.
public void saveXref(XreferenceBean oldxb,
XreferenceBean newxb)
oldxb - the existing bean to replace.newxb - the new bean to replace oldexb.public void clearTransactions()
post: myAnnotsToAdd->isEmpty post: myAnnotsToDel->isEmpty post: myAnnotsToUpdate->isEmpty post: myXrefsToAdd->isEmpty post: myXrefsToDel->isEmpty post: myXrefsToUpdate->isEmpty
public void persist(EditUserI user)
throws IntactException,
SearchException
user - handler to access the persistent method calls.
IntactException - for errors in updating the persistent system.
SearchExceptionpublic void clear()
public java.util.List getEditTopicMenu()
throws SearchException
SearchException - thrown for failures with database access.
public java.util.List getAddTopicMenu()
throws SearchException
SearchException - thrown for failures with database access.
public java.util.List getEditDatabaseMenu()
throws SearchException
SearchException
public java.util.List getAddDatabaseMenu()
throws SearchException
SearchException
public java.util.Map getEditXrefMenus()
throws SearchException
SearchException - thrown for failures with database access.
public java.util.Map getAddXrefMenus()
throws SearchException
SearchException - thrown for failures with database access.public java.lang.String getDefaultXrefQualifier()
public java.util.Map getEditorMenus()
throws SearchException
SearchException - thrown for failures with database access.public void setLayout(org.apache.struts.tiles.ComponentContext context)
context - the Tiles context to set the layout.public java.lang.String getHelpTag()
public void validate(EditUserI user)
throws SearchException,
ValidationException
user - handler to the user to access the DB.
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.
SearchExceptionpublic void updateFromForm(org.apache.struts.action.DynaActionForm dynaform)
dynaform - the form to update the internal data.
public void persistOthers(EditUserI user)
throws IntactException,
SearchException
user - handler to the user to persist sub objects.
IntactException - for errors in persisting.
SearchException - for errors in searching for objects in the
persistent system.public void addToRecentList(EditUserI user)
user - the user handle to add to the recent list.public void removeFromRecentList(EditUserI user)
user - the user handle to remove from the recent list.
public void sanityCheck(EditUserI user)
throws ValidationException,
SearchException
ValidationException - if sanity check fails.
SearchException - for errors in searching for objects in the
persistent system.public java.lang.Boolean getReadOnly()
protected void setAnnotatedObject(AnnotatedObject annot)
annot - AnnotatedObject to set the bean.
protected abstract void updateAnnotatedObject(EditUserI user)
throws SearchException
user - to access the persistent system.
SearchException - for errors in searching the persistent system.
post: getAnnotatedObject() != null
protected EditorMenuFactory getMenuFactory()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||