You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Jörn Nettingsmeier <po...@uni-duisburg-essen.de> on 2006/09/30 10:25:46 UTC
Re: svn commit: r451442 - /lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/FallbackSourceFactory.java
hi doug, hi everyone!
sorry for this longish post, i'm still not fully understanding what i'm
trying to point out, hopefully you can makes some sens of this...
chestnut@apache.org wrote:
> Author: chestnut
> Date: Fri Sep 29 14:13:20 2006
> New Revision: 451442
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=451442
> Log:
> Added ability to reference publication from which to fallback from,
> This should resolves the problem of an xslt template trying to import itself when
> xslt/page2xhtml.xsl -> imports -> template-fallback://xslt/page2xhtml.xsl -> imports -> template-fallback://xslt/page2xhtml.xsl
> instead use
> xslt/page2xhtml.xsl -> imports -> template-fallback://{template1}//xslt/page2xhtml.xsl -> imports -> template-fallback://{template2}//xslt/page2xhtml.xsl
[concerns]
hmm. i see how this is useful in the particular case of xslt imports,
but it feels a little weird in the general case.
it means that information about the inheritance tree is sprinkled all
over a publication.
it also means that there are two types of fallback now: really
transparent fallback, and fallback with some strings attached (i.e.
files with an opinion of who their parents are).
the consequences are not entirely clear to me...
the usable granularity of fallback used to be "per-file", i.e. either
you inherit or you rewrite.
many times i've wished for a more fine-grained approach that could
inherit parts of files down to single elements. the problem is that this
needs an understanding of what those elements mean, and the mechanism of
inheritance is then split among the fallback implementation and
domain-specific stuff. i see the same problem here: the granularity of
inheritance is reduced by mixing fallback with an xslt-specific
mechanism. neither knows about the other, hence the danger of loops,
hence the workaround in the fallback implementation.
[grand but probably impossible solution]
a cleaner but insanely complicated solution might be to add state
information to the fallback implementation. i.e. it must always know
which the current publication is and act accordingly.
e.g.:
call template-fallback://foo.xsl
in foo.xsl, we find: <xsl:import src="template-fallback://foo.xsl"/>
now if the fallback implementation remembers that this is a
fallback-included file already, it could resolve this new call to the
correct file in the parent's parent, not cause a loop.
but i'm sure adding this state information to fallback is impossible to
do in a sane way in a webapp context with many source factories floating
around on the server. it's the last of all places where i'd want
synchronized methods and global bookkeeping.
however, it shows what we need in principle.
[uglier but workable solution]
but we have another, unfortunately more verbose mechanism almost in
place that does exactly that (put "fallback" in the correct context):
sitemap calls.
map:match pattern="giveMeYourXSLT"
map:aggregate
resource-exists?
map:part src="file://xslt/page2html.xsl"
resource-exists?
map:part src="new-mythical-parent-sitemap-call://giveMeYourXSLT"
map:transform src="cleanupthemess"
it's a little ugly in its xslt handling (an xsl:import has all those
nice, sane semantics that we must now recreate by retransforming the
aggregated stuff into a correct stylesheet), but it keeps the mechanism
of combining a resource with the parent resource in one place (in the
sitemap).
all we need for this is a way to say "call into the parent sitemap".
that should be very easy.
the huuuuge downside of this grand ad-hoc design is that it adds loads
of boilerplate sitemap code and makes complicated things clean and
simple things complicated.
but hopefully i've been able to illustrate my concerns about hard-coding
parent information in fallback calls.
> Adding pubids to your fallback:// protocols should also allow one to leave the xslt use-store on if used properly
can you explain the term "xslt use-store"?
best,
jörn
--
"It's sad to behold how lately the wonderful English language has,
in the hands of corporate executives and marketing experts, re-
adjusted its prospective itinerary towards mythical subterranean
realms of discomfort, leveraging traditional woven containment
devices."
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
a "parent-pub" source factory with dynamix context...?
Posted by Jörn Nettingsmeier <po...@uni-duisburg-essen.de>.
hi doug, hi everyone!
there is a similar problem to your xslt include loop in i18n: we could
use a good (and preferably elegant) solution to aggregate the i18n
catalogues for the current pub, the parent, the parent's parent, etc.
your solution avoids loops, but it does not allow for recursion, because
fallback is always "rooted" to the current publication, even if fallback
calls are nested.
i would love to be able to do something like this:
map:match i18n-catalogue/**
map:aggregate
map:part src="current-pub://lenya/resources/i18n/{1}"
map:part src="parent-pub://i18n-catalogue/{1}"
which would automagically walk the template tree recursively and get rid
of n currently broken xsp pages in one go. :-D
of course it only works if "current" and "parent" change their behaviour
dynamically, not just by looking into the page-envelope.
so we would need to tag a source with a publication context.
that is probably not too hard.
but if a source is resolved, the file parsed and a new source request
found, how does this new source get at the context information of its
"parent" source...?
well, just thinking out loud again.
any comments appreciated.
best,
jörn
--
"It's sad to behold how lately the wonderful English language has,
in the hands of corporate executives and marketing experts, re-
adjusted its prospective itinerary towards mythical subterranean
realms of discomfort, leveraging traditional woven containment
devices."
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: svn commit: r451442 - /lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/FallbackSourceFactory.java
Posted by Jörn Nettingsmeier <po...@uni-duisburg-essen.de>.
Doug Chestnut wrote:
> Hi Jörn,
>
> Jörn Nettingsmeier wrote:
> Yeah, I was hopeing that someone would point out problems with this (I
> didn't bother with docs until we hash out a good solution)
>> [concerns]
>>
>> hmm. i see how this is useful in the particular case of xslt imports,
>> but it feels a little weird in the general case.
>> it means that information about the inheritance tree is sprinkled all
>> over a publication.
>> it also means that there are two types of fallback now: really
>> transparent fallback, and fallback with some strings attached (i.e.
>> files with an opinion of who their parents are).
>> the consequences are not entirely clear to me...
> First, the optional string that you can attach to a fallback is the
> publication that the fallback should occur from, not the parent.
good. so my most important concern is unfounded.
> With this in mind, fallbacks sources should only use this option from a
> publication context (sitemaps of a publication, xslt of a publication, etc)
you mean as opposed to a module context?
<snip>
> Yep, I am certinly not tied to this
well, i can't think of a better solution, but i'm still a little unhappy
that i should be forced to put "you are here" stamps into fallback
uris to avoid loops, and that the mechanism for this selective xslt
inheritance is split between fallback:// and <xsl:import/>
>>> Adding pubids to your fallback:// protocols should also allow one to
>>> leave the xslt use-store on if used properly
> Actually, after thinking about this a little more, I am not sure this is
> the case (leave use-store on safely).
>> can you explain the term "xslt use-store"?
> Look in the cocoon.xconf file, where the xslt transformers are
> configured. My understanding of it is that the use-store is the cache
> store.
>
> http://www.nabble.com/fallback:-and-caching-t679926.html
thanks!
--
"It's sad to behold how lately the wonderful English language has,
in the hands of corporate executives and marketing experts, re-
adjusted its prospective itinerary towards mythical subterranean
realms of discomfort, leveraging traditional woven containment
devices."
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: svn commit: r451442 - /lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/FallbackSourceFactory.java
Posted by Doug Chestnut <dh...@virginia.edu>.
Hi Jörn,
Jörn Nettingsmeier wrote:
> hi doug, hi everyone!
>
>
> sorry for this longish post, i'm still not fully understanding what i'm
> trying to point out, hopefully you can makes some sens of this...
Yeah, I was hopeing that someone would point out problems with this (I
didn't bother with docs until we hash out a good solution)
>
> chestnut@apache.org wrote:
>
>> Author: chestnut
>> Date: Fri Sep 29 14:13:20 2006
>> New Revision: 451442
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=451442
>> Log:
>> Added ability to reference publication from which to fallback from,
>> This should resolves the problem of an xslt template trying to import
>> itself when
>> xslt/page2xhtml.xsl -> imports ->
>> template-fallback://xslt/page2xhtml.xsl -> imports ->
>> template-fallback://xslt/page2xhtml.xsl
>> instead use xslt/page2xhtml.xsl -> imports ->
>> template-fallback://{template1}//xslt/page2xhtml.xsl -> imports ->
>> template-fallback://{template2}//xslt/page2xhtml.xsl
>
>
> [concerns]
>
> hmm. i see how this is useful in the particular case of xslt imports,
> but it feels a little weird in the general case.
> it means that information about the inheritance tree is sprinkled all
> over a publication.
> it also means that there are two types of fallback now: really
> transparent fallback, and fallback with some strings attached (i.e.
> files with an opinion of who their parents are).
> the consequences are not entirely clear to me...
First, the optional string that you can attach to a fallback is the
publication that the fallback should occur from, not the parent.
With this in mind, fallbacks sources should only use this option from a
publication context (sitemaps of a publication, xslt of a publication, etc)
>
> the usable granularity of fallback used to be "per-file", i.e. either
> you inherit or you rewrite.
> many times i've wished for a more fine-grained approach that could
> inherit parts of files down to single elements. the problem is that this
> needs an understanding of what those elements mean, and the mechanism of
> inheritance is then split among the fallback implementation and
> domain-specific stuff. i see the same problem here: the granularity of
> inheritance is reduced by mixing fallback with an xslt-specific
> mechanism. neither knows about the other, hence the danger of loops,
> hence the workaround in the fallback implementation.
>
> [grand but probably impossible solution]
>
> a cleaner but insanely complicated solution might be to add state
> information to the fallback implementation. i.e. it must always know
> which the current publication is and act accordingly.
> e.g.:
> call template-fallback://foo.xsl
> in foo.xsl, we find: <xsl:import src="template-fallback://foo.xsl"/>
> now if the fallback implementation remembers that this is a
> fallback-included file already, it could resolve this new call to the
> correct file in the parent's parent, not cause a loop.
> but i'm sure adding this state information to fallback is impossible to
> do in a sane way in a webapp context with many source factories floating
> around on the server. it's the last of all places where i'd want
> synchronized methods and global bookkeeping.
>
> however, it shows what we need in principle.
>
> [uglier but workable solution]
Yep, I am certinly not tied to this
>
> but we have another, unfortunately more verbose mechanism almost in
> place that does exactly that (put "fallback" in the correct context):
> sitemap calls.
>
> map:match pattern="giveMeYourXSLT"
> map:aggregate
> resource-exists?
> map:part src="file://xslt/page2html.xsl"
> resource-exists?
> map:part src="new-mythical-parent-sitemap-call://giveMeYourXSLT"
> map:transform src="cleanupthemess"
>
> it's a little ugly in its xslt handling (an xsl:import has all those
> nice, sane semantics that we must now recreate by retransforming the
> aggregated stuff into a correct stylesheet), but it keeps the mechanism
> of combining a resource with the parent resource in one place (in the
> sitemap).
> all we need for this is a way to say "call into the parent sitemap".
> that should be very easy.
>
> the huuuuge downside of this grand ad-hoc design is that it adds loads
> of boilerplate sitemap code and makes complicated things clean and
> simple things complicated.
> but hopefully i've been able to illustrate my concerns about hard-coding
> parent information in fallback calls.
>
>> Adding pubids to your fallback:// protocols should also allow one to
>> leave the xslt use-store on if used properly
Actually, after thinking about this a little more, I am not sure this is
the case (leave use-store on safely).
>
>
> can you explain the term "xslt use-store"?
Look in the cocoon.xconf file, where the xslt transformers are
configured. My understanding of it is that the use-store is the cache
store.
http://www.nabble.com/fallback:-and-caching-t679926.html
>
>
> best,
>
> jörn
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org