Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 38388 invoked from network); 10 Apr 2008 00:06:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Apr 2008 00:06:25 -0000 Received: (qmail 81550 invoked by uid 500); 10 Apr 2008 00:06:24 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 81525 invoked by uid 500); 10 Apr 2008 00:06:24 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 81516 invoked by uid 99); 10 Apr 2008 00:06:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2008 17:06:24 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of a.exceeder@gmail.com designates 209.85.200.172 as permitted sender) Received: from [209.85.200.172] (HELO wf-out-1314.google.com) (209.85.200.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Apr 2008 00:05:33 +0000 Received: by wf-out-1314.google.com with SMTP id 23so3170708wfg.13 for ; Wed, 09 Apr 2008 17:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=5rQkc9w1sgsmmVvsJAJQCO3VXthz6gB0GGTsp8HsusU=; b=bcsLh0MosOFQN5kdV7st08EvPsW+p1XddWIa/Thdi0JwaQ+wzTqgGnCczlDvazBnhWyuLgnmX3GaEEpA9JL1R4U9C4FcNluN/cepBELWHEKhds5z3H6DhDTqfWl4p4NCYXe+znzOjrsPq4hd3NOw2UC+DT2cj9lDkzKqmzKObX4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=j+MXGX4nuJOhGz4ls2SsX6E/jWEg19kw/knhKLRwqDdzRyZQX2sOJ/OjgiTJe1VBsmq0zKUTS8AXUIqwu+FbD19OaYOhh4CiDj6jv3rFDTevlLjRYpH4N4Py1A6L1FHlY2pa/3JWEls+gGbw+7DO7jiem38veRGjyZf8eXGMP0U= Received: by 10.142.201.3 with SMTP id y3mr234735wff.1.1207785952797; Wed, 09 Apr 2008 17:05:52 -0700 (PDT) Received: by 10.142.224.19 with HTTP; Wed, 9 Apr 2008 17:05:52 -0700 (PDT) Message-ID: <1ceb66bf0804091705l3e83327cx45f2c1d864a06997@mail.gmail.com> Date: Wed, 9 Apr 2008 20:05:52 -0400 From: "Alex Pakka" To: users@jackrabbit.apache.org Subject: OCM and Proprety.getLength() question MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_154_2702936.1207785952796" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_154_2702936.1207785952796 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_154_2702936.1207785952796--