Agnes Ro, Confluence Developer

Description

Currently in Confluence there is no way for the user to order pages within it's tree (ordered by title by default). The ability to order pages would be a useful feature for html/pdf exports. CONF-1031 is a very highly voted for feature with 99 votes and also something I wanted so I could correctly produce my thesis report.

fedex_pageorder.png

Implementation

The thing I found most difficult about this feature was to encapsulate it into an appropriate and user friendly UI. I concluded that a 'drag-and-drop' approach would be the most appealing to users and found a tool called tool man which supported a simple drag-drop library. I was able to integrate the top level pages with this tool without too much difficulty and also add an ajax request to update the page "weight" upon drag/drops.

In terms of storing a page's order, I added a new field "weight" to the ContentEntityObject (which evidently is not the most ideal implementation but was the easiest). When a CEO's bag of "children" are retrieved, it is returned ordered upon this new "weight" field. Additionally, usages of the CEOTitleComparator were replaced with a CEOWeightComparator.

Problems

The drag-drop library I had chosen did not support nested lists to be drag-and-droppable, so I was only able to get the top level page ordering implemented (i.e in my current implementation the children pages of a top level page cannot be ordered). I did try my best to tweak the library but to much dismay failed to get nested lists working.

A few more issues that would need to be dealt with for a complete implementation would be:

  • upgrade task to order pages existing pages with a "weight"
  • deal with add/move of pages
  • maybe try to think of a better store mechanism than adding a weight field to all CEOs

Tags: fedex, fedex5

3 Comment(s)

I am sooooo glad this was finally done. I've been asking for this for ages. This will make writing technical docs so much nicer now, especially when combined with the TOC macro.

By Patrick Lightbody at May 20, 2007 8:32 PM

Just a reminder, this is was my fedex implementation hence it has not really been completed for release:) I would recommend watching the issue for updates.

Agnes.

By Anonymous at May 21, 2007 6:46 PM

Hey ... could you email me details of this implementation, so that I can make pagetree2 compatible with it ... pagetree2 already offers abstract page ordering (although it does it using an alphanumeric key added as a text property to the ceo, rather than modifying the ceo itself) it also implements it's own version of the children macro which wont be needed anymore once this code gets integrated into the main source.

Thanks,

Alain.

By Alain Moran at May 25, 2007 1:37 PM

Post a comment

If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.





Remember personal info?

Type the characters you see in the picture above.