Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 87365 invoked from network); 13 Jun 2007 12:21:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jun 2007 12:21:28 -0000 Received: (qmail 85599 invoked by uid 500); 13 Jun 2007 12:21:30 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 85578 invoked by uid 500); 13 Jun 2007 12:21:30 -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 85567 invoked by uid 99); 13 Jun 2007 12:21:30 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2007 05:21:30 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [195.154.103.130] (HELO condor.legisway.com) (195.154.103.130) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2007 05:21:26 -0700 Received: from asterion.legisway.com ([10.0.0.46]) by condor.legisway.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 13 Jun 2007 14:33:54 +0200 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Importing and Exporting XML X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Wed, 13 Jun 2007 14:19:39 +0200 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Importing and Exporting XML thread-index: AcettJ5eEpLJLuuNQrmjMj5WvhvHaQAAF21Q From: =?iso-8859-1?Q?Fr=E9d=E9ric_Esnault?= To: X-OriginalArrivalTime: 13 Jun 2007 12:33:54.0391 (UTC) FILETIME=[1AD18E70:01C7ADB7] X-Virus-Checked: Checked by ClamAV on apache.org See JCR 325. Quote from a previous talk with Jukka Zitting : ----------------------- > It seems very strange to just ignore the multivalued properties. It = gives > completely wrong documents. I see your point. Earlier on we disabled the multivalue export in docview because people were getting confused when their exports would not roundtrip properly. BR, Jukka Zitting ----------------------- My multivalued reference properties are not exported. Fr=E9d=E9ric Esnault=20 =20 -----Message d'origine----- De=A0: Alessandro Bologna [mailto:alessandro.bologna@gmail.com]=20 Envoy=E9=A0: mercredi 13 juin 2007 14:17 =C0=A0: users@jackrabbit.apache.org Objet=A0: Re: Importing and Exporting XML Quoting from the code comments for escapeValue(): * Returns the document view representation of the given property. * Multiple values are combined into a space-separated list of * space-escaped string values, binary values are encoded using the * Base64 encoding, and other values are simply returned using =20 their * default string representation. Alessandro. On Jun 13, 2007, at 8:02 AM, Fr=E9d=E9ric Esnault wrote: > Of course, in wolly's case, it doesn't really matter, but =20 > jackrabbit is not supposed to be a "one use product", but a =20 > generic JCR. And I just tried my own use case, which is not a very =20 > odd case, where I have some contracts referencing contractors by =20 > reference. And with a document view, I loose these references, the =20 > contract managers also multivalued, and so on. > > I don't know how you export references, because I can't. > > Fr=E9d=E9ric Esnault > > -----Message d'origine----- > De : Alessandro Bologna [mailto:alessandro.bologna@gmail.com] > Envoy=E9 : mercredi 13 juin 2007 13:55 > =C0 : users@jackrabbit.apache.org > Objet : Re: Importing and Exporting XML > > Frederic, > > Some multivalued properties are handled correctly (say for instance > multivalued references are exported as space separated lists of > references in an attribute), and in some other cases it's still > possible to do an encoding of the values, so that they can be > represented inside an XML attribute. But I agree that in some cases > it's really not practical (say binary properties...) because the XML > that would result would probaby be not very much readable. > > But in Wolly's (or Phil's?) case, the problem is to round-trip XML, > which does not have multi-valued properties to start with (so it > doesn't really matter, does it?) > > Alessandro. > > > On Jun 13, 2007, at 7:43 AM, Fr=E9d=E9ric Esnault wrote: > >> What about the multivalued properties not included in the export? >> The exported document, even if it's modified by XSL/java is still >> incorrect, as the multivalued properties are simply ignored. >> >> I know the JSR 170 spec leaves the right to do so, but imo it >> creates an incoherent export. I don't think anyone even think about >> the possibility that some properties are just ignored when doing an >> export from a CMS... >> >> Fr=E9d=E9ric Esnault - Ing=E9nieur R&D >> >> >> -----Message d'origine----- >> De : Alessandro Bologna [mailto:alessandro.bologna@gmail.com] >> Envoy=E9 : mercredi 13 juin 2007 13:34 >> =C0 : users@jackrabbit.apache.org >> Objet : Re: Importing and Exporting XML >> >> Yes. Two ways: >> 1. Java way: use the DocumentViewExportVisitor and override the >> includeProperty() method (simply return false if the property has a >> namespace you don't want). >> >> 2. XML way: use an XSLT identity transformation and add rules for >> removing any attribute that you don't want. >> >> Alessandro >> >> >> On Jun 13, 2007, at 7:20 AM, woolly wrote: >> >>> >>> Thanks for replying... >>> >>> If I have a document like this: >>> >>> >>> edam >>> lancashire >>> cheshire >>> stilton >>> >>> >>> ...and I import it using: >>> fis =3D new FileInputStream(inputFile); >>> session.importXML(node.getPath(), fis, >>> ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW); >>> fis.close(); >>> >>> ...when I export it using: >>> out =3D new FileOutputStream(outputFile); >>> session.exportDocumentView(node.getPath(), out, true, false); >>> >>> ...I get: >>> >>> >>> >> xmlns:jcr=3D"http://www.jcp.org/jcr/1.0" >>> xmlns:nt=3D"http://www.jcp.org/jcr/nt/1.0" >>> xmlns:sv=3D"http://www.jcp.org/jcr/sv/1.0" >>> xmlns:rdf=3D"http://www.w3.org/1999/02/22-rdf-syntax-ns#" >>> xmlns:xs=3D"http://www.w3.org/2001/XMLSchema" >>> xmlns:fn=3D"http://www.w3.org/2005/xpath-functions" >>> xmlns:fn_old=3D"http://www.w3.org/2004/10/xpath-functions" >>> xmlns:mix=3D"http://www.jcp.org/jcr/mix/1.0" xmlns:rep=3D"internal" >>> jcr:primaryType=3D"nt:unstructured"> >>> edam >>> lancashire >>> cheshire >>> stilton >>> >>> >>> ...is there any way to just get the original document out? >>> >>> Thanks, >>> >>> Phil. >>> >>> >>> Julian Reschke wrote: >>>> >>>> woolly wrote: >>>>> Surely then I would want to use some form of document view, >>>>> then, in >>>>> order to >>>>> get back the original document I put in? >>>> >>>> Yes (contrary to what you've been told here before). >>>> >>>> There are known limitations with the document view (such as >>>> restrictions >>>> with multivalued props). But the thing you complained about was >>>> something else; maybe unneeded attributes in the jcr namespace? >>>> Could >>>> you be a bit more specific about that problem? >>>> >>>> Best regards, Julian >>>> >>>> >>>> >>> >>> --=20 >>> View this message in context: http://www.nabble.com/Importing-and- >>> Exporting-XML-tf3908819.html#a11097246 >>> Sent from the Jackrabbit - Users mailing list archive at Nabble.com. >>> >> >