Looking for an example of script which will map data from current page xml to a different structure (new template)

lcf's Avatar

lcf

13 Jul, 2016 05:48 PM

We have pages with existing content that needs to be mapped to a new data structure in our new template. Is there an example of this process (php? web services?) I have mapped what fields need to change just don't know how we should go about it. I don't need anything elaborate but need a direction.

Lauri

  1. 1 Posted by Ryan Griffith on 13 Jul, 2016 07:06 PM

    Ryan Griffith's Avatar

    Hi Lauri,

    This would definitely need to be done using Web Services. If I recall, Wing has some documentation on migrating structured data using his library. I made this discussion public to see if he might follow up with you.

    That being said, we have a suggestion on our Idea Exchange for adding the ability to map structured data, I highly recommend voting this up if you would like to see the suggestion considered for a future release.

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by lcf on 13 Jul, 2016 07:50 PM

    lcf's Avatar

    I was hoping for an example of translating a content region through either an XML transform or web services (read page, write data fields into variables (?), write page-or-xml out, etc).
    Can you comment at least on the approach or approaches we might take? I am feeling we should read and transform the xml first, then apply new Content Types, etc. There could be a much better strategy.

    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

  3. 3 Posted by Ryan Griffith on 13 Jul, 2016 08:12 PM

    Ryan Griffith's Avatar

    Hi Lauri,

    Sounds like you are on the right page. You would essentially read the page's existing structured data using Web Services, map that data to the new structured data, and then perform an edit on the asset.

    For reference, here is the data mapping example from Wing's library that I was referencing.

    Please let me know if you have any questions.

    Thanks!

  4. 4 Posted by Wing Ming Chan on 14 Jul, 2016 01:05 PM

    Wing Ming Chan's Avatar

    Lauri,

    If you need any hand-holding on web services, please let me know. Mapping data and switching content type/data definition are very advanced topics, not really for beginners of web services. But I'll try to help.

    Besides data mapping examples, I also provide a few programs I used at Upstate to convert sites. https://github.com/wingmingchan/php-cascade-ws-ns-examples/tree/mas...

    Wing

  5. 5 Posted by lcf on 15 Jul, 2016 03:54 PM

    lcf's Avatar

    HI Wing,
    I am going to be in Syracuse the week of July 18-22 and August 1-5. I teach a summer class for Syracuse University (and I worked there up to last fall when I took a job at CMU).
    I don’t know what your schedule is like, but if you have some time in the morning I’d be interested in your thoughts on our project. This is your work and looked promising as an approach:
    https://github.com/wingmingchan/php-cascade-ws-ns-examples/blob/master/recipes/data_mapping/dd_block_data_mapping.php

    Email is the best way to stay in touch with me. My cell is 315-317-0313.

    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

    On Jul 14, 2016, at 9:06 AM, Wing Ming Chan <[email blocked]<mailto:[email blocked]>> wrote:

  6. Tim closed this discussion on 15 Aug, 2016 03:18 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac