49 | | ^(Describe your design here.)^ |
| 49 | * Create a package {{{org.sophie2.extra.func.annotations.persistence}}}. |
| 50 | |
| 51 | * Create a class {{{AnnotationsPersister}}} that extends {{{Persister<String, Storage>}}}. |
| 52 | * Schema: "resource:annotation-set|storage|r3" |
| 53 | |
| 54 | * In {{{AnnotationsLogic}}}: |
| 55 | * Loading annotations: |
| 56 | * Create a new {{{FileDialogInput}}} for zip files and display it using the {{{DialogManager}}}. |
| 57 | * Load the zip file in a {{{Storage}}}. |
| 58 | * Convert the storage to {{{AnnotationSet}}} using the schema "resource:annotation-set|storage|r3". |
| 59 | * If an error occurs, display "Invalid file." using {{{DialogUtils.showErrorDialog}}}. |
| 60 | * If the refered book is not the currently open book, display error message. |
| 61 | * If none of the above issues is present, add the annotation set to current book's window {{{shownExtras}}} list, |
| 62 | * then use {{{CurrentAnnotationsMap.setAsCurrent}}}. |
| 63 | * Saving annotations: |
| 64 | * Create a new {{{FileDialogInput}}} for zip files and display it using the {{{DialogManager}}}. |
| 65 | * Store current annotation set to storage using the schema "resource:annotation-set|storage|r3". |