You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Anand Rathi <ra...@gmail.com> on 2012/04/26 12:44:19 UTC

How to calculate size of data uploaded under certain node

Hi,

I am using jackrabbit v2.2.5. I have hierarchy of nodes and uploading files
under those nodes.

I want to measure the size of data uploaded under certain node. Is there
any way to get this? Is this possible using SQL or XPATH search?

Thanks.

Regards,
Anand

Re: How to calculate size of data uploaded under certain node

Posted by Justin Edelson <ju...@gmail.com>.
Hi Anand,
In JCR, you would generally do this though the Visitor pattern,  not by
using a query.

Justin
On Apr 26, 2012 6:44 AM, "Anand Rathi" <ra...@gmail.com> wrote:

> Hi,
>
> I am using jackrabbit v2.2.5. I have hierarchy of nodes and uploading files
> under those nodes.
>
> I want to measure the size of data uploaded under certain node. Is there
> any way to get this? Is this possible using SQL or XPATH search?
>
> Thanks.
>
> Regards,
> Anand
>

AW: How to calculate size of data uploaded under certain node

Posted by "Seidel. Robert" <Ro...@aeb.de>.
Hi Andand,

sry, i've misread about aggregate functions. They do actually not exist. But you can select for the property like

SELECT yourdatasizeproperty FROM [nt:unstructured] WHERE ISDESCENDANTNODE([/some/node]) AND ...

And add the result by iterating over the result.

Regards, Robert
 
-----Ursprüngliche Nachricht-----
Von: Anand Rathi [mailto:rathiar@gmail.com] 
Gesendet: Donnerstag, 26. April 2012 14:40
An: users@jackrabbit.apache.org
Betreff: Re: How to calculate size of data uploaded under certain node

Thanks Robert.

I am already storing size as a custom property with every file uploaded.
But then how can I calculate the total size under a node using aggregate functions?  An example here would be really helpful.

Currently I am doing it by visiting each node recursively and calculating the size.

Regards,
Anand

On Thu, Apr 26, 2012 at 4:55 PM, Seidel. Robert <Ro...@aeb.de>wrote:

> Hi,
>
> by default, the size of data is not stored as property.
>
> A possible solution would be using a custom node type and add a 
> property for the size (and fill it). Then you can use aggregate 
> functions in the query.
>
> Regards, Robert
>
> -----Ursprüngliche Nachricht-----
> Von: Anand Rathi [mailto:rathiar@gmail.com]
> Gesendet: Donnerstag, 26. April 2012 12:44
> An: users@jackrabbit.apache.org
> Betreff: How to calculate size of data uploaded under certain node
>
> Hi,
>
> I am using jackrabbit v2.2.5. I have hierarchy of nodes and uploading 
> files under those nodes.
>
> I want to measure the size of data uploaded under certain node. Is 
> there any way to get this? Is this possible using SQL or XPATH search?
>
> Thanks.
>
> Regards,
> Anand
>

Re: How to calculate size of data uploaded under certain node

Posted by Anand Rathi <ra...@gmail.com>.
Thanks Robert.

I am already storing size as a custom property with every file uploaded.
But then how can I calculate the total size under a node using aggregate
functions?  An example here would be really helpful.

Currently I am doing it by visiting each node recursively and calculating
the size.

Regards,
Anand

On Thu, Apr 26, 2012 at 4:55 PM, Seidel. Robert <Ro...@aeb.de>wrote:

> Hi,
>
> by default, the size of data is not stored as property.
>
> A possible solution would be using a custom node type and add a property
> for the size (and fill it). Then you can use aggregate functions in the
> query.
>
> Regards, Robert
>
> -----Ursprüngliche Nachricht-----
> Von: Anand Rathi [mailto:rathiar@gmail.com]
> Gesendet: Donnerstag, 26. April 2012 12:44
> An: users@jackrabbit.apache.org
> Betreff: How to calculate size of data uploaded under certain node
>
> Hi,
>
> I am using jackrabbit v2.2.5. I have hierarchy of nodes and uploading
> files under those nodes.
>
> I want to measure the size of data uploaded under certain node. Is there
> any way to get this? Is this possible using SQL or XPATH search?
>
> Thanks.
>
> Regards,
> Anand
>

AW: How to calculate size of data uploaded under certain node

Posted by "Seidel. Robert" <Ro...@aeb.de>.
Hi,

by default, the size of data is not stored as property. 

A possible solution would be using a custom node type and add a property for the size (and fill it). Then you can use aggregate functions in the query.

Regards, Robert

-----Ursprüngliche Nachricht-----
Von: Anand Rathi [mailto:rathiar@gmail.com] 
Gesendet: Donnerstag, 26. April 2012 12:44
An: users@jackrabbit.apache.org
Betreff: How to calculate size of data uploaded under certain node

Hi,

I am using jackrabbit v2.2.5. I have hierarchy of nodes and uploading files under those nodes.

I want to measure the size of data uploaded under certain node. Is there any way to get this? Is this possible using SQL or XPATH search?

Thanks.

Regards,
Anand