[sakai2-tcc] Filtering Content served from CHS

Matthew Buckett matthew.buckett at oucs.ox.ac.uk
Fri Dec 10 08:14:26 PST 2010


On 10 December 2010 16:00, Aaron Zeckoski <aaronz at vt.edu> wrote:
> Ah, OK, so here is the use case I have in mind.
> -----
> I am system admin (or tool writer) and I need to add a custom bit to
> the top of every page (like some CSS or JS). I don't want to have to
> rebuild the system just to add a JS or CSS include but I can probably
> manage something fairly straightforward like a provider or a config
> option.
> -----

Just to be clear I am only suggesting filtering content served from
CHS, this is not a generic filter solution for Sakai for portal or
tool requests.

> It seems like something like this where I might create a filter and
> include it with my tool would work EXCEPT that my filter might be
> ignored.

It up to the filter to decide if it wants todo anything, all the
filters get asked if they want to filter the output and then those
that do get to wrap the response.

m_outputFilters  is List<ContentFilter>
res is HttpServletResponse

					for (ContentFilter filter: m_outputFilters)
					{
						if (filter.isFiltered(resource))
						{
							res = filter.wrap(res, resource);
						}
					}


At the moment there isn't a provider interface to register filters
from outside the kernel, but there could be.

> Then I get to spend hours explaining to people why the filter
> I provided won't work with some other filter they made locally or
> another filter provided by a 3rd party.

Yep, but I think that's the better way todo it.

> Maybe this needs a different solution where we setup something in the
> portal and the default filter here will also respect the stuff the
> portal is using but a system where my part that I added might just be
> ignored seems like a maint nightmare.

The portal doesn't serve up content out of CHS. So I'm slightly confused.

> Also, that detection of already provided stuff seems like it could be
> a real pain when/if it fails and would be a maint burden on the core
> Sakai team.

What do mean "already provided stuff".

-- 
  Matthew Buckett
  VLE Developer, LTG, Oxford University Computing Services


More information about the sakai2-tcc mailing list