Charles Brooking wrote:
Martin Pietsch wrote:
@Node(jcrType="nt:file", jcrMixinTypes = "mix:lockable",
extend=HierarchyNode.class, discriminator = false)
public class File extends HierarchyNode
{
@Bean(jcrName="jcr:content") private Resource resource;
// getters and setters follow
}
Could the problem be caused by the webdav servlet creating a jcr:content
node having type nt:unstructured instead of nt:resource?
So instead of using the Resource class above, use something like this:
@Node(jcrType="nt:unstructured", discriminator=false)
public class ContentNode {
@Field(jcrName="jcr:mimeType") private String mimeType;
@Field(jcrName="jcr:data") private InputStream data;
@Field(jcrName="jcr:lastModified") private Calendar lastModified;
}
I thought that, too and have tried this approach already with no
success. My current Ressource class annotation does exactly look like
the one you posted. Thanks for this hint though!
I'll see if using XML configuration leads to more results.
<sv:node sv:name="jcr:content">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:unstructured</sv:value>
</sv:property>
<sv:property sv:name="jcr:data" sv:type="Binary">
<sv:value>
/9j/4AAQSkZJRg[... additional data]
</sv:value>
</sv:property>
<sv:property sv:name="jcr:lastModified" sv:type="Date">
<sv:value>2009-01-09T02:13:41.368+01:00</sv:value>
</sv:property>
<sv:property sv:name="jcr:mimeType" sv:type="String">
<sv:value>image/jpeg</sv:value>
</sv:property>
</sv:node>
</sv:node>
Later
Charlie