Hello,

Thanks for all the help.  Last night I managed to write a brief script to 
traverse the pages I was interested in calculate their sizes based on the sum 
of their descendent mgnl;resource nodes. I'm not exactly sure where this would 
go but it would be nice if inside AdminCentral you could retrieve this "binary 
size estimate" for a page or tree of pages.

I also wrote a script to perform the JCR Garbage Collection which helped quite 
a bit -- is there a reason why this is not either in the tools menu or a 
scheduled task in CE?  Now that I know about it I plan to add it to all of our 
CE sites...

Tom

On Mar 2, 2012, at 3:31 AM, Unger, Richard wrote:

> Hi Tom,
>  
> A difficult question indeed, as the others have pointed out.
> It depends a lot on your content. For us, most of the content in terms of 
> size is in the DMS, and consists of Images and PDFs. We don’t let our editors 
> store binaries in the website repository, so we know the bulky stuff is all 
> in DMS.
>  
> The following Groovy script finds DMS content larger than 20MB. It could be 
> easily adapted to sum the size of the documents. I’m sure far more elegant 
> formulations of the script are possible, but it does the job….
>  
> Regards from Vienna,
> 
> Richard
>  
> ---------------------
> def hm = ctx.getHierarchyManager("dms");
> def root = hm.getContent("/");
>  
>  
> { node ->
>   resources = node.getChildren("mgnl:resource");
>   for (res in resources) {
>     if (res.size!=null && Integer.valueOf(res.size)>20000000) {
>       println(res.getParent().getHandle()+"/"+res.fileName+"."+res.extension 
> + "   ("+((int)(Integer.valueOf(res.size)/1000000))+"MB)")
>     }
>   }
>   resources = node.getChildren("mgnl:contentNode");
>   for (res in resources) {
>       call(res)
>   }
>   resources = node.getChildren("mgnl:content");
>   for (res in resources) {
>       call(res)
>   }
> }(root)
> -------------------------------
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> Von: [email protected] 
> [mailto:[email protected]] Im Auftrag von Tom Duffey
> Gesendet: Donnerstag, 01. März 2012 20:37
> An: Magnolia User List
> Betreff: [magnolia-user] Calculating size of content
>  
> 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]>
----------------------------------------------------------------

Reply via email to