Forum OpenACS Q&A: Response to Generalized Partial Order Manipulation For ACS Objects?

Basic ACS Objects aren't ordered in any sense. Object types have an inheritance association, of course, but objects themselves don't.

The tree sortkey you see in the ACS Objects table is used to track the permissions inheritance tree, linked through the context_id field . In the PG version the context_id field isn't actually needed (the tree sortkeys encode the same information as you'd get by chasing the context_id field). However in Oracle we actually do chase context_id using CONNECT BY queries. In order to standardize APIs and maintain as many queries as possible in common we maintain context_id and manipulate the tree sortkey in PG via the triggers you see in the datamodel.

Certain object types are mapped to a tree, in particular content types (see acs-content-repository). These types (and types derived from these types) are ordered into a folder/object style hierarchy. The content types have an additional tree sortkey which encode the relationship of the content object to other content objects in the system.