[sakai2-tcc] Filtering Content served from CHS

Aaron Zeckoski aaronz at vt.edu
Fri Dec 10 06:56:47 PST 2010


Excellent. I am assuming each filter would override any others right?
(we don't want multiple headers I assume)

-AZ


On Fri, Dec 10, 2010 at 9:47 AM, Matthew Buckett
<matthew.buckett at oucs.ox.ac.uk> wrote:
> On 10 December 2010 13:34, Aaron Zeckoski <aaronz at vt.edu> wrote:
>> I am not a fan of the user control part but I love the idea of
>> content/resources finally outputting a valid html page instead of the
>> invalid fragment it has done forever.
>
> I like to leave people in control of how their content is managed,
> maybe have the UI as a option and possibly only available to admins?
>
>> If someone wanted to control the stuff that goes into the header (like
>> CSS stylesheets for their site or JS libraries) then how could that be
>> done? Would it be possible to extend this to include a provider style
>> interface or configuration options or something which would allow some
>> site wide level of control?
>
> Yes.
> There is a ContentFilter interface you implement and then register it
> in the list of filters to be run.
>
> /**
>  * Interface that allows modification of some content.
>  * We don't have access to the response headers so can't do things
> like zip compression.
>  * @author buckett
>  *
>  */
> public interface ContentFilter {
>
>        /**
>         * Check if this content filter should be applied to the resource.
> This should be a fast
>         * check.
>         * @param resource The resource being requested.
>         * @return <code>true</code> if a filter should be retrieved using
> {@link #wrap(OutputStream)}.
>         */
>        public boolean isFiltered(ContentResource resource);
>
>        /**
>         * Create a filter which will process the content.
>         * @param content A stream to which the output will be written.
>         * @return An output stream which is contains the modified output.
>         */
>        public HttpServletResponse wrap(HttpServletResponse response,
> ContentResource resource);
>
> }
>
> --
>   Matthew Buckett
>   VLE Developer, LTG, Oxford University Computing Services
>



-- 
Aaron Zeckoski - Software Engineer - http://tinyurl.com/azprofile


More information about the sakai2-tcc mailing list