Forum OpenACS Development: Extending .LRN Portal types

Request notifications

Collapse
Posted by Victor Guerra on
Hey all,

Im currently working on extending the .LRN portal types. At this moment there are 4 types of .lrn portals: 'user', 'dotlrn_community', 'dotlrn_class_instance' and 'dotlrn_club'.

What i would like to do is to add subtypes to each portal type, for example, we could have 2 diferent subtypes of the 'user' portal: Begginer User Portal and Advanced User Portal, and select which of the 3 (default and the 2 subtypes) types is going to be used by default when adding a dotlrn user (A parameter indicates which type to use).

This example applies for classes, communities and subgrups.

The purpose of this functionality is to have diferent configurations for each portal type of .lrn.

I have been thinking of let the user/class-administrator/community-administrator/subgruop-administrator change his default portal type ( An option in the control panel where he could be able to switch from one portal subtype to other).

Any comments or sugestions on this are welcome =).

Regards,
Victor Guerra.

Collapse
Posted by Victor Guerra on
This is what i have so far:

I added a field ('parent_type') to dotlrn_portal_types_map table, the reason of this field is to indicate which is the parent portal type for a given portal type (This new field references 'type' in the same table.) In this way we can define dotlrn portal "subtypes" based on the default types.

So now on, I have the 4 default dotlrn portal types and im able to define more dotlrn portal types based on the 4 default. (e.g. i am able to add the type "user_advanced" which parent_type value is user).

I added a parameters secction in dotlrn package, named ".LRN Portal Types", in this section there are 4 parameters "dotlrn_class_instance","dotlrn_club","dotlrn_community","user" (this names matches with the default dotlrn portal types as you can see). Each parameter indicates wich portal type has to be used when creating a portal for each type.

For example if the value of the parameter "user" is "user_advanced", then, when creating the portal of the dotlrn users, the template used will the portal associated with the "user_advanced" portal type.

In the portal-templates page (/dotlrn/admin), you can define more dotlrn-portal-types based on the default ones, basically you can 'clone' the default types and make modifications on the new portal types. Also, you can define wich subtype has to be used as default when creating portals for users, communities , classes and subgroups.

Finally each user/community administrator, can change the portal type asigned to them. If a given user wants to modify his portal type, he goes to the control panel tab and selects 'change portal type', then the options presented to him are the "user" portal type and all the subtypes of this portal type (all rows in dotlrn_portal_types which parent_type is "user"). This procees basically takes the user portal and compares it with portal_id asigned to the portal type that he selected to change to. Pages and portal elements are removed or added as needed.

Anny comments or sugestions on this functionality are welcome =).

Regards,
Victor Guerra.