Forum OpenACS Q&A: What happened to NotFoundResponse (et al)?

I just tried to customise some of the files in /global such as
file-not-found.html etc.  Checking the AOLserver docs I find that
a number of server config parameters were dropped in version 3.0,
including the ones specifying these files.  The doc rather
laconically notes that what were previously the default values
will still come into effect.

I recognise this is "really" an AOLserver issue rather than ACS, but
since ACS does provide templates for these files I thought maybe
some other ACS'ers might have come on this and figured out
whether there is some new way of customising these responses?

Thanks,

- Barry.

Collapse
Posted by Barry McMullin on

Well, customising the "file not found" response (via /global/file-not-found.html) does work in the specific case of HTML files. This is not because of an AOLserver level configuration but because processing of all html files goes through tlc/ad-html.tcl and that specifically checks for file existance and returns the (customised) response if not.

That actually covers my main requirement; but I do still wonder:

  • Is there a way of customising the other exception responses?
  • Is there even a way of customising the file-not-found response to work for all file types?
  • Even in the existing handling of html files not found, might it be preferable to use a http redirect? (The potential advantage would be to allow these exception responses to be authored as adp rather than necessarily static html.)

Cheers,

- Barry.

Collapse
Posted by Bob OConnor on

Hi Barry,

I got an answer from Patrick in response to my thread
"Translation of quote characters stops"
https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0002VB

AND it may help you. I was having trouble getting book type left and right quotes to show up in my HTML pages so I now have .html files processed the same way as .adp pages using this code in /tcl/ad-html.tcl and in proc_doc ad_serve_html_page by replacing this one line:

OLD:
    set stream [open $full_filename r]
    set whole_page [read $stream]
    
NEW:
    set stream [open $full_filename r]
    set whole_page [ns_adp_parse -file $full_filename]

Hope this helps...and remember to restart...

I'm still not sure how much extra processing goes on using adp pages over html...

-Bob