Question re; the interaction between namespace metadata templates & asset.create

9 views
Skip to first unread message

John Twyman

unread,
Mar 20, 2014, 9:26:07 PM3/20/14
to medi...@googlegroups.com
Hi all,

I'm working with namespace metadata templates and have hit across something that isn't behaving the way I thought it should. I'm sure I'm misunderstanding something and would appreciate some clarification and advice.

I have a namespace metadata template that looks something like this:

> asset.namespace.describe :namespace /path/to/namespace
    :namespace -id "12345"
        :path "/path/to/namespace"
<snip>
        :template
            :metadata
                :scope "all"
                :definition -requirement "mandatory" "metadata:type"
                :value -binding "default"
                    :type "value"
<snip>

When I run asset.create as follows I have no problems. That is, when I explicitly state the metadata type found in the template, everything works:

> asset.create :namespace /path/to/namespace :name "mynewasset" :meta < :metadata:type < :value "value" > >

If I ever omit "metadata:type" from my asset.create command I receive an error like this:

error: executing asset.create: [arc.mf.server.Services$ExServiceError]: call to service 'asset.create' failed: Missing mandatory metadata of type 'metadata:value' for namespace: /path/to/namespace

I was under the impression that created assets should automatically "inherit" the metadata definitions from any metadata templates that have effect on the namespace. Obviously that's not the case here.

Ultimately, I'd like to create assets in a namespace and, if I do not explicitly state the mandatory metadata (as defined by the template) have it automatically added to the assets. Is this achievable?

Cheers,
John

Evan Thomas

unread,
Mar 20, 2014, 9:49:58 PM3/20/14
to John Twyman, medi...@googlegroups.com
I tried this in desktop:
  • attach a template to a namespace
  • create an asset in that namespace
This worked as expected, the asset was created with metadata from the template.

I then looked in the log (server.log.display :name http :last 100) and saw that the asset.create was proceed by asset.namespace.template.metadata.generate.

So in your case, if you’re doing this in a tcl script or other application, you will need the create the filled in document first using asset.namespace.template.metadata.generate, merge with any per asset metadata and then call asset.create.



Evan.
Evan Thomas
Senior Software Engineer





ARCITECTA
5/26-36 High Street, Northcote
Victoria, Australia 3070
http://www.arcitecta.com
Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email or messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Arcitecta shall be understood as neither given nor endorsed by it.




--
You received this message because you are subscribed to the Google Groups "mediaflux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mediaflux+...@googlegroups.com.
To post to this group, send email to medi...@googlegroups.com.
Visit this group at http://groups.google.com/group/mediaflux.
For more options, visit https://groups.google.com/d/optout.

John Twyman

unread,
Mar 20, 2014, 11:51:38 PM3/20/14
to medi...@googlegroups.com, John Twyman, evan....@arcitecta.com
Hi Evan,

Yeah I've seen the same behaviour in Desktop. It's prepopulating the Add Asset window with the relevant template-based metadata.

In this particular case though I'm using a TCL script. I've seen asset.namespace.template.metadata.generate but wasn't aware of what it does. I'll play around with it and see what I can do.

Thanks!
John
Reply all
Reply to author
Forward
0 new messages