Bug #5035
closedLost Annotations; discarded Annotation changes
0%
Description
Scenario 1:
1. open an annotated DP
2. edit the an annotation class selection (say, MeasurementStandard)
3. edit an EML field (say, the DP title)
4. frame will refresh, and the annotation change is discarded.
The reason this is happening is because Morpho disposes and then recreates another frame each time the DP is edited. The annotation plugin responds to the frame disposal as though the DP was being closed and clears out the annotation changes, reloading the annotation from the version stored on disk.
Scenario 2:
1. open a local annotated DP
2. attempt to save to the network
3. docid revision must be incremented (conflict on server)
4. network save fails (in my case I am trying to save over a previously deleted DP on Metacat - save should fail)
5. the frame refreshes with the updated docid revision and no location (this DP docid is not saved locally nor to metacat).
6. as in Scenario 1, the old frame has been discarded along with the annotation for that DP even though it was associated with the new docid.
7. because there is no location from which to reload the annotation from disk, the annotation appears to be missing.
I think the solution I will try to implement is that if the DP has a blank location, the annotation will not be discarded in favor of a version on disk (because we don't really know where that should come from - local v. network). When opening a DP, we will load the annotation from the location we are opening the DP from. When the frame for that DP closes, we will discard the existing annotation only if the location is known, otherwise the annotation will persist in memory so that frame refreshes will not discard annotations or changes to those annotations. I'm concerned we might end up with annotation changes that we really do want to discard, but at the moment I can't think of a better solution than to try this.
Updated by ben leinfelder over 14 years ago
Here's how the plugin works now:
1. Morpho launches - all local annotations are loaded into the manager (to facilitate annotation-based searches)
2. open a particular DP - the annotation for that datapackage is loaded from the same location as the DP (this is redundant for opening local datapackages)
3. changes can be made to either the annotation or the DP and frame refreshes will not force the annotation to be discarded and then re-read.
4. only when the DP is saved to a particular location (local or network) will the annotation be discarded and reloaded from the given location.
I've tested this for both scenarios laid out in this big description with satisfactory results.