kogmbh/WebODF — pull request #207 by adityab (2013-11-21 20:25:36+00:00)
Title: Metadata Updating

In this PR,

9eef83c adds two functions to `DomUtils`:
* `mapKeyValObjOntoNode` maps a flat map of strings onto a an element (like ``, thus creating (or modifying if they already exist) a series of childnodes with the key as the ns:localName, and the value as the text content of it.
* `getKeyValRepresentationOfNode` Does the opposite, looking at the top-level children of an element like `` and populating a key-value mapping.

These are inspired from `mapObjOntoNode`, which in 8110412 is moved from Formatting to DomUtils where it should ideally belong.

The new `odf.MetadataManager`, an instance of which belongs inside OdfContainer, uses the above two methods to provide a manipulation interface for the `` element.
`OpUpdateMetadata` is a simple operation that accesses `MetadataManager`.

Also added are functions `sortChildrenByTagNames` to `OperationTests` and `TransformationTests`, and some simple xml tests for both.

`dc:creator` and `dc:date` are updated after every 'edit' occurs, and `meta:editing-cycles` is incremented by one when the first edit operation occurs.

`dc:generator` is written upon save.