Forum .LRN Q&A: how to add new portlet to community-portal

Collapse
Posted by xx xx on
Hi,

Could anybody tell me how to add a new package (applet/portlet) to a specific community portal (.lrn)?

I created a (public) community portal on the main site (<server>/www)
Now I want to add a new portlet to this portal using two (new) packages (based on dotlrn_news and news_portlet packages).
I registered them through the OACS-apm and added the service contracts in the DB.

Now I'm not sure what to do next:
- add_applet or/and add_portlet
- add to_dotlrn, to_community or/and to_page
Thanks for any advice.

Collapse
Posted by Ben Adida on
If you want your code to be well-behaved dotLRN code, the portlet addition should be done from within a dotLRN applet. For example, dotlrn-forums is responsible for adding the forums-portlet to various portal pages throughout the system. That's how you can maintain modularity.

Thus, when you add an applet to a community, that applet's code add_applet_to_community should add your portlet to the community's portal page. Similarly, add_user_to_community should add a user-based portlet to the user's portal page, if that makes sense for your application. Take a look at dotlrn-forums for example code.

In addition, when you create a new applet (by creating an applet service contract implementation), the dotlrn-init Tcl script automatically registers the applet in the dotlrn_applets table (that happens upon server restart only).

There are parameters in the top-level dotlrn package instance (/dotlrn usually) that indicate which applets to automatically instantiate within a community: you can tweak those to include your applet. Or, you can manually add it to a community by going to the community's control panel and selecting "manage applets."

Collapse
Posted by xx xx on
😊)