Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Set Multiple value Metadata onto an asset in MediaBin using Mediabinapi.jar
traghu
Hello,
I have written code to apply metadata (captured in a form in teamsite) onto an asset in MediaBin. The metadata gets applied onto the asset as expected except in the case of multiple values metadata. In case of the multiple value metadata, only the first value gets applied. The following is the code I am using,
metadata[0] = new MBMetadata();
metadata[0].setMID(strGUID);
metadata[0].setIsMultipleValue(true);
ArrayOfAnyType arrayofanytype = new ArrayOfAnyType();
Object obj[] = new Object[3];
obj[0]="One";
obj[1]="Two";
obj[2]="Three";
arrayofanytype.setAnyType(obj);
metadata[0].setMValues(arrayofanytype);
arrayofmetadata.setMBMetadata(metadata);
mbasset.setMetadata(arrayofmetadata);
connector.getMBServer().reviseAssetMetadata(strAsset,arrayofmetadata);
can someone please help with this problem. Thanks,
Raghavendar
Find more posts tagged with
Comments
traghu
Can someone please help with this. Thanks.
msnider
Are you sure that you are specifying a multiple value metadata? Your code looks ok with the exception that you don't need to specify:
metadata[0].setIsMultipleValue(true);
And I am not sure why you have:
mbasset.setMetadata(arrayofmetadata);
Here's a sample snippet on how to set the Keywords metadata...
MBMetadata[] metadataArray = new MBMetadata[1];
metadataArray[0] = new MBMetadata();
metadataArray[0].setMName( "Keywords" );
metadataArray[0].setMID( "{5BE195ED-0726-11D3-9DDE-0060081F836F}");
ArrayOfAnyType arrayofanytype = new ArrayOfAnyType();
Object obj[] = new Object[3];
obj[0]="One";
obj[1]="Two";
obj[2]="Three";
arrayofanytype.setAnyType(obj);
metadataArray[0].setMValues(arrayofanytype);
ArrayOfMBMetadata arrayHolder = new ArrayOfMBMetadata();
arrayHolder.setMBMetadata( metadataArray );
mMediaBinServer.reviseAssetMetadata( assetID, arrayHolder );
Mark
traghu
Mark,
Thank you for your response. It helped me in debugging and fixing the problem.