Space Types
Purpose
Breakout allows the developer to create custom space types to support any kind of collaboration. An example of a space type is the "Personal" space, which displays a user profile and is linked to a user account. A portfolio space type could have features for reporting on a list of linked spaces. A directory space type could have fields that track information for a certain type of company so that it can appear in a searchable directory.
Architecture and Components
From Florin
I created a new architecture for Space subtypes and I applied it for Personal spaces. At the model level I implemented rails single table inheritance scheme(we have now a new PersonalSpace? model which inherits default Space model). I used the same implementation at the controller level: for a new space subtypes we should create a new controller which extends parent space controler In our case PersonalSpacesController? extends SpacesController? and inherits all his actions and views. It also has its own actions(or overwrite) parent actions. To inherits parent controller views I used a similarly mechanism like here: http://wiki.rubyonrails.com/rails/pages/HowtoProductizeYourApplication Views, layouts and partials files are searched first in the subtype views folder(in our case views/personal_spaces folder) If not found will be searched in the parent space views folder(in our case views/spaces folder) For example PersonalSpacesController? has only profile.rhtml in his views folder and the rest of views are inheritted from SpacesController?. Also I tried to change the default url mappings for new space subtypes. I thought that will be more nice to have the urls for new space types in the following format:spaces/<space_type> instead of <space_type_controller> For this I added the folowing line to routes.rb(Maybe we can generalize this with a pattern to match any new space subtypes) map.connect 'spaces/personal/:action/:id',
:controller => "personal_spaces"So we will have urls like this http://localhost:3000/spaces/personal/profile/ctmdCGCaWr2OMUaobmW2AW for Personal spaces Until now I found an unfixed issues that I'm working at: redirections from other controllers to the correct subtype controllers(for example after adding a comment to a PersonalSpace?? flow the user is redirected to the parent SpacesController?? controller and not to PersonalSpacesController??)