I am using 5.0.18 version and not ready to move to 5.1 yet. Is there any way to override the DocumentLinker in the 5.0.18 version?
Fernando Padilla wrote: > > Ok cool. > > with the latest version of tapestry (5.1.0.0-SNAPSHOT), they did add a > proper way to override contributions. Below is the code we're using for > us to override our DocumentLinker. Please be aware that the override > works, but it seems to trash all of the previous relative directives ( > before, after, declared by overridden service, or any other service > relative to it), that's why we declared "before:RenderSupport", to make > sure the MarkupRenderer order is still correct. > > public void contributeMarkupRenderer( > OrderedConfiguration<MarkupRendererFilter> configuration ) { > configuration.override( "DocumentLinker", new CustomDocumentLinker(), > "before:RenderSupport" ); > } > > > > Dude.Checkitout wrote: >> Thank you for the quick reply. We are using tapestry to generate a >> section of >> a html page. We can enforce the requirement of having an root node. >> >> Basically, the requirement will be to accept the root node to be >> anything. >> (not only html) >> I created my own CustomDocumentLinker extending from the tapestry >> DocumentLinker and modified the code to fit our needs. But I have no idea >> how to make Tapestry to use CustomerDocumentLinker instead of its own >> DocumentLinker. >> >> Any help in this will be appreciated. >> >> >> >> Fernando Padilla wrote: >>> I have lots of experience playing with that :) (since we publish to >>> html, fbml). Here are some questions: >>> >>> 1) do your documents have a root node? what is it? >>> >>> 2) do you want to change the behavior of how it includes javascript and >>> css? Or just have it work with non-html root nodes? >>> >>> >>> >>> Dude.Checkitout wrote: >>>> We have a requirement of tml file being delivered without <html> as the >>>> root >>>> context. As I read the tapestry source, this validation is done in the >>>> DocumentLinker. >>>> >>>> In contributeMarkupRenderer method: >>>> MarkupRendererFilter documentLinker = new >>>> MarkupRendererFilter() >>>> { >>>> public void renderMarkup(MarkupWriter writer, >>>> MarkupRenderer >>>> renderer) >>>> { >>>> DocumentLinkerImpl linker = new >>>> DocumentLinkerImpl(productionMode, scriptsAtTop); >>>> >>>> environment.push(DocumentLinker.class, linker); >>>> >>>> renderer.renderMarkup(writer); >>>> >>>> environment.pop(DocumentLinker.class); >>>> >>>> linker.updateDocument(writer.getDocument()); >>>> } >>>> }; >>>> >>>> >>>> Is there anyway I can override my own DocumentLinker with Tapestry's >>>> DocumentLinker? >>>> >>>> In the Post, "http://n2.nabble.com/-T5--A-root-element-of-<html >>>> -is-needed-when-linking-JavaScript-and-stylesheet-resources.-td1470668.html#a1470762">http://n2.nabble.com/-T5--A-root-element-of-<html>-is-needed-when-linking-JavaScript-and-stylesheet-resources.-td1470668.html#a1470762 >>>> >>>> Howard said we can override the internal DocumentLinker. >>>> >>>> Can anybody suggest me on how to do? >>>> >>>> >>>> >>>> >>>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >>> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > -- View this message in context: http://n2.nabble.com/How-to-override-Tapestry%27s-DocumentLinker---tp2239793p2240439.html Sent from the Tapestry Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org