Copied to clipboard

Flag this post as spam?

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


  • Laurent Lequenne 123 posts 248 karma points
    Apr 01, 2011 @ 14:51
    Laurent Lequenne
    0

    Some BaseTree questions

    • How to implement load on demand
    • How to implement context menu on right click of nodes ?

    Simple question, basic functionality ... And I do not find any info !

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 01, 2011 @ 15:13
    Tom Fulton
    0

    Hi Laurent,

    Not exactly sure what you mean by Load on Demand, can you explain further?

    However, adding a Context Menu Item is fairly simple using the IAction interface.  There's an episode on umbraco.tv about it here:  Add items to the context menu.  You can also look at the built-in umbraco actions in the source (here's ActionDelete) for reference.

    Note, last I checked, there was a bug in the source attached to the video (due to a change in 4.5).  The fix is here and further explained here.

    Hope this helps,
    Tom

  • Laurent Lequenne 123 posts 248 karma points
    Apr 01, 2011 @ 15:33
    Laurent Lequenne
    0

    Load on Demand : means that I want to load children of a node only when the user actually clicks on the node, as it is actually done in the content part.

    If I understood well the the basetree only loads one level at a time ?

    I'm  writing such a thing, but not yet tested. (So go back to try to put code on this forum !!! Misère misère !) But now I'm not sure what is the GetTreeServiceUrl, does it actually load the children, or does it create a callback function to be able to retrieve them later :-)

             public  override  void  Render(ref  XmlTree  Tree)

     

    I'll see later for those actions... But I'll certainly need it later. Currently I have developped a set of document handlers but they are created directly in the content using document types, as a lot of more configuration settings, or datasources, and some other stuff. I would like to put all this out of the content manager and create a complete configuration application.  But my first thing is those copy actions, as we are planned to have a site with more then 30 subsites by country where the content will need to be copied, and synchronized somehow.

    One thing also with those document handlers is that apparently we can not give an order of processing, I have by example an handler to index documents... But I the document is moved, or the action is cancelled, it's not sure that I need to index the document, or it would not be indexed as it should, or it should even be deleted from the index. Some flow manager is missing around those publications :-)

     

    Anyway already thank you for that information :-)

     

    Laurent Lequenne

     

     

             {
                 if  (base .NodeKey == String .Empty)
                 {
                     // Create the root node 
                     var  rootNode = XmlTreeNode .Create(this );
                     rootNode.Text = "Content Handlers Configuration" ;
                     rootNode.Icon = "docPic.gif" ;
                     rootNode.Action =  ;
                     rootNode.Source = base .GetTreeServiceUrl("contentHandlerConfig" );
     
                     Tree.Add(rootNode);
                 }
                 else 
                 {
                     switch  (base .NodeKey)
                     {
                         case  "contentHandlerConfig" :
                             var  copySettings = XmlTreeNode .Create(this );
                             copySettings.Text = "Copy Settings" ;
                             copySettings.Icon = "docPic.gif" ;
                             copySettings.Action =  ;
                             Tree.Add(copySettings);
                             var  acopySettings = XmlTreeNode .Create(this );
                             acopySettings.Text = "Automated Copy Settings" ;
                             acopySettings.Icon = "docPic.gif" ;
                             acopySettings.Action =  ;
                             Tree.Add(acopySettings);
                             break ;
                     }
                 }
             }
  • Laurent Lequenne 123 posts 248 karma points
    Apr 01, 2011 @ 15:36
    Laurent Lequenne
    0

    OK load on demand is solved, it's by default ... And it's working how I expected :-)

Please Sign in or register to post replies

Write your reply to:

Draft