google-code-export / mesh4x

Automatically exported from code.google.com/p/mesh4x
1 stars 1 forks source link

Adapter: KML placemark path sync #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Placemarks can be moved around the folder hierarchy in the KML. In order to
avoid syncing big chunks of XML for folders, we only sync their top-level
properties, those that apply to folders themselves. 

In order to track a given placemark location and make that information part
of the sync and updates, we should add an extension attribute to the
placemark that signals its position within the folder structure. This
information is maintained by the repository adapter. When the adapter
detects the position changed, it will generate an update on the placemark
sync metadata, and update the path attribute.

For example, this is the original item before any previous sync:

<Folder>
  ..
  <Placemark>
    ...

On the first sync, the adapter automatically assigns xml:id's to all
elements that will support sync:

<Folder xml:id="1">
  ..
  <Placemark xml:id="2" mesh:folder="1" xmlns:mesh="http://mesh.org/kml">
    ...

Note that it will also associate the folder the placemark lives in by
adding the extension attribute "folder" from the http://mesh.org/kml
namespace (the namespace could be declared at the root of the document).

The adapter will check that the mesh:folder attribute matches the parent
folder of the placemark upon retrieving the item. If it doesn't, it will
apply an update and refresh the new current folder parent.

Original issue reported on code.google.com by kzu.net on 5 May 2008 at 8:27

GoogleCodeExporter commented 9 years ago

Original comment by jtondato@gmail.com on 17 Jun 2008 at 2:38