Forum OpenACS Development: Re: nesting and list-builder

Collapse
Posted by Janine Ohmer on
Thanks, guys! I'm hoping to get it working with list builder, but it's good to know I have options if I can't get there.

My first task was to get the data out in the right order. I sort of got there by following the example of file-storage. I'm currently doing this in PG, though the final implementation will be in Oracle.

The query's where clause originally looked like this:

        WHERE
        p.project_id = i.live_revision and
        s.status_id           = p.status_id
        [template::list::filter_where_clauses -and -name projects]
        [template::list::orderby_clause -orderby -name projects]
I modified it to
        WHERE
        p.project_id = i.live_revision and
        s.status_id           = p.status_id
        and i.tree_sortkey between l.tree_sortkey and tree_right(l.tree_sortkey)
        and l.item_id = pm_project__get_root_folder (:package_id, 'f')
        [template::list::filter_where_clauses -and -name projects]
        order by i.tree_sortkey
This works, but has two problems:
  1. Although the various levels are sorted correctly, I can't figure out how to also get the items to sort alphabetically by title within each level
  2. I've lost the call to orderby_clause and have no idea how to get the order by tree_sortkey integrated with it. I've read all the docs I can find on list builder's orderby and I still don't understand it very well.
Clues?