Tags:
features1Add my vote for this tag create new tag
, view all tags

Dynamically modifying parent-child relationships

EditTopicTreeStructure started the conversation of reparenting multiple topics at the same time. The implementation revolved around a twiki topic that defined the topic hierarchy as a bullet list, and backend stuff to read this topic and update the individual META tags (if necessary).

I've always wanted to this to be more user-friendly in order to make this a more frequently user feature. Recently, I came across dynamic drag-&-drop of a folder tree over at http://www.dhtmlgoodies.com, which seemed to be well suited to the task of topic reparenting.

What does work

I've cooked up a rudimentary prototype (ALERT! semi-functional) to illustrate the basic process. (Note the link can take a while to load.)

  • Display of the hierarchy and drag and drop update of the structure.
  • Hover over a topic to display additional information (summary, modified on, etc.)
  • There can be three roots of the tree:
    • WebHome is the root of most of the topics.
    • NOPARENT is the root for topics without any parent.
    • OTHER_WEB is the root for topics that have parents in another web.
  • None of the roots are draggable and nothing can be dragged into a root other than WebHome.

What needs to be done to get this functional

  • Speed! Currently, the whole topic tree + information about each topic is downloaded at page load (using a formatted SEARCH). Either the tree needs to be regenerated periodically and stored on the server, or at the very least the topic information needs to be fetched using AJAX (this shouldn't be too difficult).
  • The actual update function.
    • Needs to handle topic locks gracefully. The way I envision it, each time a topic is moved to a new parent, its color changes (or some other visual indication of a pending move). When the user hits the update button, if the action is successful the color reverts, otherwise it changes to a more glaring indication of a failure.

  • Lots more things can be done to make this much more useful. The interface can be extended to actually allow a user to change the topic's information (such as picking a more appropriate name, modifying the summary (this implies a separate Meta field), changing form values, etc. ... but that's for a much later date.

-- PankajPant - 07 Aug 2006


Interesting work!

I always thought that TWiki needs a Plugin that simply returns a list of topics of a web with topics in the proper parent/child relationship. Something like a simple and fast version of the TreePlugin, for other Plugins to use.

-- PeterThoeny - 08 Aug 2006

Another feature that I'm thinking of adding is on-demand topic information (like summary, version, last edit, tags(?), ref-by, etc.) which would be fetched via AJAX and shown as a tooltip.

This would it much easier to deduce where a topic fits best without having to read the topic (and thus breaking the workflow).

-- PankajPant - 08 Aug 2006

See DynamicTopicTree for a start of a solution.

-- PankajPant - 27 Aug 2006

DynamicTopicTree has been updated with an actually working version (well almost ... see description above).

-- PankajPant - 26 Sep 2006

Kinda kool I like the idea. I'm a bit scared to play with the prototype not wanting to mess with twiki.org. So I tried to display the sandbox hierarchy but it didn't show anything. I'll try to put it up on my private TWiki and see what I get.

-- StephaneLenclud - 27 Sep 2006

Play with it all you want ... it doesn't really do anything smile ie. you can move topics around but nothing gets saved. That will be the last piece of the puzzle after the interface etc. are finished.

-- PankajPant - 27 Sep 2006

It doesn't seem to work with the Sandbox web and I'm not sure why. There is a JS error being reported which I'll need to look into.

-- PankajPant - 27 Sep 2006

Turned out that topics can declare themselves as their own parent (eg. AdamRygiolSandbox) which was causing a recursion. Not sure if this is a bug or a "feature", but such topics are now listed under the NO_PARENT node.

-- PankajPant - 27 Sep 2006

As our TWiki is growing in my company it seems obvious too me that such a tool is not "Kinda kool" as I stated above but rather a "must have" to keep the structure of the TWiki consistent and not so painful to maintain. In fact being able to move an entire topic tree from one place to another (even across Webs) would be most useful. Is there other tools doing something like that already?

-- StephaneLenclud - 21 Nov 2006

Not to my knowledge. On moving entire topic tree to another node within the same web: You get this by simply reparenting a parent topic. All its children and grand children will follow.

-- PeterThoeny - 21 Nov 2006

But the moving of entire trees should also work across web as it is a really dumb work moving every single topic of a tree and then reparenting it. It's awful!

-- MarijanaPrusina - 06 Dec 2006

Well, physically, a reparenting across webs means to move the selected topic and all its children to the new web. That is, re-parenting across web is more than simple selecting a new parent for a topic.

-- PeterThoeny - 06 Dec 2006

(I moved the parent discussion to AvoidParentAcrossWebs)

-- PeterThoeny - 08 Dec 2006

This looks nice already! I tried it on my installation (just pointing to this topic for all the files). The tooltip pops up just above the tree, pushing everything down. Also the contents of the tooltip aren't formatted. Am I missing something?

I'm really looking forward to this one!

-- JosMaccabiani - 05 Jan 2007

Does anybody know how to actually reparent topics with this code? I can´t find any hints on that. thanks

-- CarloJoerges - 02 Feb 2007

I'm sorry. I'm completely swamped and won't have time for this in the near term. I was working on this as a means to learn Java/AJAX programming and produce something useful in the process, and my free time has unfortunately evaporated. The code is available below, so feel free to enhance it. See the "remaining work" section to get an idea of what needs to be done.

-- PankajPant - 02 Feb 2007

Has this been progressed at all?

-- MartinCleaver - 10 Oct 2008

I discuss one option, using GlobalReplacePlugin, on MassReparenting

-- MartinCleaver - 10 Oct 2008

Topic attachments
I Attachment History Action Size Date Who Comment
JavaScriptjs ajax.js r1 manage 5.0 K 2006-08-07 - 17:10 PankajPant  
GIFgif dhtmlgoodies_folder.gif r1 manage 0.9 K 2006-08-07 - 17:11 PankajPant  
GIFgif dhtmlgoodies_minus.gif r1 manage 0.2 K 2006-08-07 - 17:12 PankajPant  
GIFgif dhtmlgoodies_plus.gif r1 manage 0.2 K 2006-08-07 - 17:12 PankajPant  
GIFgif dhtmlgoodies_sheet.gif r1 manage 0.1 K 2006-08-07 - 17:13 PankajPant  
HTMLhtml download.html r1 manage 2.9 K 2006-08-07 - 17:12 PankajPant  
Cascading Style Sheet filecss drag-drop-folder-tree.css r1 manage 0.7 K 2006-08-07 - 17:13 PankajPant  
HTMLhtml drag-drop-folder-tree.html r1 manage 4.0 K 2006-08-07 - 17:14 PankajPant  
JavaScriptjs drag-drop-folder-tree.js r2 r1 manage 17.3 K 2006-09-26 - 15:04 PankajPant  
GIFgif dragDrop_ind1.gif r1 manage 0.1 K 2006-08-07 - 17:12 PankajPant  
GIFgif dragDrop_ind2.gif r1 manage 0.1 K 2006-08-07 - 17:13 PankajPant  
GIFgif folder_close.gif r1 manage 0.3 K 2006-08-07 - 17:14 PankajPant  
GIFgif folder_dots.gif r1 manage 0.1 K 2006-08-07 - 17:15 PankajPant  
GIFgif folder_folder.gif r1 manage 1.0 K 2006-08-07 - 17:16 PankajPant  
GIFgif folder_lastsub.gif r1 manage 0.1 K 2006-08-07 - 17:16 PankajPant  
GIFgif folder_open.gif r1 manage 0.3 K 2006-08-07 - 17:16 PankajPant  
GIFgif folder_sub.gif r1 manage 0.3 K 2006-08-07 - 17:16 PankajPant  
HTMLhtml plugins_tree.html r1 manage 132.1 K 2006-08-07 - 17:17 PankajPant  
Cascading Style Sheet filecss topic-tree.css r2 r1 manage 0.8 K 2006-09-27 - 16:31 PankajPant Styles for topic tree and info popup.
JavaScriptjs topic-tree.js r2 r1 manage 10.4 K 2006-09-27 - 16:31 PankajPant JS to generate topic trees.
Edit | Attach | Watch | Print version | History: r24 < r23 < r22 < r21 < r20 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r24 - 2008-10-10 - MartinCleaver
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.