Writer/Metadata Support

From Apache OpenOffice Wiki
Jump to: navigation, search

Writer Icon.png

Writer Project

Please view the guidelines
before contributing.

Popular Subcategories:

Extension:DynamicPageList (DPL), version 2.3.0 : Warning: No results.

Internal Documentation:

Extension:DynamicPageList (DPL), version 2.3.0 : Warning: No results.

API Documentation:

Ongoing Efforts:

Extension:DynamicPageList (DPL), version 2.3.0 : Warning: No results.

Sw.OpenOffice.org


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.

Notes:

  • 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 and is pasted to the same document from which it is copied/cut, 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. If the pasted entity is not pasted into the document from which it is copied/cut, the pasted entity will lose its metadata reference and thus has no metadata any more.

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. In this case the pasted entity will lose its metadata reference and thus has no metadata any more.

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.

Notes:

  • Editing the content of an entity means inserting and deleting content of this entity.

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.

Notes:

  • 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.

Notes:

  • 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.
  • A join of two entities, when one or the other does not contain content, is not treated as a merge of two entities. It is treated as a deletion of the entity which has no content. If both entities do not have content, in general the second entity is deleted, except the first one has no metadata reference and the second one has a metadata reference.

Embedded Objects

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 document, the complete metadata of the embedded object should be stored in the target document.

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 host document.

Personal tools