Hi Andreas,
Andreas Hartmann schrieb:
> Hi Felix,
>
> thanks for your reply!
>
> Felix Meschberger schrieb:
>> Andreas Hartmann schrieb:
>>> is it possible to load overlapping initial content from multiple bundles
>>> when overwriting is enabled? E.g. if I have the following bundles with
>>> content:
>>
>> IIRC the initial content tree should be disjoint for different bundles
>> if overwrite is set.
>
> This makes sense.
>
>>> bundle "core": content/apps/foo/index.html
>>> bundle "gui": content/apps/foo/gui/css/foo.css
>>>
>>> When I install either of these bundles, the content of the other module
>>> is removed. Is there any way around this, or do I have to disable
>>> overwriting?
>>
>> So maybe in your core bundle you should just provide
>> content/apps/foo/index.html while in the gui bundle you should provide
>> contetn/apps/foo/gui.
>
> I have to admit that I don't really understand this – what's the
> difference to the entries I mentioned above?
>
> It's not possible to define a "target base path" for initial content, is
> it? Something like this:
>
>
> Core bundle:
>
> src/main/resources/content/apps/foo/index.html
>
> <Sling-Initial-Content>
> content;overwrite:=true
> </Sling-Initial-Content>
Ah ! point is, that there is another parameter "path" which may be used
to set the target location.
So you might probably do in core:
src/main/resources/content/index.html
<Sling-Initial-Content>
content;overwrite:=true;path:=/apps/foo/index.html
</Sling-Initial-Content>
and in GUI :
src/main/resources/content/gui/css/foo.css
<Sling-Initial-Content>
content;overwrite:=true;path=/apps/foo/gui
</Sling-Initial-Content>
See also http://incubator.apache.org/sling/site/content-loading.html
Regards
Felix
>
>
> GUI bundle:
>
> src/main/resources/content/gui/css/foo.css
>
> <Sling-Initial-Content base="apps/foo/">
> content;overwrite:=true
> </Sling-Initial-Content>
>
>
> But I see that this would depend on the order in which the bundles are
> loaded, otherwise the base path of the GUI module might not exist yet.
>
> -- Andreas
>
>
>