Thanks Jan, that was exactly what I needed! It seems the issue I had was that the JavaDoc for the DMS module is not accessible (well I couldn't find it if it was), and the only 'Document' class in the main CMS JavaDoc was not related to DMS at all. Is there somewhere I can find JavaDoc for modules already, or is it possible for someone to set this up, as that would make things much easier?
Many thanks, Simon On 2 August 2012 08:13, Jan Haderka <[email protected]> wrote: > import info.magnolia.module.dms.beans.Document > > content = MgnlContext.getHierarchyManager("dms").getContent("/your/path"); > Document doc = new Document(content); > doc.getFileSize() > doc.getMimeType() or doc.getFileExtension() > > HTH, > Jan > > > On Aug 1, 2012, at 11:25 PM, Simon Goodchild wrote: > > > Hi, > > > > I'm am looking for a way to access the file size and type of objects > that are stored in the DMS repository. The use case is that I have a > paragraph setup to link to a DMS object, and want to display useful file > information automatically alongside the document link. I've looked through > all the documentation and APIs that I can find, but nothing seems to cover > this requirement (I have code for website repository objects, but this > doesn't work fro DMS). Is this possible, and if so does anybody have any > example code or pointers on which APIs to look at to achieve this? > > > > For reference, I'm working with a Magnolia 4.1 system, but can switch to > any later version if that adds support for what I need. > > > > Many thanks for any help you can give me, > > > > Simon > > > > > > ---------------------------------------------------------------- > > 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]> > ---------------------------------------------------------------- > > ---------------------------------------------------------------- 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]> ----------------------------------------------------------------
