x First time here? Check out the FAQ
Join us a the Umbraco event of the year - get your Codegarden 14 early bird ticket today
  • Avatar167posts211karma

    Courier transfer with uComponents Multi Node Tree Pickers

    Matthew Bliss started this topic June 29, 2011 @ 03:20, Go directly to the topic solution

    I am having a frustrating first attempt at using Courier 2 Express and am hoping someone can help!

    I have just tried trasferring a site which contains uComponents Multi node tree picker data types for most of the document types and therefore most content nodes.

    The datatypes all seem to be copied over okay but the selected nodes in the tree pickers within the transferred content seem to have been corrupted in the transfer.

    For some nodes in the copied site the multi node picker data types contain content nodes in the selection when the control (and of course the original content) is defined as being a media item. In most cases this just causes the familiar 'Error parsing XSLT file' on the site and could be fixed manually by editing the content.

    However for some nodes it is not even possible to view or correct the content as clicking on the node in the content section produces an exception when Umbraco tries to display that node in the backend:

    For nodes where no selections have been made in the multi node pickers the transfer appears to be okay.

    Does anyone know of a fix to the problem? In the short term is there a way to prevent the data from certain node types being transferred? At least that way it would be possible to transfer a working site and then have a small manual process of updating the missing multi node selections for the relevent nodes.


  • Avatar167posts211karma
    Comment with ID: 81574
    Matthew Bliss posted this reply June 29, 2011 @ 03:23

    I could not get the error to post without (ironically) giving an 'Error parsing XSLT' on this site! So this is a second try:

    Server Error in '/' Application.


    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
       uComponents.Core.DataTypes.MultiNodeTreePicker.MNTP_DataEditor.SelectedValues_ItemDataBound(Object sender, RepeaterItemEventArgs e) +744
       System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +203
       System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +642
       System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +166
       System.Web.UI.Control.LoadRecursive() +70
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Control.LoadRecursive() +189
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3047
    



    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 


  • Chris Houston posted this reply June 29, 2011 @ 03:27

    Hi Matthew,

    Courier only supports the built in Umbraco data types out of the box and hence third party components like uComponents will not work without a provider written so that Courier understands the data types.

    So in a nut shell you either need to write your own provider ( see the developer docs ) or hope that the uComponents team will soon release a provider for all their datatypes, I am sure a lot of people are also hoping the same :)

    Cheers,

    Chris


  • Avatar167posts211karma
    Comment with ID: 81579
    Matthew Bliss posted this reply June 29, 2011 @ 03:33

    Hi Chris,

    Wow that was quick!

    Not the answer I was hoping to hear, most of my project use the uComponents data types which is going to make using Courier hard going in the meantime.

    Thanks for the answer though!

    Matt


  • Avatar3036posts8599karma
    adminComment with ID: 81580
    Lee Kelleher posted this reply June 29, 2011 @ 03:33

    I haven't tried this myself, but just from talking with other developers at CodeGarden 11, the issue with MultiNode Tree Picker and Courier is when you choose to store the data/value as XML.  If you store it as CSV, then it "should" work fine.

    Not sure how this effects other data-types in uComponents... yet! (I'm only just starting to use Courier 2 myself)

    Cheers, Lee.


  • Avatar167posts211karma
    Comment with ID: 81584
    Matthew Bliss posted this reply June 29, 2011 @ 03:52

    Hi Lee,

    Many thanks for the answer.You are absolutely right I am storing the data as XML, it seemed the logical choice when using XSLT to create the output.

    Do you know if there are any code examples for splitting and outputing CSV data using XSLT? If so changing how the data type stores the content and altering the macros might be my quickest solution on an ongoing basis.

    As a short term work around, is there a simple change that I could apply to each of the Multi Node Picker data types that would result in the content nodes which have properties of that type losing their selection? (For example would changing the data type to CSV have the desired result) If so I could quickly force all the Multi node properties within all content nodes to have empty selections the Courier transfer should work and then I could do a manual tidy up of the other end.

    Thanks,

    Matt


  • Chris Houston posted this reply June 29, 2011 @ 03:54

    From my understanding Courier needs you to write Providers for all third party datatypes so that it understands their structure and is able to replace node ID's with their Unique ID's ( GUID's ) and the reverse when restoring them on the target server.

    Have a look at page 10 of the developer's guide for more information.

    Cheers, Chris


  • Avatar2243posts3096karma
    Comment with ID: 81590
    Rich Green posted this reply June 29, 2011 @ 04:04

    Slightly off topic but here's the code if you want to get the values from CSV:

    <xsl:variable name="splitProperties" select="umbraco.library:Split($csvproperties, ',')" />

    <xsl:for-each select="$splitProperties/value">
    <xsl:variable name="currentNode" select="umbraco.library:GetXmlNodeById(.)" />
    <xsl:value-of select="$currentNode/@nodeName"/>
    </xsl:for-each>

    Rich


  • Avatar167posts211karma
    Comment with ID: 81595
    Matthew Bliss posted this reply June 29, 2011 @ 04:08

    Thanks Rich,

    I have let the topic start to wonder a little! Thanks for the code sample, that's really straight forward.

    Matt


  • Avatar809posts3064karma
    HQComment with ID: 81670
    Per Ploug posted this reply June 30, 2011 @ 08:29

    As Chris said, if you store Node Ids in a custom XML structure, you will need to write a provider to allow Courier 2 to understand that the xml structure contains IDs it should pick up.

    work is in progress to have a generic xpath resolver, which can basicly work with any datatype which saves as xml, it just needs a xpath to resolve nodeIds, but for now, you have to write your own provider

     


  • Avatar167posts211karma
    Comment with ID: 81684
    Matthew Bliss posted this reply June 30, 2011 @ 10:50

    Thanks Per,

    The generic provider sounds like a great idea!

    Matt


Please login or Sign up To post replies