Template point
-
Does the idea of a "template" point exist in Mango? What I mean by that is is there a good way to make a templated point, such as a META point which has scripts and logging settings etc, which then other points could reference as their parent? Obviously for a meta point with script you would have to change the context points but that's just as an example.
I'm trying to templatize a few points and then I'm using excel to make many of these points. It's a bit cumbersome but not unworkable -
Actually I'll be honest, it's driving me insane right now, errors while trying to import, I'm sure I'm making mistakes somewhere but it doesn't point me to what exactly is wrong and ya...
-
There are lots of templating options.
The first is the Data Point Property template, which you have probably seen on the point's edit page. A numeric is created with the template
NUMERIC_DEFAULT
and this can be modified / saved as a new template on the point's edit page. This cannot template point locator properties, though, which include a meta point's script.There is the template configuration module, which is somewhat tricky to use, but you can markup JSON into a template and then supply the variables to configure the template through the UI.
Sometimes when I have to do large generation tasks, I use Python's string replacement to get effect, like
import json from StringIO import StringIO #this is your template, which you would mix the other properties into from # a csv or excel or whatever in a loop baseObject = """{ "key":"%(value)s" }""" importItems = [] importItems.append( json.load( StringIO( baseObject % {"value": "value to store in 'value' here"} ))) outputFile.write( json.dumps( importItems ))
which can get very arbitrary in complexity. I have posted a few more completed python generating scripts around the forum. I can find some if you like.
-
What error are you actually getting that is opaque?
-
Oh cool! interesting... I need a reason to learn some Python actually.
I was missing a quote somewhere. As I said, it was my mistake and was frustrated. The point I was trying to make is that doing it the way I was, in excel and importing CSV, is prone to stupid mistakes. If there's a better way I'm open to hear it.
On another topic, what do you guys do in terms of training for Mango if anything at this point? I'll see how far this white rabbit leads me but it may be worthwhile if I happen to fall much further down this rabbit hole. I think I'll have some tea first however.
-
Ah. Well, fortunately or unfortunately, Mango is versatile enough there are places for mistakes to creep in.
There have been instances of Joel travelling and providing training, but that carries its price tag and is most useful if there are several people to be trained. Past that, there is no formal training, only the various help resources and this forum - which due to the lack of training I do my best to answer promptly with my eyes on posterity and simplicity (usually).
Personally, I would enjoy trying to get some of the knowledge bumbling around my head bumbling around others' heads, but the prioritization has me creating more functioning puzzles rather than trying to explicate the existing puzzles.