You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Gonzalo Vasquez <gv...@altiuz.cl> on 2012/04/18 16:53:21 UTC

Problem retrieving NodeId (SPI)

I'm trying to use the org.apache.jackrabbit.spi.Batch class methods provided by the SPI package (jackrabbit-spi-2.4.1.jar), but I'm having trouble discovering how to get the NodeId param as the one it needs is from the spi package, not from the core one.  Some Helper / Factory class perhaps?

Any ideas would be appreciated!

Regards,

Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes
(56-2) 335 2461
gvasquez@altiuz.cl
http://www.altiuz.cl
 




Re: Problem retrieving NodeId (SPI)

Posted by Gonzalo Vásquez <gv...@altiuz.cl>.
Perhaps then the importXml from the
Workspace class would be better for out of the box batching? 

Any known limits/size restricions for the input XML file?

Enviado desde mi iPhone

El 19-04-2012, a las 17:53, Michael Dürig <md...@apache.org> escribió:

> 
> I see. The SPI won't help here. You'd implement the SPI for providing your own JCR implementation backed by a 3rd party storage mechanism.
> 
> Michael
> 
> On 19.4.12 20:24, Gonzalo Vasquez wrote:
>> I'm trying to batch load thousands of documents in batch mode, as in
>> single doc mode takes too long. I guess the SPI would come handy this way.
>> 
>> Do I have to implement the interface? There's no such implementation
>> provided in any of the jackrabbit distribution jar files?
>> 
>> Can someone please provide sample code for batch importing documents
>> (nodes with file attachments)?
>> 
>> Regards,
>> 
>> *Gonzalo Vásquez Sáez*
>> *Gerente Investigación y Desarrollo (R&D)*
>> *Altiuz*Soluciones Tecnológicas de Negocios Ltda.
>> Av. Nueva Tajamar 555 Of. 802, Las Condes
>> (56-2) 335 2461
>> _gvasquez@altiuz.c <ma...@altiuz.com>l_
>> ___http://www.altiuz.cl <http://www.altiuz.cl/>_
>> 
>> 
>> El 19-04-2012, a las 15:08, Michael Dürig escribió:
>> 
>>> 
>>> 
>>> On 19.4.12 17:34, Gonzalo Vasquez wrote:
>>>> Understood! "All over the place" seems to be the key, but under that
>>>> conditions how do I retrieve the root NodeId? I guess using the the
>>>> RepositoryService might help, but the only method I can think of is the
>>>> executeQuery, isn't there an equivalent for Session.getRootNode() from
>>>> javax.jcr? I need to traverse a tree of nodes prior to the batch insert
>>>> process.
>>> 
>>> Hi,
>>> 
>>> What are you trying to achieve here? If you implement the SPI, you
>>> basically have to implement the RepositoryService interface. In that
>>> casse you don't get the root NodeId from anywhere, but you rather have
>>> to supply it yourself. See PathFactory and IdFactory.
>>> 
>>> Michael
>>> 
>>>> 
>>>> Any SPI code tutorials available?
>>>> 
>>>> *Gonzalo Vásquez Sáez*
>>>> *Gerente Investigación y Desarrollo (R&D)*
>>>> *Altiuz*Soluciones Tecnológicas de Negocios Ltda.
>>>> Av. Nueva Tajamar 555 Of. 802, Las Condes
>>>> (56-2) 335 2461
>>>> _gvasquez@altiuz.c <ma...@altiuz.com>l_
>>>> ___http://www.altiuz.cl <http://www.altiuz.cl/>_
>>>> 
>>>> 
>>>> El 19-04-2012, a las 11:18, Julian Reschke escribió:
>>>> 
>>>>> On 2012-04-18 16:53, Gonzalo Vasquez wrote:
>>>>>> I'm trying to use the org.apache.jackrabbit.spi.Batch class methods
>>>>>> provided by the SPI package (jackrabbit-spi-2.4.1.jar), but I'm having
>>>>>> trouble discovering how to get the NodeId param as the one it needs is
>>>>>> from the spi package, not from the core one. Some Helper / Factory
>>>>>> class
>>>>>> perhaps?
>>>>>> 
>>>>>> Any ideas would be appreciated!
>>>>>> 
>>>>>> Regards,
>>>>>> ...
>>>>> 
>>>>> The Batch class is needed to implement write operations in an SPI
>>>>> implementation. In which case, you should be using spi.NodeIds all
>>>>> over the place...
>>>>> 
>>>>> Can you clarify what you're trying to do?
>>>>> 
>>>>> Best regards, Julian
>>>> 
>> 

Re: Problem retrieving NodeId (SPI)

Posted by Michael Dürig <md...@apache.org>.
I see. The SPI won't help here. You'd implement the SPI for providing 
your own JCR implementation backed by a 3rd party storage mechanism.

Michael

