Forum OpenACS Q&A: Static module improvement

Collapse
Posted by Roberto Mello on
Hi all,

I changed the static module so it provides comments and links in adp pages as well. It works really good, except in adp pages that grab a lot of handles themselves. The static syncer gets all confused. That ought to be rethought.

The way I did it so the changes would be minimum was this:

    if {[ns_guesstype $full_filename] == "text/html"} {
        set stream [open $full_filename r]
        set whole_page [read $stream]
        close $stream
    } else {
        set whole_page [ns_adp_parse -file $full_filename]
    }

I am relying on the fact that AOLserver 2.3 returns a different ns_guesstype for adp pages. Is this still true for AS 3 ? I remember having seen something like this was changed. Ben ?

If this was changed in AS 3, I'll change it to a regexp that finds out if the file is adp or html/htm. After all is done, should I commit it to the main OpenACS tree, put is as optional, and/or submit to aD ?

I also changed the static-syncer-ns-set pretty much the same way. This led me to a question... In the

static_pages
table, there are rows for authors and other things (like draft_p, obsolete_p). How's that ever inserted there ?? It would be really cool if the syncer would parse the user_id of the author of the page (say, in a meta tag) and stuff it into the db. Is this done with the glassroom module maybe ? (never done anything with it)
Collapse
Posted by Ben Adida on
Hmmm, grr, okay, this is where things start to get ugly and I get
very confused.... This is much needed improvement, but it starts
to make us fork from the core ACS. We're going to get into
issues if we start doing too much of that, so please be very
careful about these kinds of changes, and try to double check
with me or Don before you commit something like this.

That said, I think this is useful. The extra fields like author and all
are inserted if the right meta tags are found in the header.  It's
pretty cool stuff. We should have adp tags that expand into meta
tags for this to make things simpler. Good work. I know I sound
schizo with the dual opinion, but I'll restate: good work, just warn
us before you do this so we can keep a handle on this stuff until
ACS 4.0 and true modularity.

Collapse
Posted by Roberto Mello on

Maybe I didn't word it right (this is when you realize you are not a native english speaker 😊, but I have _not_ committed anything yet. It's just in my local machine. I wanted to know your opinions first.

I can submit this to aD and maybe it will make it into ACS 4. The funny thing is that there's a comment on ad-html.tcl:

# significantly enhanced in December 1999 to modularize the comment and link
# stuff so that .adp pages could use them as well (philg)

But there's nothing there to parse ADPs.

That said, I think this is useful. The extra fields like author and all are inserted if the right meta tags are found in the header. It's pretty cool stuff.

Can you explain this better ? You mean that the meta tags thing is already implemented or that you liked the idea ?

We should have adp tags that expand into meta tags for this to make things simpler. Good work. I know I sound schizo with the dual

What I was actually thinking (are you ready for more mods?) was to modify the ad_header proc to accept a second parameter as being the user_id of the author. That way it would work for both .tcl and .adp pages (though .tcl pages are usually not stuffed into the db). Do you think this is too weird ? ADP tags expanding into meta tags would serve just as fine.

opinion, but I'll restate: good work, just warn us before you do this so we can keep a handle on this stuff until ACS 4.0 and true modularity

That's what I was trying to do but I guess I didn't say it 😊 Sorry if I made you worry Ben 😊 One idea would be to have a openacs-improvements.tcl that would be put in the /tcl directory and would have these modifications. That way we wouldn't fork too much... the user would have the option to load it or not.

Oh, and please take a look at my other questions... I am not sure if this works in AS 3 yet.