jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conoly, Brett" <Brett.Con...@digitalinsight.com>
Subject RE: Importing and exporting
Date Mon, 14 Apr 2008 12:41:23 GMT
This is only a guess but the jcr:content node has a mimetype property,
are you setting that correctly when you first put the new nodes into the
repository?  There are actually a few ways to automate this using
already written code.  There's JMimeMagic which reads the bytes but
can't really tell the difference in different text files, i.e. text/html
-> text/plain.  There's also sun's MimeTable which seems to be based on
the extension and will be able to interpret different types of text
based files.  Again this is just a guess but it may work.
Hope this helps,
Brett

-----Original Message-----
From: Vidar Ramdal [mailto:vidar@idium.no] 
Sent: Monday, April 14, 2008 7:02 AM
To: users@jackrabbit.apache.org
Subject: Re: Importing and exporting

On Mon, Apr 14, 2008 at 12:37 PM, Vidar Ramdal <vidar@idium.no> wrote:
> Hi all;
>
>  I'm trying to migrate data from one repository to another.
>  So I export a top-level folder (called "/admin") to an XML file,
using
>  Session.exportSystemView. This results in an XML file which looks OK,
>  and where all nt:files and nt:folders are represented as binary data.
>  I suppose this is normal.
>
>  Then I import into the other repository, using Session.importXML. I
>  get no error messages, and the hierarchy is reflected in the
receiving
>  repository.
>
>  However, files and folders do not seem to be restored properly. I
have
>  an HTML file in the /admin folder, and when inspecting it after
>  import, it is rendered as a stream of bytes - not as the actual text,
>  as I would have expected.

The bytes that are dumped are of course the Base64 representation of
the file contents. So it seems that contents of nt:file are not
decoded when importXMLing. This makes sense (kindof).
So, if this is not a bug, one question remains: How do I export and
import a subtree including binary files?


-- 
Vidar S. Ramdal <vidar@idium.no> - http://www.idium.no
Akersgata 16, N-0158 Oslo, Norway

Mime
View raw message