On 19.4.12 20:24, Gonzalo Vasquez wrote:
> I'm trying to batch load thousands of documents in batch mode, as in
> single doc mode takes too long. I guess the SPI would come handy this way.
>
> Do I have to implement the interface? There's no such implementation
> provided in any of the jackrabbit distribution jar files?
>
> Can someone please provide sample code for batch importing documents
> (nodes with file attachments)?
>
> Regards,
>
> *Gonzalo Vásquez Sáez*
> *Gerente Investigación y Desarrollo (R&D)*
> *Altiuz*Soluciones Tecnológicas de Negocios Ltda.
> Av. Nueva Tajamar 555 Of. 802, Las Condes
> (56-2) 335 2461
> _gvasquez@altiuz.c <ma...@altiuz.com>l_
> ___http://www.altiuz.cl <http://www.altiuz.cl/>_
>
>
> El 19-04-2012, a las 15:08, Michael Dürig escribió:
>
>>
>>
>> On 19.4.12 17:34, Gonzalo Vasquez wrote:
>>> Understood! "All over the place" seems to be the key, but under that
>>> conditions how do I retrieve the root NodeId? I guess using the the
>>> RepositoryService might help, but the only method I can think of is the
>>> executeQuery, isn't there an equivalent for Session.getRootNode() from
>>> javax.jcr? I need to traverse a tree of nodes prior to the batch insert
>>> process.
>>
>> Hi,
>>
>> What are you trying to achieve here? If you implement the SPI, you
>> basically have to implement the RepositoryService interface. In that
>> casse you don't get the root NodeId from anywhere, but you rather have
>> to supply it yourself. See PathFactory and IdFactory.
>>
>> Michael
>>
>>>
>>> Any SPI code tutorials available?
>>>
>>> *Gonzalo Vásquez Sáez*
>>> *Gerente Investigación y Desarrollo (R&D)*
>>> *Altiuz*Soluciones Tecnológicas de Negocios Ltda.
>>> Av. Nueva Tajamar 555 Of. 802, Las Condes
>>> (56-2) 335 2461
>>> _gvasquez@altiuz.c <ma...@altiuz.com>l_
>>> ___http://www.altiuz.cl <http://www.altiuz.cl/>_
>>>
>>>
>>> El 19-04-2012, a las 11:18, Julian Reschke escribió:
>>>
>>>> On 2012-04-18 16:53, Gonzalo Vasquez wrote:
>>>>> I'm trying to use the org.apache.jackrabbit.spi.Batch class methods
>>>>> provided by the SPI package (jackrabbit-spi-2.4.1.jar), but I'm having
>>>>> trouble discovering how to get the NodeId param as the one it needs is
>>>>> from the spi package, not from the core one. Some Helper / Factory
>>>>> class
>>>>> perhaps?
>>>>>
>>>>> Any ideas would be appreciated!
>>>>>
>>>>> Regards,
>>>>> ...
>>>>
>>>> The Batch class is needed to implement write operations in an SPI
>>>> implementation. In which case, you should be using spi.NodeIds all
>>>> over the place...
>>>>
>>>> Can you clarify what you're trying to do?
>>>>
>>>> Best regards, Julian
>>>
>

Re: Problem retrieving NodeId (SPI)

Posted by Gonzalo Vasquez <gv...@altiuz.cl>.
I'm trying to batch load thousands of documents in batch mode, as in single doc mode takes too long. I guess the SPI would come handy this way.

Do I have to implement the interface? There's no such implementation provided in any of the jackrabbit distribution jar files?

Can someone please provide sample code for batch importing documents (nodes with file attachments)?

Regards,

Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes
(56-2) 335 2461
gvasquez@altiuz.cl
http://www.altiuz.cl
 



El 19-04-2012, a las 15:08, Michael Dürig escribió:

> 
> 
> On 19.4.12 17:34, Gonzalo Vasquez wrote:
>> Understood! "All over the place" seems to be the key, but under that
>> conditions how do I retrieve the root NodeId? I guess using the the
>> RepositoryService might help, but the only method I can think of is the
>> executeQuery, isn't there an equivalent for Session.getRootNode() from
>> javax.jcr? I need to traverse a tree of nodes prior to the batch insert
>> process.
> 
> Hi,
> 
> What are you trying to achieve here? If you implement the SPI, you basically have to implement the RepositoryService interface. In that casse you don't get the root NodeId from anywhere, but you rather have to supply it yourself. See PathFactory and IdFactory.
> 
> Michael
> 
>> 
>> Any SPI code tutorials available?
>> 
>> *Gonzalo Vásquez Sáez*
>> *Gerente Investigación y Desarrollo (R&D)*
>> *Altiuz*Soluciones Tecnológicas de Negocios Ltda.
>> Av. Nueva Tajamar 555 Of. 802, Las Condes
>> (56-2) 335 2461
>> _gvasquez@altiuz.c <ma...@altiuz.com>l_
>> ___http://www.altiuz.cl <http://www.altiuz.cl/>_
>> 
>> 
>> El 19-04-2012, a las 11:18, Julian Reschke escribió:
>> 
>>> On 2012-04-18 16:53, Gonzalo Vasquez wrote:
>>>> I'm trying to use the org.apache.jackrabbit.spi.Batch class methods
>>>> provided by the SPI package (jackrabbit-spi-2.4.1.jar), but I'm having
>>>> trouble discovering how to get the NodeId param as the one it needs is
>>>> from the spi package, not from the core one. Some Helper / Factory class
>>>> perhaps?
>>>> 
>>>> Any ideas would be appreciated!
>>>> 
>>>> Regards,
>>>> ...
>>> 
>>> The Batch class is needed to implement write operations in an SPI
>>> implementation. In which case, you should be using spi.NodeIds all
>>> over the place...
>>> 
>>> Can you clarify what you're trying to do?
>>> 
>>> Best regards, Julian
>> 


