jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Pakka" <a.excee...@gmail.com>
Subject OCM and Proprety.getLength() question
Date Thu, 10 Apr 2008 00:05:52 GMT
Hi,

I have a question: you can map jcrType = "nt:file" to your own POJO and have
@Bean for the "nt:resource". It works just fine and files are stored
properly. Now on more than one occasion I have to set Content-Length for
this file. It seems to be there is no way to map Property.getLength() of
the "jcr:data" to any field in your own Bean, neither directly nor through
the type converters. Was it a small overlook in design or an intended
limitation? What would be the best workaround approach here?

1. Have your own int @Field with content length. The problem is, my files
are read from the socket through the legacy protocol and the length is not
always known beforehand. This solution will force me to pump the content to
the local disk first, slowing down the system.

2. Use POJOs where possible and store jcr:content as a Node (a bit ugly)

3. Patch @Field, FieldDescriptor and fix SimpleFieldsHelper's
retrieveSimpleField() to understand something like @Field(
jcrName="jcr:data.length")? For this one I would like to contribute the
code.

I started playing with Jackrabbit a week ago and was surprised how good it
is. Unit tests are of great help, especially for OCM, given the lack of
documentation. Thanks everyone on the project!

Alex Pakka

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message