Thanks for the quick response.
node type? When I try it with foo.png and foo.xml (which contains the
>> definitions), jcr:data is always 0.
>>
>
> 1. Is it possible to load files with <Sling-Initial-Content> into a custom
> This is definitely not good. My question: should the node be called foo or
> foo.png ? In case it should be called foo, the only solution I have out of
> my belly is to prefill the data into the repository and export it with
> system view export to re-import it through the bundle. The other mechanisms
> have IIRC no way of easily importing binary data.
>
> Ehrm, thinking of it, there might be a way: How about naming your image
> file as foo instead of foo.png. This way the node foo would be created and
> additional settings would be taking from foo.xml.
>
> If the node should be called foo.png, the descriptor should be foo.png.xml.
>
I forgot that foo.png was in a sub folder and so the name of foo.xml was not
relevant (I thought). As you write, naming foo.png and foo.png.xml is
correct. However, this still does not work and having looked into
Loader.installFromPath(), I also do not understand how it could work. The
first entry is foo.png for which a descriptor is found but no provider. So
the file is created with type nt:file even though it should have been
f:PageBox. What do I miss here?
foo.png.xml:
<node>
<primaryNodeType>f:PageBox</primaryNodeType>
<property>
<name>f:title</name>
<value>the tile of my first PageBox</value>
<type>String</type>
</property>
</node>
Node Type:
[f:PageBox] > nt:resource,mix:versionable
- 'title' (String)
version
> 1.1 How can I debug the loading of initial content? I install the bundle
> from Eclipse with maven autoInstallBundle but breakpoints e.g. in
> org.apache.sling.jcr.contentloader.internal.Loader.registerBundleInternal()
> are never met. Debuging servlet calls works fine.
>
The registerBundleInternal is called when a new bundle is installed - e.g.
> on system startup or by BundleContext.install as per an BundleEvent.
Yes, that's what I want.
> I usually run Sling from the standalone launcher with debugging enabled and
> connecting from Eclipse I can easily set a breakpoint and get landed.
Oem, breakpoints in Loader.registerBundleInternal() did not work with
jetty:run but with launchpad/app everything works fine (for what reasons so
ever).
> 2. WebDav: create custom node types
>> When adding files with WebDav, I want to put the files into a customized
>> node type (that inherits from nt:resource). The only way to do is, is
>> writing a handler like:
>>
>> public class NodeTypeHandler extends
>> org.apache.jackrabbit.server.io.DefaultHandler
>>
>
>
>
> Yes, this is the intent of the SimpleWebDAVServlet.
>
>
>> and add in file webdav-resource-config.xml of bundle
>> org.apache.sling.jcr.webdav something like
>>
>
> That is the current state. My intention is to have this configurable in a
> more flexible way, than hacking up the bundle (this is not really a good
> solution, right ;-) ).
>
> But currently, it is unfortunately the only solution due to lack of time of
> finding a better one. If you come up with a better more flexible solution
> (e.g. by some ConfigurationAdmin configuration or so), you are very welcome
> to hint at it.
Nice to see that your intention and my wish match; there is just reality
between us. I'll see whether I can invest some cycles of my day dreaming to
the configuration.
Marc