Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Adding association category & related assets
Konidala
Hi All,
I was wondering MediaBin got any API method to add association category and related assets for the asset.
Any help would be appreciated.
Thanks
Find more posts tagged with
Comments
msnider
Which API are you planning on using?
Mark
Konidala
MBPNetModel
msnider
An association is treated just like metadata so to add a new association to an asset, use the method ReviseAssetMetadata. To get the list of available associations, use the method GetAssociations.
For example, to add an assocation called "Related Documents" with an id of {CB2DC534-43FC-4787-96E5-FB8A7691CFF0} to an asset with id of {BD062254-CF0A-4694-82B1-47533169C63B}, you would do the following:
MBMetadata[] array = new MBMetadata[1];
array[0] = new MBMetadata();
array[0].mName = "Related Documents";
array[0].mID = "{CB2DC534-43FC-4787-96E5-FB8A7691CFF0}";
array[0].mValues = new object[3];
array[0].mValues[0] = "{79A813F9-C4D3-4AEA-A5A0-E5B8168CF202}";
array[0].mValues[1] = "{24374F26-545F-408D-8592-D44CFF6D8EFC}";
array[0].mValues[2] = "{617EBE6C-41E5-4BAF-98B8-1031BFC11990}";
string assetID = "{BD062254-CF0A-4694-82B1-47533169C63B}";
svc.ReviseAssetMetadata( assetID, array );
Notice that the value list for the metadata is just a string array containing the ids of the assets to assign within the association.