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]<mailto:[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]<mailto:[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]>
----------------------------------------------------------------