#89 Tag editing

Matthew Lohbihler Thu 30 May 2013

Hi everyone,

What are the best practices around the editing of a haystack tag set - from a developer's perspective? If i'm presenting a page to edit a point to a user, i would probably want to serialize the existing tag set and send it through a wire (say to a web page). I would then want to deserialize the edited tag set when i receive it back. Ditto for saving in / selecting from a database. However, the Java Haystack implementation does not support serialization (except to Zinc, but not from Zinc).

Also, there are numerous occasions where a tag should be non-editable (like the id or the present value), but there is no means to mark it as such to a generic editor.

Two thoughts occur: enhance the Java Haystack code base to add such support, or just use custom mechanisms for tag editing and Haystack only for querying. What would be the better approach?

Best regards, Matthew Lohbihler

Brian Frank Thu 30 May 2013

e. However, the Java Haystack implementation does not support serialization (except to Zinc, but not from Zinc).

The Java Haystack Toolkit has bi-directional support for Zinc - see HZincReader and HZincWriter

Also, there are numerous occasions where a tag should be non-editable

This really gets into system specific issues such as what is required, readonly, etc. What we do is tend to give power users full access to change any tag, then more dedicated apps have more guide rails for what tags can be removed/edited.

Jason Briggs Fri 31 May 2013

Yeah the tool needs to make it so the ID, and other things can't be changed.

Two thoughts occur: enhance the Java Haystack code base to add such support, or just > use custom mechanisms for tag editing and Haystack only for querying. What would be > > the better approach?

The JAVA took kit already let's you do these kinds of things. I think we might just extend the haystack.jar to allow this to happen. It let's you pass in tags, and remove tags.

Matthew Lohbihler Wed 5 Jun 2013

Actually, i didn't see an API for removing a tag. What i had to do was create an iterator for the existing tags, and copy them into a new builder, excluding the tag to be removed. Did i miss something?

Brian Frank Thu 6 Jun 2013

You are correct - there is no standard op for editing tags or entities. Mostly this is just because things work so different across systems (transactions, tree structures, etc).

Login or Signup to reply.