In the POC version of the solution, the space structure shown in the AJAX UI and the space structure in Alfresco was the same. This made things simple, I just created a Freemarker template that made one of the sample web scripts produce JSON on the form I needed. As I have mentioned previously in this thread, information on how the modules were composed were handled by a separate DB.
Now the structure supports several clients, languages, WIP modules, Released modules, etc. This new structure is no longer suitable for the UI, so I created a custom secondary structure with references to the main structure. To make the extra DB redundant, I created another secondary structure with a space hierarchy describing part composition. The non-primary structures are updated, by scripts triggered by rules, when new material is released in the main structure.
I have a simple aspect that adds a releasable property which is set to true when some conditions are met. The script that handles the release process can be run on the nodes with the releasable property set to true. I also use aspects to add extra properties to the containers in the secondary structures.
Some comments on my approach would be appreciated since I have been unable to find any samples or guidelines on how to model non-trivial relations. Am I doing things the right/intended way?