[opencms-dev] How to acces files in the vfs?

M Butcher mbutcher at grcomputing.net
Fri Jan 16 18:24:02 CET 2004


The items in the Vector are CmsFile objects (a subclass of 
CmsResource)... CmsFile has a few nice methods for dealing with files.

I guess you'd use the CmsObject.readProperty() method for getting title, 
etc. for a file.

cms.readProperty(myFileName, 'title'); // or 'Title'?

Matt

tol wrote:
> M Butcher wrote:
> 
>>
>>  From a JSP, create a new instance of CmsJspActionElement and then use 
>> the getCmsObject() method to get the instance of the CmsObject. From 
>> there, you can do all kinds of file manipulation.
> 
> 
> Hi thanks! That looks good :-))
> 
> With CmsObject.getFilesInFolder(...)  i get a Vector of CmsResource 
> Objects. And with the embedded CmsResource I 've access to many very 
> sweet functions ;-)
> For example: CmsResource.getDateLastModified()
> Ok ... so far so good ... but now, the next question:
> 
> If I want to access the title, description like it is possible with a 
> CmsJspNavElement, how can I do that??
> 
> I assume there must be a function like getProperty(String propertyname).
> Or exist there a bridge between CmsJspNavElement and CmsResource?
> 
> I searched many Classes but I couldn't found any :-( Perhaps I've some 
> tomatos on my eyes ;-)
> 
> Some idea?
> 
> Greetings
> Tol




More information about the opencms-dev mailing list