Forum OpenACS Q&A: portals broken in 3.2.4?

Collapse
Posted by Tod Pike on
I've just downloaded 3.2.4 and since I didn't have anything important
in my old database, I scrapped it and started fresh. I loaded the
education.sql file and configed everything.

I create a new group type "portal_group", create a group in that
type called "Super Administrators", add the system account to
"Super Administrators" and then create a new portal group called
"test" (for example). When I go to the /admin/portal page it lists
"test" as an available portal, but when I got to /portals, only
"your personalized portal" is listed. This worked somewhat in 3.2.2,
and just started in 3.2.4.

Also, is it just me or is the portal stuff not working very well?
I can't get any of the modules to do anything, saving personalization
stuff doesn't work, etc. I'll admit that I just can't figure the
thing out at all - is there any place I can look to get started?

Much thanks, Tod Pike
mailto:tgp@cmu.edu

Collapse
Posted by Jowell Sabino on
I got to set up some portal tables, but I didn't load the education module (3.2.4 default). I commented out all the "inserts" towards the end of portals.sql.  The result is that if you try to administer portals, you won't have any sample portal table code to play with.  Fine by me, because they won't work anyways without the education module loaded.



    I think /portals/index.tcl only looks for portals with content.  Try going to /portals/admin and click on the "create new table" link.  Put anything on the "Table name" and the "HTML/ADP", type preview and then click on create.  Put this table in your test portal and check /portals again to see if your test portal comes up.

    In priciple, you can put any valid HTML or ADP code in "HTML/ADP" space. You just have to assume that 1)    you already have a valid database handle ($db), and 2) your HTML or ADP output will be put inside a table (see /docs/portals). This adp fragment will put the list of active polls in a portal table (sorry for the messy formatting.  Making this post html further messes up the output):

----start here ---

<%

set poll_block "<ul>"

set selection [ns_db select $db "
select poll_id, name, require_registration_p
  from polls
  where poll_is_active_p(start_date, end_date) = 't'
  order by end_date desc, start_date desc
"]

set counter 0

while { [ns_db getrow $db $selection] } {

    set_variables_after_query

    incr counter

    append poll_block "
    <li><a href=/poll/one-poll.tcl?[export_url_vars poll_id]>
                      $name</a>
"
}

append poll_block "</ul>"

if {$counter == 0} {
    set poll_block  "No active polls."
}

%>

<%= $poll_block %>

--- end here ---

Note that I didn't have to do a "ns_db gethandle" because $db is already provided.

I'm also trying to learn this portal stuff, so let me know what you find out.

Collapse
Posted by Tod Pike on
Hmm. My /admin/portals page does list "Test" in the "The available portals" section. When I go to /portals/admin, though, I just get
"Your personalized portal" in the list. I used to have this kind
of behavior before I added myself as a "Super Administrator", but
I'm in that group.

When I get the portals stuff working, I'll give your code a whirl.
It's been a while since I've used tcl, so I'll be stealing (er,
borrowing!) as much code as possible.

Tod

Collapse
Posted by Jowell Sabino on
Ok, I found out some more weird behavior which may be related to what you are seeing....

I defined more than one portal, and I allowed personal portals.

I defined portal tables (simple html for now). I put portal tables in the portals I defined including the personal portal.

Whenever I update any portal, ACS 3.2.4 updates the portal ok, but at the same time it deletes the contents of the other portals!  I can replicate this as often as I want.

This will definitely be in SDM.

Collapse
Posted by Bob Fuller on
Whenever I update any portal, ACS 3.2.4 updates the portal ok, but at the same time it deletes the contents of the other portals! I can replicate this as often as I want.

-- Jowell Sabino, September 28, 2000

I was wondering what was going on! I figured out how to create my own portal tables, ones that actually work, but the code currently only lets you work with one portal at a time, because something in the program logic is deleting! all the other portal mappings besides the one that's currently being updated.

The problem probably has to do with the following code, located in manage-portal-2.tcl:

# DRB: I moved this in front of the two following delete statements for a reason
# Due to the fact that the bleeping education module stuffs rows into new portal
# pages behind our backs, PG won't allow the delete because it breaks checking
# for referential integrity.  Does this suck or what?
 
ns_db dml $db "end transaction"
The code in question is followed by a series of deletes that basically looks like it guts all the good work that all of our other busy portal-creators have achieved to date. I'm not sure what the reasoning behind the program logic is, but as per the comments in the listing above, it apparently has something to do with the education module -- which, by the way, is one of those modules that does not work out of the box anyway!