Re: Problem retrieving NodeId (SPI)

Posted by Michael Dürig <md...@apache.org>.

On 19.4.12 17:34, Gonzalo Vasquez wrote:
> Understood! "All over the place" seems to be the key, but under that
> conditions how do I retrieve the root NodeId? I guess using the the
> RepositoryService might help, but the only method I can think of is the
> executeQuery, isn't there an equivalent for Session.getRootNode() from
> javax.jcr? I need to traverse a tree of nodes prior to the batch insert
> process.

Hi,

What are you trying to achieve here? If you implement the SPI, you 
basically have to implement the RepositoryService interface. In that 
casse you don't get the root NodeId from anywhere, but you rather have 
to supply it yourself. See PathFactory and IdFactory.

Michael

>
> Any SPI code tutorials available?
>
> *Gonzalo Vásquez Sáez*
> *Gerente Investigación y Desarrollo (R&D)*
> *Altiuz*Soluciones Tecnológicas de Negocios Ltda.
> Av. Nueva Tajamar 555 Of. 802, Las Condes
> (56-2) 335 2461
> _gvasquez@altiuz.c <ma...@altiuz.com>l_
> ___http://www.altiuz.cl <http://www.altiuz.cl/>_
>
>
> El 19-04-2012, a las 11:18, Julian Reschke escribió:
>
>> On 2012-04-18 16:53, Gonzalo Vasquez wrote:
>>> I'm trying to use the org.apache.jackrabbit.spi.Batch class methods
>>> provided by the SPI package (jackrabbit-spi-2.4.1.jar), but I'm having
>>> trouble discovering how to get the NodeId param as the one it needs is
>>> from the spi package, not from the core one. Some Helper / Factory class
>>> perhaps?
>>>
>>> Any ideas would be appreciated!
>>>
>>> Regards,
>>> ...
>>
>> The Batch class is needed to implement write operations in an SPI
>> implementation. In which case, you should be using spi.NodeIds all
>> over the place...
>>
>> Can you clarify what you're trying to do?
>>
>> Best regards, Julian
>

Re: Problem retrieving NodeId (SPI)

Posted by Gonzalo Vasquez <gv...@altiuz.cl>.
Understood! "All over the place" seems to be the key, but under that conditions how do I retrieve the root NodeId? I guess using the the RepositoryService might help, but the only method I can think of is the executeQuery, isn't there an equivalent for Session.getRootNode() from javax.jcr? I need to traverse a tree of nodes prior to the batch insert process.

Any SPI code tutorials available?

Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes
(56-2) 335 2461
gvasquez@altiuz.cl
http://www.altiuz.cl
 



El 19-04-2012, a las 11:18, Julian Reschke escribió:

> On 2012-04-18 16:53, Gonzalo Vasquez wrote:
>> I'm trying to use the org.apache.jackrabbit.spi.Batch class methods
>> provided by the SPI package (jackrabbit-spi-2.4.1.jar), but I'm having
>> trouble discovering how to get the NodeId param as the one it needs is
>> from the spi package, not from the core one. Some Helper / Factory class
>> perhaps?
>> 
>> Any ideas would be appreciated!
>> 
>> Regards,
>> ...
> 
> The Batch class is needed to implement write operations in an SPI implementation. In which case, you should be using spi.NodeIds all over the place...
> 
> Can you clarify what you're trying to do?
> 
> Best regards, Julian


Re: Problem retrieving NodeId (SPI)

Posted by Julian Reschke <ju...@gmx.de>.
On 2012-04-18 16:53, Gonzalo Vasquez wrote:
> I'm trying to use the org.apache.jackrabbit.spi.Batch class methods
> provided by the SPI package (jackrabbit-spi-2.4.1.jar), but I'm having
> trouble discovering how to get the NodeId param as the one it needs is
> from the spi package, not from the core one. Some Helper / Factory class
> perhaps?
>
> Any ideas would be appreciated!
>
> Regards,
> ...

The Batch class is needed to implement write operations in an SPI 
implementation. In which case, you should be using spi.NodeIds all over 
the place...

Can you clarify what you're trying to do?

Best regards, Julian