Forum OpenACS Q&A: question about static pages

Collapse
Posted by Benjamin Jensen on
Can static pages be made to work with adp pages and/or adp/tcl pairs? I would like to be able to add comments to adp pages and adp/tcl pairs. To do that they need to become objects, and it seems that the best option would be to modify static pages to handle them.

I have searched the forums and it seems like this has been discussed over the last few years, but still has not been implemented in OpenACS. I have found a couple different workarounds that people have suggested, but all of them are fairly old and used with older versions of OpenACS. I am hesitant to try a solution that was proposed for a different version because of possible incompatibilities. Is there a  standard/easy way of doing this in openACS 4.6? Also, are there plans for adding this functionality to the main OpenACS distribution? If anyone can respond with ideas and/or code for implementing this it would be much appreciated. Thank you in advance.

Ben Jensen

Collapse
Posted by tammy m on
Hi I asked this very same question not long ago... here's the answers I got.
Collapse
Posted by Andrew Piskorski on
Benjamin, could you post the links to the old forum threads you mention?

Yeah, easily being able to search and add comments to .adp or .tcl pages would be obviously useful, but so far I've never really thought about that, or if the Static Pages package would be the right way to do it (probably it is in at least some cases). Clearly, you really should not be penalized nor your life be made more difficult for choosing to take advantage of ADPs instead of using static HTML!

The links Tammy gave above had useful info, so if there are any others like that you were looking at please post them. (Of course I could just search through Forums researching the issue myself, but since apparently you've already done so...)

Tammy, re. your question about Joel's "straw man": If feasible, you probably want to have all your content in a package whether it really needs to be or not. It's usually not really any harder to create a "my old static stuff" package and use that rather than dumping it directly under the global www/ page root. But that's really a mostly unrelated side issue.

What I think you were really getting at in that thread, is that Joel's example assumes your "content" is already logically tied to some object_id in the database. For a db-backed OpenACS application, this is likely to always be true, and something along the lines of his example is probably the right thing to do.

However, often you have "content" which is not really part of a db-backed application, and so does not already have any logical object_id in the database to tie comments to; for example, an article you wrote which happens to be in the form of an OpenACS Templating System Tcl/ADP page pair. The Static Pages package is already in the business of generating logical object_ids for such content and tying it into the Content Repository, so perhaps it's the right tool for the job.

In the longer term, perhaps this also relates to the Content Repository and conentent management. For example, how does or would any OpenACS content management system interoperate with traditional plain-old OpenACS pages? Could plain old pages still take advantage of some CR/CM services? (I don't know much about CR/CM, so I don't know.)

Collapse
Posted by Benjamin Jensen on
Thank you for your replies.

tammy, I did look at your thread previous to posting and did not like the answer that was given to you because it assumed that all of your pages had an object id already. The purpose of the static pages package is to give an id to pages that don't already have one. If my pages already had an id, then yes, it would be simple to add comments to them. I wanted to extend static pages to handle adp files as well so that my adp files that are in my root/www/ folder and are not a part of a package can be given object id's and therefore be eligible for commentability. Andrew mentioned some of this as well.

Andrew, here are a few threads that have discussed this subject in the past:

Questions about static pages

Include Comments and Links on Tcl and ADP pages

ADP versus HTML

Static module improvement

Using different calls in .adp files

I hope these help you. Some of these proposed solution look like they might just do the trick, but, as I said before, I am hesitant to use them due to their age.

Thanks again,

Ben Jensen
Collapse
Posted by tammy m on
Hi again,

Yes Andrew, I was trying to get tcl/adp pairs into Static Pages for several reasons; I wanted to be able to Search them, add GeneralComments to them and thus I needed them to be acs_objects which I new StaticPages could do for me.

I don't have much experience using OACS right now, I've been trying it on for size for the past couple months. The hardest part getting started is understanding what all the various packages do and how they work together to accomplish the things they do. Sometimes the "Requirements and Design docs on a package by package basis" approach to understanding the whole of OACS is a bit slow going for me:(

Anyway, I have 2 different functionalities I've been hoping to get from with Static Pages. One is getting tcl/adp pairs parsed and into the database (CR I believe) the second is how to best implement Search on GeneralComments (for HTML and tcl/adp pairs). Here are the links for what it's worth!

Searching GeneralComments (maybe this comes for "free" if it's in the CR?):

Site Wide Search in acs-messaging or general-comments?

Search on general-comments interacts with Object Model, CR, acs-messaging?

Indexing + GeneralComment-ing tcl/adp pairs with StaticPages:

Trouble with comments and links on dynamic pages
The others, Benjamin has already provided.

Andrew, you hit the nail on the head when you brought up "how the CR and content management" should best be setup in OACS. That's is what I'm having a hard time sorting out. I don't fully understand how the CR and CMS are intended to be used to best manage content of any kind in OACS.

And when you said "If feasible, you probably want to have all your content in a package whether it really needs to be or not." Could you elaborate on that?! What does having all my content in a package do for me ? I wish there was an OACS jumpstart seminar offered! Maybe one could be offered at LinuxWorld?!

Collapse
Posted by Andrew Piskorski on
Tammy, to answer the simplest question first for now, "What does having all my content in a package do for me?"

Per-se, not necessarily all that much. For example, you automatically get permissions on the package instance, which may or may not be useful to you (in the past it has been useful for me). But more importantly, packages are the standard way to organize anything in OpenACS, so unless you have a good reason not to, IMO you should always put all your own custom stuff into a package. At the very least, I've never seen putting custom stuff into a package be a drawback, so the easier question to answer is "Why not put it into a package?" Usually the answer is there is no reason why not, so you might as well do it.

Collapse
Posted by tammy m on
Hey Andrew,

Thanks for the explanation on packaging stuff.

I don't know if it was the "simplest" question, maybe just the most abstract.
Anyway, sometimes I ask so many questions I drive myself crazy!