Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Elias 25 posts 108 karma points
    Jul 25, 2012 @ 20:05
    Elias
    0

    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!!!

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jul 25, 2012 @ 20:13
    Jeroen Breuer
    1

    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

  • Elias 25 posts 108 karma points
    Jul 25, 2012 @ 23:03
    Elias
    0

    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.

  • Elias 25 posts 108 karma points
    Jul 26, 2012 @ 00:18
    Elias
    0

    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

     

Please Sign in or register to post replies

Write your reply to:

Draft