Forum OpenACS Q&A: How to set the mime-type for a page (ADP/Tcl pair)

Hello,

I want a particular page in an OpenACS package I am writing to return application/smil (Synchronized Multimedia Integration Language, an XML-based language) instead of text/html. This page creates a video-montage of some movies using SMIL, and is feeded to an embedded Quicktime-player.

Previously I've been able to do this using ns_adp_mime (directly under AOLserver), but this doesn't work with OpenACS...

Does anybody have an idea? An ADP/Tcl pair is very convenient for creating that piece of SMIL, as OpenACS templating does work for more than HTML alone!

greetz,
  koen.

A possible workaround could be:
  1. Use template::adp_compile to merge your data sources with the ADP template, i.e.
    set code [template::adp_compile -file mypage.adp]
  2. Use template::adp_eval to get the resulting output, i.e.
    set smil [template::adp_eval code]
  3. Send the output to the connection with ns_return
That worked out perfectly fine, Claudio. Thanks for the tip!

kind regards,
koen.