Opened 12 years ago
Closed 12 years ago
#741 closed (fixed)
Update and deletion of annotations
Reported by: | Fredrik Levander | Owned by: | olle |
---|---|---|---|
Milestone: | Proteios SE 2.15.0 | Keywords: | |
Cc: |
Description
It should be possible to delete annotations for a specific object. Furthermore it should be possible to update values.
Change History (19)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Owner: | changed from Fredrik Levander to olle |
---|
comment:3 Changed 12 years ago by
Probably the createAnnotationTable function from ViewActiveFile
should be moved and be the basis of something more generic, so that the same function is used also for biomaterials. Currently similar code can be found for samples and extracts etcetera. Possibly TableFactory2 should be used instead for annotations.
comment:5 Changed 12 years ago by
Design note.
- A previous action class/file managing annotations is action/write/AddAnnotation.java in client/servlet/. The latest ticket directly related to this class/file is Ticket #339 (Enable annotations for extracts).
comment:6 Changed 12 years ago by
(In [4128]) Refs #741. Class/file action/annotation/DeleteAnnotations.java in client/servlet/ updated to check that at least one annotation item has been selected:
- Public method
void runMe()
updated to check that at least one annotation item has been selected, and if not to return to the previous action with an error message.
comment:7 Changed 12 years ago by
Design discussion of functionality of previously existing GUI for annotation management.
- The "Annotations" tab in the file properties form managed by
ViewActiveFile
contains an "Annotation" box, that allows new annotations to be created, either using an existingAnnotationType
, or a new one, together with an annotation value string. A pop-up menu exists for selecting an existingAnnotationType
, while a text field allows entry of a newAnnotationType
name.
a. If an existing annotation type is selected in the pop-up menu, the text entry field for the annotation type name is disabled. If no previous annotation for the annotation type exists, a new annotation is created with the entered value. If an annotation for the selected annotation type already exists, its value will be overwritten with the new value.
b. If the name of a an annotation type is explicitly entered in the text field, while the annotation type pop-up menu having been left with the default option "-- New --
", a new annotation is created with the entered annotation type and value.
However, when an annotation type name is explicitly entered (case b above), no check is made if the entered annotation type already exists, making it possible to create several annotation type items with the same name. After creation, each of these items will be represented with an option in the pop-up menu for annotation type, but as the options have identical names, the user cannot know what annotation values the different equally-named options represent.
Suggested design update:
- Allowing creation of several annotation types having the same name is clearly undesirable, and the code should therefore be updated to check if an entered annotation type exists, in which case an error message should be displayed, instead of a new annotation type with the same name being created.
- The method to change the value of an existing annotation value via the "Annotation" box, described in case a above, will be kept for the moment, but the new functionality added in this ticket in changeset [4127] is preferable, since it is more clear what annotation value is edited.
comment:8 Changed 12 years ago by
(In [4129]) Refs #741. Class/file action/write/AddAnnotation.java in client/servlet/ updated to check if an annotation type exists before creating a new one:
- Public method
void runMe()
updated to call new private convenience methodboolean isAnnotationTypeExisiting(DbControl dc, Annotator annotator, Annotatable item, String annotationTypeName)
to check if an annotation type name already exists, in which case an error message is displayed, instead of a new annotation type with the same name being created.
- New private convenience method
boolean isAnnotationTypeExisiting(DbControl dc, Annotator annotator, Annotatable item, String annotationTypeName)
added. It checks if an annotation type with a given name already exists for a specific item type. If the item type isnull
, the check will include all item types.
comment:9 Changed 12 years ago by
Traceability note:
- Ticket #742 (Multiple annotation types with same name should not be allowed) updates the design for making sure that multiple annotation types with the same name are not created.
comment:10 Changed 12 years ago by
Design update:
- The ability to delete an existing annotation should be extended to biomaterials, i.e. samples, extracts, and labeled extracts.
- View action for an annotation should be added for biomaterials, i.e. samples, extracts, and labeled extracts. As for file annotations, the view action should be set to class
ViewAnnotation
, that allows an annotation value to be edited. - Currently, classes
ViewActiveFile
andViewActiveSample
use a separate private methodTable createAnnotationsTable(TableFactory tableFactory, ItemQuery<Annotation> annotationQuery)
to create the annotations table, while classesViewActiveExtract
andViewActiveLabeledExtract
do not. In order to simplify future refactoring, the latter two classes should also use a separate private methodTable createAnnotationsTable(TableFactory tableFactory, ItemQuery<Annotation> annotationQuery)
to create the annotations table. - Currently, class
SaveAnnotation
for saving an edited annotation value forwards action to actionViewActiveFile
, which will not work when the annotation is for a biomaterial (it is also pointed out in the source code ofSaveAnnotation
, that this part should be made generic). In order to make the code generic, classSaveAnnotation
should obtain an action link id from valid parameterVString ForwardField.VPARAM
, and forward action to this.
comment:11 Changed 12 years ago by
(In [4158]) Refs #741. Refs #339. Annotation management for biomaterials, i.e. samples, extracts, and labeled extracts, updated with view action for an annotation, that allows the value to be edited, and support for deleting an annotation:
- Class/file action/annotation/SaveAnnotation.java in client/servlet/ updated to obtain an action link id from valid parameter
VString ForwardField.VPARAM
, and forward action to this when it is finished.
- Class/file action/annotation/ViewAnnotation.java in client/servlet/ updated to obtain an action link id from valid parameter
VString ForwardField.VPARAM
, and transfer the value toSaveAnnotation
, if the latter action is called.
- Class/file action/file/ViewActiveFile.java in client/servlet/ updated to set value of valid parameter
VString ForwardField.VPARAM
to that of the class itself (in this caseViewActiveFile
), when actionViewAction
is called.
- Class/file action/sample/ViewActiveSample.java in client/servlet/ updated in private method
Table createAnnotationsTable(TableFactory tableFactory, ItemQuery<Annotation> annotationQuery)
to set view action for annotation value toViewAnnotation
and add tool bar with button coupled to action link toDeleteAnnotations
.
- Class/file action/extract/ViewActiveExtract.java in client/servlet/ updated to create annotation table using same private method
Table createAnnotationsTable(TableFactory tableFactory, ItemQuery<Annotation> annotationQuery)
as was used forViewActiveSample
.
- Class/file action/extract/ViewActiveLabeledExtract.java in client/servlet/ updated to create annotation table using same private method
Table createAnnotationsTable(TableFactory tableFactory, ItemQuery<Annotation> annotationQuery)
as was used forViewActiveSample
.
comment:12 Changed 12 years ago by
Design update:
- Information on properties for biomaterial items can now be obtained in analogous ways for samples, extracts, and labeled extracts. However, view action for items when listing samples, extracts, and labeled extracts for a project is only defined for the first two, but not for labeled extracts, for which one have to navigate via the creation event for the parent extract to obtain the properties form for a labeled extract. In order to make the GUI consistent for all biomaterial items, view action should be added when listing labeled extracts, and set to action
ViewLabeledExtract
.
comment:13 Changed 12 years ago by
(In [4159]) Refs #741. Refs #339. View action defined for items when listing labeled extracts:
- Class/file action/ActionFactory.java in client/servlet/ updated in public synchronized method
ActionLink getViewActionLink(AttributeDefinition ad)
to set view action for labeled extract items toViewLabeledExtract
.
comment:14 Changed 12 years ago by
Design update:
Currently the annotation tab in the file properties form has the layout
Annotations (name and value of annotations) | Annotated biomaterials |
Annotation (select annotation type or create new) |
while for samples, extracts, and labeled extracts it has the layout
Annotation (select annotation type or create new) | Annotations (name and value of annotations) |
Associated Files |
- In order to increase consistency, the annotation tab in the file properties form should have a layout that resembles the one for the biomaterial items:
Annotation (select annotation type or create new) | Annotations (name and value of annotations) |
Annotated biomaterials |
This choice has the following benefits:
- The two components related to annotations are now found at same locations in all of the forms.
- The two components related to annotations are at the top of the form tab entitled "Annotations".
- The components for associated items are found at same locations in all of the forms.
- The layout has a row-based structure, with the first row related to annotations and the second to associated items. New items will be added at the bottom, which is natural for a web form.
comment:15 Changed 12 years ago by
(In [4160]) Refs #741. Class/file action/file/ViewActiveFile.java in client/servlet/ updated in annotation tab to have a layout similar to that for the annotation tab for the properties form for samples, extracts, and labeled extracts:
- Public method
void runMe()
updated to place the form for new annotations to the upper left, the one for annotation names and values to the upper right, and the one for annotated biomaterials to the lower left.
comment:16 Changed 12 years ago by
Design update:
- Just as the annotation tab in the file properties form has links for annotated biomaterial, that leads to the properties form for the biomaterial in question, the annotation tab in the properties form for samples, extracts, and labeled extracts should have links for associated file items, that leads to the properties form for the file.
comment:17 Changed 12 years ago by
(In [4161]) Refs #741. Refs #339. Annotation management for biomaterials, i.e. samples, extracts, and labeled extracts, updated with links for associated file items, that leads to the properties form for the file:
- Class/file action/sample/ViewActiveSample.java in client/servlet/ updated in private method
Table createFileTable(Sample sample)
with action link for associated file items. The action link is coupled to actionViewFile
, and the file id value is added to valid parameterVInteger FormFactory.VID
.
- Class/file action/extract/ViewActiveExtract.java in client/servlet/ updated in protected method
void runMe()
with action link for associated file items. The action link is coupled to actionViewFile
, and the file id value is added to valid parameterVInteger FormFactory.VID
.
- Class/file action/extract/ViewActiveLabeledExtract.java in client/servlet/ updated in protected method
void runMe()
with action link for associated file items. The action link is coupled to actionViewFile
, and the file id value is added to valid parameterVInteger FormFactory.VID
.
comment:18 Changed 12 years ago by
Design update summary.
- Annotation management for files and biomaterials (samples, extracts, and labeled extracts) has been updated to support editing and deletion of annotations. The functionality related to annotations and associated items is now similar for files and biomaterial items. while some differences in the code still exists. Refactoring of the code to make it more generic will be left for future updates.
comment:19 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ticket closed as annotation management for files and biomaterials has been updated to support editing and deletion of annotations, and the user interface has been updated to increase similarity between the different item types.
(In [4127]) Refs #741. Added functionality for updating values by clicking on them in the annotation table. Deletion is performed by checking checkboxes and clicking delete. Currently only implemented for files.