Generate xml for DAMP property value from media item
Hi all,
Im writing a web service (ws) to 'talk' with an umbraco installation. This ws its fired when an image is uploaded to our CDN, then using the MediaService a new media item is created based on the new imege, after this i need to update the DAMP property of a Node - already created - in order to link this property with the new Media Item created. There is any method on DAMP api for generate the xml stored on the DAMP property, using as parameter an specific Media Item?
In Installer.ascx.cs I also create media items and than set them on properties (from comment "//Save the media items in the node."). That's probably what you're looking for.
I have read those posts but that approach are useful if you are running under umbraco context (access to DB)
Taking a look to the source code of DAMP, i found the methods thatinstaler.ascx.csuse to build the XML:
public static XDocumentGetXML(string[] ids) and inside this method -> public static XElementGetMediaElements(string id) but this last one make a connection to the umbraco DB, because I’m on a Web Service disconnected from my umbraco i can't do queries to the DB.
At this moment I’m building a new GetMediaElements, that’s loads an XElement form a mediaCarrier (a serializable object used in the web service api to handle Media Items). If i can get this method works, i will post the code.
Me again, my new method can't be done, since the mediaCarrier dosen't have all the data needed to build the xml, so the only choice left is to build another webmethod or web service inside umbraco to serve this especific data.
Generate xml for DAMP property value from media item
Hi all,
Im writing a web service (ws) to 'talk' with an umbraco installation. This ws its fired when an image is uploaded to our CDN, then using the MediaService a new media item is created based on the new imege, after this i need to update the DAMP property of a Node - already created - in order to link this property with the new Media Item created. There is any method on DAMP api for generate the xml stored on the DAMP property, using as parameter an specific Media Item?
Thanks in advance!!!
Hello,
This topic might help: http://our.umbraco.org/projects/backoffice-extensions/digibiz-advanced-media-picker/digibiz-advanced-media-picker/23406-Add-image-to-DAMP-datatype-using-API.
In Installer.ascx.cs I also create media items and than set them on properties (from comment "//Save the media items in the node."). That's probably what you're looking for.
Jeroen
Hi Jeroen thanks for your quick reply!
I have read those posts but that approach are useful if you are running under umbraco context (access to DB)
Taking a look to the source code of DAMP, i found the methods that instaler.ascx.cs use to build the XML:
public static XDocument GetXML(string[] ids) and inside this method -> public static XElement GetMediaElements(string id) but this last one make a connection to the umbraco DB, because I’m on a Web Service disconnected from my umbraco i can't do queries to the DB.
At this moment I’m building a new GetMediaElements, that’s loads an XElement form a mediaCarrier (a serializable object used in the web service api to handle Media Items). If i can get this method works, i will post the code.
Regards, Elias.
Me again, my new method can't be done, since the mediaCarrier dosen't have all the data needed to build the xml, so the only choice left is to build another webmethod or web service inside umbraco to serve this especific data.
I'll let you know how it goes!
Elias
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.