Also remember that versioning contributes to the total size quite a lot. So you 
definitively want to also have a look at how many versions have each piece of 
content. It's usually also the quickest and easiest way to reduce the space - 
wipe out old versions (assuming your business owner let you do that :) )

HTH,
Jan

On Mar 1, 2012, at 9:29 PM, Tom Duffey wrote:

> Hello Gregory,
> 
> What we need is a rough estimate of disk usage of pages and/or entire trees 
> of pages.  It doesn't need to be 100% accurate, and we know that the major 
> consumers are binary data like images and videos that have been added to 
> pages.  The ultimate goal is to enforce some sort of quota on sections of the 
> web site which I'm sure is a ton of work but impossible if we can't figure 
> out how to get a count.
> 
> Tom
> 
> On Mar 1, 2012, at 2:11 PM, Grégory Joseph wrote:
> 
>> Hey Tom,
>> 
>> That's a pretty interesting question! ... which...well..raises more 
>> questions :)
>> - what do you want to count, exactly ? Disk space usage, amount of... pages 
>> ? Of... content, as the subject line suggests ?
>> - what do you consider as content ? Articles' main text ? How about titles, 
>> abstracts and other pieces of text ? Attached binaries ? Binaries from the 
>> dms ?
>> 
>> That blog post is fairly interesting, but can't really be applied to 
>> Magnolia - Magnolia doesn't use nt:file and related nodetypes, because, 
>> well, it doesn't manage files and folders.
>> 
>> If you're interesting in disk space usage and the like, the pragmatic 
>> solutions are along the lines of, well, looking at how much space your db 
>> users on the filesystem, and/or exporting your content to jcr/xml files and 
>> looking at their sizes. But I'm guessing that's not exactly what you're 
>> interested in. In terms of API, you probably want to have a look at 
>> visitors, which will let you do all sorts of fancy counting.
>> Pre 4.5, you'll want ContentUtil.Visitor : 
>> http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.5-RC2/magnolia-core/apidocs/info/magnolia/cms/util/ContentUtil.html#visit(info.magnolia.cms.core.Content,%20info.magnolia.cms.util.ContentUtil.Visitor)
>> As per 4.5, switch to JCR-based APIs and use 
>> http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.5-RC2/magnolia-core/apidocs/info/magnolia/jcr/util/NodeUtil.html#visit(javax.jcr.Node,%20info.magnolia.jcr.util.NodeVisitor)
>>  instead.
>> 
>> I seem to remember the are a few examples lying about on the wiki - search 
>> for "visitor" or "scripts", perhaps they'll give some inspiration.
>> 
>> As a side note, this is the kind of thing that'd be great to see as a script 
>> that others can use. I started a GitHub repo just for this kind of thing - 
>> see https://github.com/gjoseph/Magnolia-Groovy-Scripts
>> 
>> Cheers !
>> 
>> -greg
>> 
>> On 01 Mar 2012, at 20:37, Tom Duffey wrote:
>> 
>>> Hi Everyone,
>>> 
>>> I have a need to calculate the size of the content stored in one of our 
>>> Magnolia sites (That is rapidly growing!).  There is a blog post over here 
>>> about doing this with the JCR:
>>> 
>>> http://tugdualgrall.blogspot.com/2011/03/how-to-calculate-size-of-folder-in-jcr.html
>>> 
>>> Does anyone know how to do something similar in Magnolia?  I tried using 
>>> Magnolia's QueryManager and related query tools but am not sure how to 
>>> properly write either the code or query to retrieve the nt:file nodes.
>>> 
>>> Thanks,
>>> 
>>> Tom
>>> 
>>> --
>>> Tom Duffey
>>> [email protected]
>>> 414-751-0600 x102
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> ----------------------------------------------------------------
>>> For list details, see 
>>> http://www.magnolia-cms.com/community/mailing-lists.html
>>> Alternatively, use our forums: http://forum.magnolia-cms.com/
>>> To unsubscribe, E-mail to: <[email protected]>
>>> ----------------------------------------------------------------
>> 
>> 
>> 
>> ----------------------------------------------------------------
>> For list details, see 
>> http://www.magnolia-cms.com/community/mailing-lists.html
>> Alternatively, use our forums: http://forum.magnolia-cms.com/
>> To unsubscribe, E-mail to: <[email protected]>
>> ----------------------------------------------------------------
>> 
> 
> --
> Tom Duffey
> [email protected]
> 414-751-0600 x102
> 
> 
> 
> 
> 
> 
> 
> ----------------------------------------------------------------
> For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
> Alternatively, use our forums: http://forum.magnolia-cms.com/
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------




----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to