Forum OpenACS Development: Reordering tree sortkeys

Collapse
Posted by Gilbert Wong on
Is there any way to reorder a sortkey?  Right now, if I use the
OpenACS/PostgreSQL "connect by" solution, the sort order is the order
I entered in the objects.  Is there an easy way to insert an object
between two other objects or reorder the object sortkeys?  Thanks.
Collapse
Posted by David Kuczek on
I just upgraded the fs_connect_by function to sort all files and folders alphabetically.

https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=00038g&topic_id=11&topic=OpenACS

I thought to add another column that holds the alphabetically sorted tree. This way you could easily switch between ByDate and Alphabetically.

I am not sure if this is what you really wanted to hear...

Collapse
Posted by Dan Wickstrom on
There currently isn't an easy way to reorder sortkeys.  You could, however, write a pl/psql function to manually insert an object between two other objects.  This operation could be quite expensive though, since an insertion at the right point could cause the sortkeys for the most of the table to be recalculated.  This is not something that you would want to do on a large table like acs_objects.
Collapse
Posted by Gilbert Wong on
Dan.  Thanks.  I've been testing an idea.  It doesn't change the sortkey in the acs_objects table.  I'll post more info if it works.