Forum .LRN Q&A: Add a portlet?

Collapse
Posted by jorge freitas on
I have one question. I want to add a portlet to dotlrn, i already made the portlet/applet packages and registered them in the database, but i'm not sure what to do next to make the portlet availabel to dotlrn. Any help is welcome. Tanks.
Collapse
2: Re: Add a portlet? (response to 1)
Posted by jorge freitas on
I use the "manage applets" links in the classes administer page but the portlet is made avaible only for that class. What i want is that this portlet is made avaible for all classes by default. How i do that? Tanks.
Collapse
3: Re: Add a portlet? (response to 1)
Posted by xx xx on
Did you try to modify the templates yet?

/YOURDOMAIN/dotlrn/admin/portal-templates
or
/YOURDOMAIN/admin/site-map/
subfolder: (+)dotlrn/ [set parameters] will let you change "default_user_portal_applets" and stuff like that.

Collapse
4: Re: Add a portlet? (response to 1)
Posted by jorge freitas on
Tanks, i will do that.
Collapse
5: Re: Add a portlet? (response to 1)
Posted by jorge freitas on
Aldert, I add my portlet to the "default_user_portal_applets" parameter in the dotlrn/ subfolder but nothing happen. I dont know what else to do. Any ideas, anyone? Thanks.
Collapse
6: Re: Add a portlet? (response to 1)
Posted by xx xx on
I don't see a UI that will let you add new portlets to templates, so you will have to do that manually or at creation of the package. You say the package works in one portlet so I presume your applet/portlet servicecontracts should work well.
Try adding them to the templates like this:

set your_applet "..(fill).."
set package_id [apm_package_id_from_key $your_applet]
set template_ids [db_list template_ids {select portal_id from portals where template_id is null}]
foreach template_id $template_ids {
    set args [ns_set create]
        ns_set put $args package_id $package_id
        user_location::add_portlet_helper $template_id $args
}

If you see the portlet in "customize portal layout" but they don't show than there is probably a problem with retrieving the content.
(new-portal/www/render_styles/individual/render-element)

Collapse
7: Re: Add a portlet? (response to 1)
Posted by xx xx on
Correction: user_location::add_portlet_helper
Should be: your_applet_NAMESPACE::add_portlet_helper
Collapse
8: Re: Add a portlet? (response to 1)
Posted by xx xx on
As an indication for your servicecontract do:
set servicecontract "portal_datasource" (for portlet)
or
set servicecontract "dotlrn_applet" (for applet)

select acs_sc_impls.impl_name
from acs_sc_impls,
    acs_sc_bindings,
    acs_sc_contracts
where acs_sc_contracts.contract_name = $servicecontract
  and acs_sc_contracts.contract_id = acs_sc_bindings.contract_id
and acs_sc_impls.impl_id = acs_sc_bindings.impl_id;

Your portlet/applet should appear.

Collapse
9: Re: Add a portlet? (response to 1)
Posted by jorge freitas on
Aldert, thanks for the tips, i will try that.