SimpleTagProvider

I have created a simple tag provider, but the SQLTags it creates are not editable in the SQLTag browser in the designer, nor do they appear to be updatable via scripting with system.tag.wirite(). I would like both of these capabilities to be enabled.

I configured the provider/tags as follows:

provider = new SimpleTagProvider(providerName);
provider.configureTagType(TagType.Custom, TagEditingFlags.STANDARD_STATUS null);

I also tried (to no effect):

provider.configureTagType(TagType.Custom, TagEditingFlags.STANDARD_STATUS.or(TagEditingFlags.SUPPORTS_VALUE_EDIT), null);

I wasn’t sure of which TagEditingFlags I need, nor whether they should be and’d or or’d.

—chuck

Hi,

I think that the only problem might be that you’re probably not calling [tt]SimpleTagProvider.configureTag()[/tt] for each tag, to link it to that “Tag type” that you’ve defined. And then, for writing, you need to register a “WriteHandler” to do something with the value (remember, you’re driving all of the tag values, so the system doesn’t know what a write means. In the simplest case, your write handler will then just turn around and call “updateValue” for the tag).

So, to summarize:

  1. Configure the “type” TagType.Custom as you were, using TagEditingFlags.STANDARD_STATUS.
  2. For each tag, call [tt]configureTag(path, dataType, TagType.Custom)[/tt]
  3. Create a write handler, and for each tag that you want to make writable, call [tt]registerWriteHandler(path, handler)[/tt]

Hope this helps,

Thanks that helps. Works just fine. I appreciate the explanation - I just didn’t see why I needed a WriteHandler when I could just as easily call the updateTag method directly — and the reason is so that system.tag.write() will work.
– chuck