Spaces-PURL-Contextual Puzzle. Fun. I was going to write this long style to finish wrapping around it.
What are spaces?
Spaces is a module that creates redefined configuration containers for your site. This does not apply specifically to functions, this is about any number of configuration values that can work with spaces, including function activity or not. (Active does not mean that the module is disabled, just a few function-oriented objects have been deleted, for example, content types and object-oriented views.
When using spaces, you need to decide what type of buckets you want to use. Open Atrium uses OG and User-shaped buckets, you need a new kind of bucket based on the user role. For the sake of sanity, you may need to create a separate module to define user roles as a more specific thing in Drupal, such as how Spaces OG should rely on organic groups for a number of concepts.
What is context?
Context is, ultimately, a page layout engine. You talk a little about the page, it changes the page accordingly. The context cannot change the URL, it is the other way around. Functions define Contexts in order to tell the site how to render this page unambiguously for this function; there is no direct connection between Context and Spaces or Context and PURL.
What is PURL?
PURL is a way of pasting things into a URL and storing them there until you are done with them.
How are these glues together
PURL-integrated spaces are launched based on one of two things: URLs or something about the content on the page. To explain this, I use Spaces OG as an example.
- You click the link. The link was previously created by the PURL component, which Spaces OG monitors for tips. If this fragment of the URL makes sense for spaces, Space is triggered.
- All links, except those that exclude PURL modification, save the PURL URL element, which means that the space is happy, and restarts with every page load.
- Spaces OG knows how to check nodes for their group membership. If spaces can open a node file and find a group, it will launch that node Space using a modified version of PURL
drupal_goto() to redirect the entire page to URL consistency. This will lead to overcoming any existing URL structure. - If the URL component is missing and the node does not have a group membership, the space does not start.
As soon as the Spacebar starts, all Spaces configuration values are brought into the game. This will mean the default defaults (you can have several Space default configurations for each Space type) overlay the Drupal default values, which, in turn, are overridden by any configuration saved specifically for Space. In the case of Open Atrium, this includes such nice things as group color, toolbar blocks, and included features.
If the user navigates to something provided by Feature-a Node, view, etc., any Contexts associated with this Node, this view, this URL that any module can provide, can simply be called, and start Do something with blocks and tags to customize the page for Feature Content.
Next steps
As I mentioned above, it sounds to me as if your first step is to try to take a look at Spaces OG and rewrite it to focus on the user's role instead of organic groups. You do not need to do much with PURL, except for a small copy and paste from Spaces OG. You might want to post Spaces on the release line to take a swim with this idea, where people around you can see it and give pointers.