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)
Setting MetaData Dynamically
kalai
Hi
Can any one suggest me how to set the metadata dynamically using setMetadata method in Java.
Thanks in Advance
Kalai
Find more posts tagged with
Comments
msrinivas
Can you please give a complete use case of what you are trying to do?
kalai
Hi.
Thanks for the reply.
Here is what we are planning to do.
We use Teamsite's workflow for asset approval & so we are integerating mediabin with teamsite. Here the user gets into the mediabin webclient, selects an asset and submits it to the workflow by clicking onto the custom added menu item - say "Asset Review".
Now a Teamsite's workflow instantiation screen pops up, where he selects the reviewer for that asset. TS Wf sends email to the reviewer, the reviewer reviews and feeds in his comments.
Now i want to capture this comments and set it as a metadata value to the asset in the mediaBin server.
I am trying to do this using MBSDK. I have started off with a standalone java application.
I am able to connect to mediaBin server, retrieve the list of metadata, but not able to set them back.
Below is the snippet of code that i am using.
---------------------------------------------
ArrayOfString aos=myServiceStub.getAssetIDList("{17AFFBF8-966B-4838-952D-D37A708F720A}");
String s[]=aos.getString();
for(int j=0;j {
MBAsset mba=myServiceStub.getAsset(s);
ArrayOfMBMetadata aom=mba.getMetadata();
System.out.println("Asset Name is====>"+mba.getMName());
MBMetadata mbmd=new MBMetadata();
MBMetadata[] mbMetadata=aom.getMBMetadata();
for(int k=0;k strMName=mbMetadata.getMName();
System.out.println("Metadata Name " + strMName);
if(strMName.equals("Product")){
mbMetadata.setMValue("Revised");
System.out.println("Metadata Name===>"+strMName+","+"Metadatavalue===>"+mbMetadata.getMValue());
}
}
String assetID = s.toString();
boolean b = myServiceStub.reviseAssetMetadata(assetID,aom);
------------------------------------------
I get the following error at the last line when executed.
------------------------------------- ----------------
AxisFault
faultCode: {
http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> MBPNetModel.MBObjects.MBException: MBException: The type must match the original. (0x80040449)
at MBPNetModel.MediaBinScriptModel.MediaBinServerImpl.ReviseAssetMetadata(String assetID, MBMetadata[] metadataArray, MBConnection mbConnection)
at MBPNetModel.WebServices.MediaBinServer.ReviseAssetMetadata(String assetID, MBMetadata[] metadataArray)
--- End of inner exception stack trace ---
faultActor:
faultNode:
faultDetail:
{
http://xml.apache.org/axis/}stackTrace:
AxisFault
faultCode: {
http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> MBPNetModel.MBObjects.MBException: MBException: The type must match the original. (0x80040449)
at MBPNetModel.MediaBinScriptModel.MediaBinServerImpl.ReviseAssetMetadata(String assetID, MBMetadata[] metadataArray, MBConnection mbConnection)
at MBPNetModel.WebServices.MediaBinServer.ReviseAssetMetadata(String assetID, MBMetadata[] metadataArray)
--- End of inner exception stack trace ---
faultActor:
faultNode:
faultDetail:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> MBPNetModel.MBObjects.MBException: MBException: The type must match the original. (0x80040449)
at MBPNetModel.MediaBinScriptModel.MediaBinServerImpl.ReviseAssetMetadata(String assetID, MBMetadata[] metadataArray, MBConnection mbConnection)
at MBPNetModel.WebServices.MediaBinServer.ReviseAssetMetadata(String assetID, MBMetadata[] metadataArray)
--- End of inner exception stack trace ---
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at com.mediabin.
www.MediaBinServerSoapStub.reviseAssetMetadata(MediaBinServerSoapStub.java:4121
)
at MBSMetaData.ConnectToMediaBin(MBSMetaData.java:272)
at MBSMetaData.main(MBSMetaData.java:327)
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> MBPNetModel.MBObjects.MBException: MBException: The type must match the original. (0x80040449)
at MBPNetModel.MediaBinScriptModel.MediaBinServerImpl.ReviseAssetMetadata(String assetID, MBMetadata[] metadataArray, MBConnection mbConnection)
at MBPNetModel.WebServices.MediaBinServer.ReviseAssetMetadata(String assetID, MBMetadata[] metadataArray)
--- End of inner exception stack trace ---
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at com.mediabin.
www.MediaBinServerSoapStub.reviseAssetMetadata(MediaBinServerSoapStub.java:4121
)
at MBSMetaData.ConnectToMediaBin(MBSMetaData.java:272)
at MBSMetaData.main(MBSMetaData.java:327)
-------------------------------------------------------------------
Any pointers on what might be the issue here OR
any other way of going about the whole stuff will be very helpful.
Thanks for your time,
Regards,
Kalai
msrinivas
What permissions does the user id that you are using to connect to MB have on the folder that contains the asset that you are trying to edit metadata. Does it have change permissions? What version of MB and TS?
kalai
Hi
Thanks for ur valuable reply.
I am using the administrator id as a mediabin user id. This id has all the permissions including metadata change permission. So I think that there is no problem with permissions. We are using the MB version 4.5 and TS 6.5.
Regards
Kalai
lyman
Sorting through the trace, the relevant MB error is:
MBPNetModel.MBObjects.MBException: MBException: The type must match the original. (0x80040449)
It would appear that the metadata field you are trying to revise is not of the type of the metadata that you are trying to insert into it!
Cheers,
Lyman Hurd