Thread: [Knobot-devel] a question on the ordering of TypeHandler
Status: Beta
Brought to you by:
rebach
|
From: dbu <db...@us...> - 2007-06-15 15:16:20
|
hi, i am experimenting with caching and the IEFixFilter. i realised that the FileServerFilter gets called after the IEFixFilter. the iefix-section.rdf defines the priority of the iefix, fs-section.rdf that of the fileserver. i tried to put iefixfilter priority lower than that of the filefilter, but this results in iefixfilter not being used at all. how can i control which filters are used on a request and in what order? or can't i use several handlers on one request? cheers,david |
|
From: <re...@gm...> - 2007-06-15 16:22:08
Attachments:
signature.asc
|
hi david, - FileServerFilter is a rwcf:TypeHandler - IEFixFilter is a rwcf:Filter - rwcf:TypeHandlerS get executed by the TypeChainFilter which is an rwcf:Filter. What happens is the following: 1. the rwcf:FilterS gets ordered by priority, higher priority are excecuted first, lower if and only if the higher-priority filters forward the request 2. With prirority 500 the TypeHandlerFilter comes into action, this creates a chain of TypeHandler so that what's returned by one TypeHandler is the input-type for the next, the goal is to create a chain which return a content-type acceptable by the client agent. From: http://development.osar.ch/documentation (this should be moved to a wymiwyg-site...) The Type Handler Filter is a filter which creates a list of TypeHandlers and forwards the request to this list. TypeHanlers are itself very similar to Filters, in fact they implement the same java clas= s. * The description of a TypeHandler contains the media type it returns, if the handler requires some input data the media-types such data must be is specified. (an exception for TypeBlindHandlers as well as for TypeHandlers implementing the Java Interface TypeHandler, this rarely used features need some redesign) * The desciption of a TypeHandler may force authentification by being of type rwcf:PermissionEnforcer The Type Hanlder Filter constructs the chain of TypeHandlers by iterating through the available TypeHandlers in descending order of rwcf:priority, when a TypeHandlers matches the current request and has the desired target-typeit if added to the chainand the iteration through the available TypeHandlers starts over omiting those already in the chain. This processed is repeated till a terminal chain is found, a terminal chain is one that ends with a TypeHandler which needs no input data. basing on the request it receives so that the changes made by previous Filters inluence the selection of TypeHandlers. 3. If no type-handler chain can be created the request is forwarded to the next rwcf:Filter after TypeHandlerFilter, possibly getting at a filter generating a 404 or a method-not-supported error page. So setting a low priority to IEFixFilter will cause the filter to be executed iff no previous filter can handle the request, which includes that no type-handler filter chain can be created, which in turn includes that FileServerFilter cannot serve a file. reto PS: http://jena.hpl.hp.com/juc2006/proceedings/bachmann-gmur/paper.pdf also has some infos about FilterS and TypeHandlerS dbu wrote: > hi, > > i am experimenting with caching and the IEFixFilter. > i realised that the FileServerFilter gets called after the IEFixFilter.= =20 > the iefix-section.rdf defines the priority of the iefix, fs-section.rdf= =20 > that of the fileserver. > i tried to put iefixfilter priority lower than that of the filefilter, = > but this results in iefixfilter not being used at all. > how can i control which filters are used on a request and in what order= ?=20 > or can't i use several handlers on one request? > > cheers,david > > -----------------------------------------------------------------------= -- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Knobot-devel mailing list > Kno...@li... > https://lists.sourceforge.net/lists/listinfo/knobot-devel > =20 |
|
From: dbu <db...@us...> - 2007-06-20 10:06:53
|
hi reto, thanks for this excplications. now i see better how requests are processed. the problem with caching is that firefox ignores the header. Vary: Cookies what i am trying to do now is adding a flag to the Response object telling whether it may be cached or not. the IEFixFilter could check it and only add the no-cache headers if the response is not cachable. although it is not the most elegant solution, this would solve the biggest problems with caching today: images which do not exist in different language variants and the css files would be cached, really improving user experience when surfing the page. i could create a post-filter chain that is used after the typechainfilter finished using the handlers and move the IEFixFilter there. do you think this is a good idea? or is there a better way? i could also put a method to the response to remove headers and remove all cache-related headers in the fileserverfilter if the response is cachable - but this is definitely not the proper way... david Reto Bachmann-Gmür wrote: > hi david, > > - FileServerFilter is a rwcf:TypeHandler > - IEFixFilter is a rwcf:Filter > - rwcf:TypeHandlerS get executed by the TypeChainFilter which is an > rwcf:Filter. > > What happens is the following: > 1. the rwcf:FilterS gets ordered by priority, higher priority are > excecuted first, lower if and only if the higher-priority filters > forward the request > 2. With prirority 500 the TypeHandlerFilter comes into action, this > creates a chain of TypeHandler so that what's returned by one > TypeHandler is the input-type for the next, the goal is to create a > chain which return a content-type acceptable by the client agent. > > From: http://development.osar.ch/documentation (this should be moved to > a wymiwyg-site...) > > The Type Handler Filter is a filter which creates a list of > TypeHandlers and forwards the request to this list. TypeHanlers are > itself very similar to Filters, in fact they implement the same java class. > > * The description of a TypeHandler contains the media type it > returns, if the handler requires some input data the media-types such > data must be is specified. (an exception for TypeBlindHandlers as well > as for TypeHandlers implementing the Java Interface TypeHandler, this > rarely used features need some redesign) > * The desciption of a TypeHandler may force authentification by > being of type rwcf:PermissionEnforcer > > > The Type Hanlder Filter constructs the chain of TypeHandlers by > iterating through the available TypeHandlers in descending order of > rwcf:priority, when a TypeHandlers matches the current request and has > the desired target-typeit if added to the chainand the iteration through > the available TypeHandlers starts over omiting those already in the > chain. This processed is repeated till a terminal chain is found, a > terminal chain is one that ends with a TypeHandler which needs no input > data. > basing on the request it receives so that the changes made by previous > Filters inluence the selection of TypeHandlers. > > 3. If no type-handler chain can be created the request is forwarded to > the next rwcf:Filter after TypeHandlerFilter, possibly getting at a > filter generating a 404 or a method-not-supported error page. > > > So setting a low priority to IEFixFilter will cause the filter to be > executed iff no previous filter can handle the request, which includes > that no type-handler filter chain can be created, which in turn includes > that FileServerFilter cannot serve a file. > > reto > > PS: http://jena.hpl.hp.com/juc2006/proceedings/bachmann-gmur/paper.pdf > also has some infos about FilterS and TypeHandlerS > > dbu wrote: >> hi, >> >> i am experimenting with caching and the IEFixFilter. >> i realised that the FileServerFilter gets called after the IEFixFilter. >> the iefix-section.rdf defines the priority of the iefix, fs-section.rdf >> that of the fileserver. >> i tried to put iefixfilter priority lower than that of the filefilter, >> but this results in iefixfilter not being used at all. >> how can i control which filters are used on a request and in what order? >> or can't i use several handlers on one request? >> >> cheers,david >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Knobot-devel mailing list >> Kno...@li... >> https://lists.sourceforge.net/lists/listinfo/knobot-devel >> > > |
|
From: <re...@gm...> - 2007-06-20 10:10:00
Attachments:
signature.asc
|
dbu wrote: > hi reto, > > thanks for this excplications. now i see better how requests are > processed. > the problem with caching is that firefox ignores the header. > Vary: Cookies It shouldn't, and I vaguely remember having used successfully somewhere. Are you referring to a known FF-bug? reto |