Difference between revisions of "Writer/Metadata Support"
(added embedded objects)
m (→Insert Embedded Object)
|Line 73:||Line 73:|
====Insert Embedded Object====
====Insert Embedded Object====
When inserting an ODF
When inserting an ODF as an embedded object into a document , the metadata contained in the ODF should be preserved, and inserted into the target .
====Extract Embedded Object====
====Extract Embedded Object====
Revision as of 15:51, 12 August 2008
- 1 Metadata Support in Writer
- 1.1 Handling of metadata on editing/updating a text document
- 1.2 Embedded Objects
Metadata Support in Writer
Information about Writer's metadata support - to be extended in the future.
Handling of metadata on editing/updating a text document
Metadata can be assigned to various Writer's entities of a text document's content. These are for example paragraphs, headings, bookmarks, lists, list items, tables, table rows, table columns, table cells, sections, metadata texts, metadata fields and many more. For further information see the ODF 1.2 Metadata specification and ODF 1.2 Metadata example document.
The metadata in the Writer is stored in an RDF/RDFa repository. From this repository a Writer's entity metadata representation can be optained by its xml:id property in conjunction with the path of the ODF stream, to which the related ODF element belongs to. In the following we call this key metadata reference.
The handling of the metadata on Writer entities (e.g. edited/changed/deleted) are listed below:
Deletion of an entity
Deletion while change tracking is deactivated: The metadata of an deleted Writer's entity is lost for this entity. The entity loses its metadata reference. The related metadata stays in the RDF/RDFa repository and can still be referenced. The metadata reference for the deleted entity is restored, if the deletion of the entity is undone.
Deletion while change tracking is activated: The metadata of an deleted Writer's entity is kept. The Writer's entity does not lose its metadata reference. The deleted entity will be also stored in ODF and will still have its metadata.
Copy of an entity
When copying an entity the copy of an entity will also copy the metadata reference, but not its related metadata.
- A copy of an entity creates an corresponding entity in the clipboard and copies the content and the attributes of the entity to the created entity in the clipboard. It has to be assured that the metadata reference of the entity in the clipboard is the same as the one of its source entity.
Cut of an entity
A cut of an entity is represented by the copy of the entity followed by a deletion of this entity (see above).
Paste of an entity
In case the to be pasted entity holds a metadata reference, it is checked, if another entity of the current text document has the same metadata reference. If another entity has the same metadata reference, the to be pasted entity will lose its metadata reference and thus has no metadata any more. If no other entity has the same metadata reference, the to be pasted entity will keep its metadata reference and thus has metadata, if the related metadata exists in the RDF/RDFa repository.
Via Cut-and-Paste a certain entity can be moved from/to the document body context to/from the page header/footer context inside a certain text document. This means that the entity will be moved from/to the underlying ODF content.xml stream to/from the underlying ODF styles.xml stream. Due to the ODF 1.2 specification the value of the xml:id property have only to be unique inside a certain stream of an ODF. Thus, if the pasted entity holds a metadata reference, which does not correspond to the underlying ODF stream of the destination context, the following actions are performed:
- The metadata reference is changed in order to correspond to the underlying ODF stream of the destination context.
- It is checked, if the changed metadata reference is hold by another entity of the current text document.
- If YES, the pasted entity lose its metadata reference and has no metadata any more.
- If NO, the pasted entity will keep the changed metadata reference and the metadata from the source ODF stream (if existing) is transfered to the destination ODF stream, if this metadata is not referenced by an entity of the source ODF stream.
- The source of a paste is typically the clipboard.
- ODF 1.2 specification is currently (August 2008) work in progress. Please have a look at the OASIS ODF TC for the current ODF 1.2 specification draft
- A transfer of a metadata from one ODF stream to another ODF stream mainly means to adjust the metadata mapping in the manifest of the ODF.
Edit of entity content
In general the metadata of an entity is kept when the content of this entity is being edited. In case that the whole content of the entity is deleted, the metadata reference is treated as if the complete entity is deleted – see above for details.
- Editing the content of an entity means inserting and deleting content of this entity.
- When the complete content of a metadata text or a metadata field is deleted the metadata text respectively metadata field itself is deleted.
Split of entity
If an entity with a metadata reference is being split into two entities, the metadata reference is kept for the first entity.
- An ENTER inserted in the Writer at the beginning of a paragraph (or heading) is implemented as a split of this paragraph/heading. Due to the handling of metadata reference this special split has to be treated as an insertion of a new paragraph/heading before the existing one. Thus for the metadata reference handling this is not a split of an entity.
Merge of two entities
In case of merging two entities with only one entity having a metadata reference: The metadata reference is transferred to the merged entity.
In case of merging two entities with both entities having metadata reference: Only one metadata reference will be kept. In general the metadata reference of the first one is kept and the metadata reference of the second is lost. Exception: The metadata reference of the second is kept, in case it has content and the first has none.
- It is a typical scenario, that the user makes a selection which contains parts of paragraphs and also complete paragraphs and then hits BACKSPACE. This results in a merge of two paragraphs, while the selected parts are deleted. Due to the metadata reference handling such an action is split into the deletion of the selection and afterwards merging of the two paragraphs. See “Delete of entity” and “Edit of entity content” for the first part of this split action for the metadata reference handling.
Insert Embedded Object
When inserting an ODF document as an embedded object into a document (e.g. a spreadsheet document into a text document), the metadata contained in the to be embedded ODF document should be preserved, and inserted into the target document.
Extract Embedded Object
When storing an embedded object that is an ODF document and that contains metadata to an ODF file, the metadata of the embedded object should be stored in the target file completely.
Remove Embedded Object
When removing an embedded object that is an ODF document and that contains metadata, the metadata of the embedded object should be removed completely from the file.