Properties in Vault 2011 – Part 2

Before you read this, I suggest reading my post on entities then reading part 1 on properties.  If not, I'm not legally responsible for any brain damage that may occur.

File Properties
In my last article, I mentioned how the properties concept spans multiple entity classes.  However there are still implementation details that are unique to each class.  In this article, I will focus specifically on file properties.

Content Source Properties
In the context of Files, a content source property represents a property within the file.  This might be a title block attribute from an AutoCAD file, or an iProperty from an Inventor file, or a structured storage property from a Microsoft Office file.  A property may even be something more abstract, such as the number of colors in a JPG file.  The point is that the property lives inside the file, and Vault needs a way to read and write this information. 

As I mentioned in my last article, the content source provider is the glue that reads and writes content source properties from a file and maps them to Vault UDPs.  Because each file type is different, there are multiple providers, broken up by file type.

The "All Files" provider is a special case.  It's the one that gets used when no other provider is available.  This provider works by using the Windows iFilter mechanism to read the content source properties.  If no suitable iFilter is found, then content source properties cannot be read for that file type.  The "All Files" provider cannot be used to write content source properties.

Mappings
Content Source Properties are useless to Vault unless they are mapped to a UDP.  If you've seen the Properties dialog, you have probably noticed a bunch of complex options. 

Mappings between content source properties and UDPs have a direction component.  You can have mappings from content to UDP, or from UDP to content, or bi-directional mappings.  Not all properties support all 3 mapping types.  The provider decides which mappings are supported.  When writing to content, there is a "create" option which means the provider can create the property in the file if the property does not already exist.  If the value is NO, the provider will only update an existing property. 

Mapping Type What it means for files
Content -> UDP When a file is versioned, the file property value is copied to the UDP value.
UDP -> Content When a "writeback" operation occurs in Vault, the UDP value is written to the file.  This process creates a new file version.
Bi-directional UDP is updated with a new file version and the content property is updated on writeback.

Setting up a mapping
In order to set up the mapping, you must have a file that contains the content source property you want to map.  In Vault Explorer, you select the file, which can either be in Vault already or on your local disk.  Next, you are presented with the possible properties that you can map to.  Once you select the file property, you can choose the direction of the mapping.

When you click OK, Vault updates the UDP with information about the mapped content source property.

You should also notice that A) you can have several providers mapped to the same UDP and B) each mapping is independent of the other mappings.  A given file will map to 1 and only 1 provider, so there is no danger of conflict. 

Monikers
This is a good time to talk about monikers.  A moniker is a string that the provider uses to locate the property.  Outside the provider, the moniker is just opaque metadata.  For example, "15!{D5CDD502-2E9C-101B-9397-08002B2CF9AE}!nvarchar" is the moniker that the Inventor provider uses to locate the Company iProperty.  That string is meaningless to you and me, it is meaningless to Vault and it is meaningless to the other providers.   

The only thing that Vault does with the moniker string is to store it with the mapped UDP.  Whenever Vault needs to read or write a content source property, it passes the moniker in to the provider so that it can locate the correct property.

Coming up…
An article on item properties, followed by an article on common workflows (with sample code).


Comments

4 responses to “Properties in Vault 2011 – Part 2”

  1. Doug,
    I’d like to share an opinion that I’ve heard on recent regional forum devoted to CAD usage:
    “Autodesk creates great software but tells nobody about the fact”.
    Your series of articles is great!
    Such articles may change the opinion. But may not change as well.
    Does Autodesk have in plan to develop some books or courseware on Vaults?
    There is the only book in store regarding Vault (regarding free Vault) but users need info about advanced Vaults.
    It is a problem. Isn’t it?

  2. Thanks for the feedback.
    Yes, we are planning on updating the Vault courseware. I’m not sure when it will be out or what the content will be, but I do know it is being worked on. So even though we have blogs, discussion groups and wikis, we haven’t turned our backs on the popular “book” format.

  3. Jeff Scoville Avatar
    Jeff Scoville

    Doug,
    I understand for Autocad files that you have to go to the server console and index the attribute block (by name) in order for it to appear as a property. Do you also have to enable content indexing service for attribute block properties to work correctly? We don’t run content indexing service, so I was wondering if that is why my attribute block properties still don’t work, even after indexing the attribute block and mapping it to the appropriate UDP.
    Thanks!

  4. I don’t think you need the content indexing service to get title block attributes. But I am not 100% sure on that. I suggest posting this issue on the Vault discussion group: http://forums.autodesk.com/t5/Autodesk-Vault/bd-p/101

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading