Hi,
I'm working on a plugin, My requirement is to save my custom information in metadata and access it later using web application.
I thought it was saving my custom information in file (verified it through data in File -> File Info -> Raw Data). But after reading the same file from my web application, my custom information was missing. I'm not sure about what I may be missing.. Kindly help me to figure this out..
This is the code I wrote to save custom information.
afterSaveCommand {
const char* xap; | |
sAIDocument->GetDocumentXAP(&xap); | |
AIXMPDataFieldMap* xmpfield = new AIXMPDataFieldMap(); | |
xmpfield->name = "CreatorTool"; | |
xmpfield->replace = true; | |
xmpfield->value = "Custom Plugin"; | |
char* xapMod; | |
sAIAssetMgmt->UpdateDynamicMetadataFields(xap, xmpfield, 1, &xapMod); | |
QDomDocument xmpDoc; | |
xmpDoc.setContent(QString(xapMod)); | |
QDomElement rootElement = xmpDoc.documentElement(); | |
QDomElement rdfElement = xmpDoc.elementsByTagName("rdf:RDF").at(0).toElement(); | |
QDomElement rdfDescriptionElem = xmpDoc.createElement("rdf:Description"); | |
rdfDescriptionElem.setAttribute("xmlns:customData", "http://www.custom.fake/myArt#"); | |
QDomElement myArt = xmpDoc.createElement("customData:myArt"); | |
QDomElement rdfBagElem = xmpDoc.createElement("customData:Bag"); |
//add art details here. | |
addArtDetails(xmpDoc,rdfBagElem); |
myArt.appendChild(rdfBagElem); | |
rdfDescriptionElem.appendChild(myArt); | |
rdfElement.appendChild(rdfDescriptionElem); | |
sAIDocument->SetDocumentXAP(xmpDoc.toString(0).toUtf8()); |
And I'm using pdfbox at my web application..
Thanks,
Pralhad