Writer/Metadata Support

From Apache OpenOffice Wiki
< Writer
Revision as of 08:31, 8 August 2008 by Od (Talk | contribs)

Jump to: navigation, search

Metadata Support in Writer

Information about Writer's metadata support - to be extended in the future.

Handling of metadata on editing/updating an text document

Metadata can be assigned to various 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. The metadata is stored in a RDF/RDFa repository and can be uniquely referenced by these entities by a metadata reference. The metadata reference is mainly the value of the ODF xml:id property of the ODF element corresponding to the entity. The ODF stream, to which the ODF element belongs to, is also part of the metadata reference.

The following descriptions provide the handling of the associated metadata of these entities, when such an entity is edited/changed/deleted/...

Deletion of an entity

Change tracking is deactivated: The metadata of an deleted entity is lost for this entity. The entity loses its metadata reference. The metadata stays in the RDF/RDFa repository and can still be uniquely referenced. The metadata reference for the deleted entity is restored, if the deletion of the entity is undone.

Change tracking is activated: The metadata of an deleted entity is kept at the deleted entity. The 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

The copy of an entity will also copy the metadata reference, but not its metadata itself.

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 equals exactly 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.

Paste of an entity

In case the pasted entity holds an unique reference to metadata, it is checked, if the metadata is referenced by another entity of the current text document. If another entity references the metadata, the pasted entity will lose its metadata reference and thus has no metadata any more. If no other entity references the metadata, the pasted entity will keep its metadata reference and thus has metadata, if the referenced 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 is referenced 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.

Notes:

  • An entity references metadata, if it has a metadata reference. This holds for normal entities in the text document and for change tracked, deleted entities.
  • 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 - http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office
  • 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 edited. In case that the whole content of the entity is deleted, the metadata 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.
  • 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 having metadata is splitted into two entities, the metadata is kept at the first entity.

Notes:

  • In Writer an ENTER at the beginning of a paragraph or a heading is implemented as a split of this paragraph/heading. Due to the handling of metadata this special split has to be treated as an insertion of a new paragraph/heading before the existing one. Thus for the metadata handling this is not a split of an entity.

Merge of two entities

Only one entity has metadata: The metadata is transferred to the merged entity.

Both entities have metadata: Only one metadata can be kept. In general the metadata of the first one is kept and the metadata of the second one is lost. Exception: The metadata of the second one is kept, in case it has content and the first has no content.

Notes:

  • For paragraphs it is typically that the user makes a certain selection, which contains certain parts of paragraphs and also complete paragraphs, and then hits BACKSPACE. This results typically in a merge of two paragraphs, while the selected parts are deleted. Due to the metadata handling such an action is splitted 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 splitted action for the metadata handling.
Personal tools