You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Jürgen Ragaller <ra...@null-oder-eins.ch> on 2007/07/19 17:21:59 UTC
[2.0] - Publication specific Samples for a resource type?
Hi
Markus and me are trying to provide xhtml samples for our publication.
When we use the cocoo.xconf mechanism for the samples, the samples
appear - but they also appear in the default publication (and in all
other publication's xhtml create screens). This can make sense for
generic xhtml samples (not our usecase).
One option (our favorite) would be to override the section of modules-
core/sitemanagement/usecases/site/createFiels.jx where the samples
are listed. It would be nice to only override the section where the
samples are listed. Would it be possible / and would it make sense,
to cut out only the sample loop-section (204-220 or so) and make
another fallback enabled jx:import for the snippet?
If more than one sample is present in the default pub, the canoo
tests fail.
Maybe there is another option to do this, we am not aware of?
Thanks for help
Jürgen
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: [2.0] - Publication specific Samples for a resource type?
Posted by Jürgen Ragaller <ra...@null-oder-eins.ch>.
Am Jul 19, 2007 um 17:44 schrieb Andreas Hartmann:
> Jürgen Ragaller schrieb:
>> Hi
>>
>>
>> Markus and me are trying to provide xhtml samples for our
>> publication.
>> When we use the cocoo.xconf mechanism for the samples, the samples
>> appear - but they also appear in the default publication (and in all
>> other publication's xhtml create screens). This can make sense for
>> generic xhtml samples (not our usecase).
>>
>> One option (our favorite) would be to override the section of
>> modules-core/sitemanagement/usecases/site/createFiels.jx where the
>> samples are listed. It would be nice to only override the section
>> where
>> the samples are listed. Would it be possible / and would it make
>> sense,
>> to cut out only the sample loop-section (204-220 or so) and make
>> another
>> fallback enabled jx:import for the snippet?
>>
>> If more than one sample is present in the default pub, the canoo
>> tests
>> fail.
>>
>> Maybe there is another option to do this, we am not aware of?
>
> How about this approach:
>
> In the resource type configuration, instead of listing the samples,
> a file containing the sample declarations is referenced:
>
> <component-instance name="xhtml" ...>
> ...
> <samples uri="fallback://lenya/modules/xhtml/samples/
> samples.xml"/>
> ...
> </component-instance>
>
> The samples.xml would look like this:
>
> <samples>
> <sample name="Default Sample" mime-type="application/xhtml+xml"
> uri="fallback://lenya/modules/xhtml/samples/xhtml.xml"/>
> ...
> </samples>
>
> Then you can override the samples.xml file in your publication
> and declare your own custom samples:
>
> pubs/yourpub/lenya/modules/xhtml/samples/samples.xml
>
> <samples>
> <sample name="2 Columns" mime-type="application/xhtml+xml"
> uri="fallback://lenya/modules/xhtml/samples/2columns.xml"/>
> ...
> </samples>
>
> If somebody wants to add custom samples and still support the
> default samples, they can just use aggregate-fallback:
>
> <component-instance name="xhtml" ...>
> ...
> <samples
> uri="aggregate-fallback://lenya/modules/xhtml/samples/samples.xml"/>
> ...
> </component-instance>
>
>
> IMO this would be a very clean approach. Maybe we could make the
> <samples> element optional and still support the <sample-names>
> elements if someone doesn't need this flexibility.
>
> WDYT?
>
This would be very nice - and seems to me also much cleaner than my
idea.
Jürgen
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: [2.0] - Publication specific Samples for a resource type?
Posted by Jürgen Ragaller <ra...@null-oder-eins.ch>.
Am Jul 19, 2007 um 18:23 schrieb Andreas Hartmann:
> Andreas Hartmann schrieb:
>
>> How about this approach:
>>
>> In the resource type configuration, instead of listing the samples,
>> a file containing the sample declarations is referenced:
>>
>> <component-instance name="xhtml" ...>
>> ...
>> <samples uri="fallback://lenya/modules/xhtml/samples/
>> samples.xml"/>
>> ...
>> </component-instance>
>>
>> The samples.xml would look like this:
>>
>> <samples>
>> <sample name="Default Sample" mime-type="application/xhtml+xml"
>> uri="fallback://lenya/modules/xhtml/samples/xhtml.xml"/>
>> ...
>> </samples>
>
> I implemented this, but the contents of the samples.xml file must
> look like the standard samples declaration:
>
> <samples>
> <sample-name name="Default Sample" mime-type="application/xhtml
> +xml">
> fallback://lenya/modules/xhtml/samples/xhtml.xml</sample-name>
> ...
> </samples>
>
> Please test! :)
>
>
My goodness, that was fast! - I'll do some testing tomorrow!
thanks, Andreas
Jürgen
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: [2.0] - Publication specific Samples for a resource type?
Posted by Andreas Hartmann <an...@apache.org>.
Andreas Hartmann schrieb:
> How about this approach:
>
> In the resource type configuration, instead of listing the samples,
> a file containing the sample declarations is referenced:
>
> <component-instance name="xhtml" ...>
> ...
> <samples uri="fallback://lenya/modules/xhtml/samples/samples.xml"/>
> ...
> </component-instance>
>
> The samples.xml would look like this:
>
> <samples>
> <sample name="Default Sample" mime-type="application/xhtml+xml"
> uri="fallback://lenya/modules/xhtml/samples/xhtml.xml"/>
> ...
> </samples>
I implemented this, but the contents of the samples.xml file must
look like the standard samples declaration:
<samples>
<sample-name name="Default Sample" mime-type="application/xhtml+xml">
fallback://lenya/modules/xhtml/samples/xhtml.xml</sample-name>
...
</samples>
Please test! :)
-- Andreas
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: [2.0] - Publication specific Samples for a resource type?
Posted by Andreas Hartmann <an...@apache.org>.
Jürgen Ragaller schrieb:
> Hi
>
>
> Markus and me are trying to provide xhtml samples for our publication.
> When we use the cocoo.xconf mechanism for the samples, the samples
> appear - but they also appear in the default publication (and in all
> other publication's xhtml create screens). This can make sense for
> generic xhtml samples (not our usecase).
>
> One option (our favorite) would be to override the section of
> modules-core/sitemanagement/usecases/site/createFiels.jx where the
> samples are listed. It would be nice to only override the section where
> the samples are listed. Would it be possible / and would it make sense,
> to cut out only the sample loop-section (204-220 or so) and make another
> fallback enabled jx:import for the snippet?
>
> If more than one sample is present in the default pub, the canoo tests
> fail.
>
> Maybe there is another option to do this, we am not aware of?
How about this approach:
In the resource type configuration, instead of listing the samples,
a file containing the sample declarations is referenced:
<component-instance name="xhtml" ...>
...
<samples uri="fallback://lenya/modules/xhtml/samples/samples.xml"/>
...
</component-instance>
The samples.xml would look like this:
<samples>
<sample name="Default Sample" mime-type="application/xhtml+xml"
uri="fallback://lenya/modules/xhtml/samples/xhtml.xml"/>
...
</samples>
Then you can override the samples.xml file in your publication
and declare your own custom samples:
pubs/yourpub/lenya/modules/xhtml/samples/samples.xml
<samples>
<sample name="2 Columns" mime-type="application/xhtml+xml"
uri="fallback://lenya/modules/xhtml/samples/2columns.xml"/>
...
</samples>
If somebody wants to add custom samples and still support the
default samples, they can just use aggregate-fallback:
<component-instance name="xhtml" ...>
...
<samples
uri="aggregate-fallback://lenya/modules/xhtml/samples/samples.xml"/>
...
</component-instance>
IMO this would be a very clean approach. Maybe we could make the
<samples> element optional and still support the <sample-names>
elements if someone doesn't need this flexibility.
WDYT?
-- Andreas
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org