Home
The Toolkit for Online Communities
17506 Community Members, 2 members online, 2153 visitors today
Log In Register
OpenACS Home : Forums : .LRN Q&A : How to debug a portlet?

Forum .LRN Q&A: How to debug a portlet?

Icon of envelope Request notifications

Collapse
Posted by Rocael Hernández Rizzardini on
Hi!
I have created some different portlets, everyone works fine unless one that works well in the users portal but not in the class or club portal, it doesn't appear.

Any suggestion on how to debug it?
or any clues of what might be happening?
I can't find anything that could take me to find the error.

This portlet is very similar to the faq portlet.

TIA

Collapse
Posted by xx xx on
Since the portlet works well in a user portal (and you don't see an error) I would check permissions first, also whether you are working in a member or non-member portal and whether the specific portlet isn't set to shaded/hided (I forgot the name of the variable that does that). I cannot verify right now, but maybe 'read_private_data' permission or a specific faq_ permission is needed.

Check Technical documentation at (http://openacs.org/projects/dotlrn/dotlrn-doc/ or http://dotlrn.mit.edu/documentation/groups.html#assignandtransfe ).

Collapse
Posted by Peter Marklund on
At some point I would like to write a debug mode for portal pages that would display the paths to all templates used, as well as portal, page, and element id:s.

The following query can get you the portal_id:

select pretty_name, portal_id from dotlrn_communities_all;

Look at the datamodel in new-portal/sql/postgresql/portal-core-create.sql.

The following queries can get you the state (hidden, shaded, full, or pinned) of your portlet (portal element):

select page_id, pretty_name from portal_pages where portal_id = :portal_id_of_community;

select state from portal_element_map where page_id = :id_of_the_page;

Can you see your portlet on the customize layout page?

Collapse
Posted by Rocael Hernández Rizzardini on
Thanks for your answers,

I can see the portlet in the customize layout page of the club/class page, even move it.

Peter, I did your query: select state from portal_element_map where page_id = :id_of_the_page;

and for the specific portlet in the respective club/page I got the state "full", the same state as other portlets that works.

But I can't still see it. Maybe is something related with permissions.
Wich specific permissions should I check?
the package ones or others?
For what should I look for?

Aldert, what you mean with "whether you are working in a member or non-member portal".

Peter, a debug mode also will be helpful, I hope you get the time to do it.

Collapse
Posted by Peter Marklund on
Rocael,
the only permissions I can find are related to the portal_id (portal_read_portal, portal_edit_portal, portal_admin_portal). If you can move elements on the customize page you must have the edit and/or admin privilege. I don't think you have a permission problem.

I have no experience with developing portlets myself so I'm mostly guessing here. I would probably check the HTML source, maybe add debug statements to the portal::evaluate_element proc or to new-portal/www/render_styles/individual/render-element.tcl. Any error messages in the log file?

Collapse
Posted by Rocael Hernández Rizzardini on
ohh!!
was something that I missed at the package-portlet/www/package-portlet.adp

it was displaying only
rowcount@ gt 1

just changed to ge

just one letter... =)

Thanks anyway for your help, in the road I learned good things,

Collapse
Posted by xx xx on
For each community a 'non member' portal_id is created (automatically) with different elements/portlets. You will see if you (select * from portals;).
Non-members will be shown a 'non member' portal. If your portlet is not associated with this portal_id, it will not be shown to 'non members'.