You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Marco Piovesana <pi...@esteco.com> on 2017/04/10 08:11:12 UTC

import elements from external system preserving creation date

Hi all,
I'm trying to migrate data from an external system to Oak preserving the
creation date of each element. I tried to set the JCR:creationDate but that
is not allowed since the property is protected.
I saw that the ImportContentHandler has methods to push SAX events in the
repository. Is that the only way to import content? Since my data is inside
another system would be easier for me to create directly the objects with
java instead of generating an XML first.

Marco.

Re: import elements from external system preserving creation date

Posted by Marco Piovesana <pi...@esteco.com>.
then i guess the safest way is to create the custom property. Thanks Davide!

On Wed, Apr 19, 2017 at 10:59 AM, Davide Giannella <da...@apache.org>
wrote:

> On 10/04/2017 09:11, Marco Piovesana wrote:
> > Hi all,
> > I'm trying to migrate data from an external system to Oak preserving the
> > creation date of each element. I tried to set the JCR:creationDate but
> that
> > is not allowed since the property is protected.
>
> No. You can't modify/create the `jcr:created`. What you can do is
> creating a custom property though. If you want you could even create a
> custom namespace.
>
> > I saw that the ImportContentHandler has methods to push SAX events in the
> > repository. Is that the only way to import content? Since my data is
> inside
> > another system would be easier for me to create directly the objects with
> > java instead of generating an XML first.
>
> It really depends what you want to do. You can use the importer, vlt
> packages and maybe something else. However it really depends on your
> migration strategy. If you prefer to use the java API you can and as you
> stated it may be actually easier if your current persistent does not
> allow any export already. Just remember that is better to use the JCR
> API (oak-jcr) rather than the Oak API as the latter are quite low level
> and you risk to miss quite some things (index updates, acl checks, ...).
>
> HTH
> Davide
>
>
>


-- 

marco piovesanA
Enterprise Application



*ESTECO* | EXPLORE DESIGN PERFECTION

AREA Science Park, Padriciano 99 - 34149 Trieste - ITALY
Phone: +39 040 3755548 - Fax: +39 040 3755549
[Website] <http://www.esteco.com> | [Twitter]
<https://twitter.com/esteco_mF> | [Facebook]
<https://www.facebook.com/esteco.spa> | [Linkedin]
<https://www.linkedin.com/company/748217>
Pursuant to Legislative Decree No. 196/2003, you are hereby informed that
this message contains confidential information intended only for the use of
the addressee. If you are not the addressee, and have received this message
by mistake, please delete it and immediately notify us. You may not copy or
disseminate this message to anyone. Thank you. Please consider the
environment before printing this email.

Re: import elements from external system preserving creation date

Posted by Davide Giannella <da...@apache.org>.
On 10/04/2017 09:11, Marco Piovesana wrote:
> Hi all,
> I'm trying to migrate data from an external system to Oak preserving the
> creation date of each element. I tried to set the JCR:creationDate but that
> is not allowed since the property is protected.

No. You can't modify/create the `jcr:created`. What you can do is
creating a custom property though. If you want you could even create a
custom namespace.

> I saw that the ImportContentHandler has methods to push SAX events in the
> repository. Is that the only way to import content? Since my data is inside
> another system would be easier for me to create directly the objects with
> java instead of generating an XML first.

It really depends what you want to do. You can use the importer, vlt
packages and maybe something else. However it really depends on your
migration strategy. If you prefer to use the java API you can and as you
stated it may be actually easier if your current persistent does not
allow any export already. Just remember that is better to use the JCR
API (oak-jcr) rather than the Oak API as the latter are quite low level
and you risk to miss quite some things (index updates, acl checks, ...).

HTH
Davide