[opencms-dev] Help on the accessing multiple image

Claus Priisholm cpr at codedroids.com
Tue Jun 6 16:47:29 CEST 2006


Strictly speaking I assume you mean that you uploaded the images to an 
image gallery. The images do end up in the virtual filesystem to begin 
with (database), however with the default setup these will eventually be 
mirrored in the real filesystem (on demand export).

Anyway, galleries are folders, so CmsObject's getResourcesInFolder(...) 
should do the trick.

http://www.codedroids.com/javadocs/opencms/build_6_0_4/docs/api/org/opencms/file/CmsObject.html

 From this list you can extract the appropriate VFS path for you image, 
but remember to use the <cms:link></cms:link> or ditto link() method to 
get the final url for the IMG tag. This method adjust the url to reflect 
the fact that (in the online project) the image has been exported to the 
real filesystem.

Keith Tang wrote:
> Hi,
> 
> I was playing around with OpenCMS and i have a question which i'm stuck 
> for 3 weeks now.
> 
> Ok, i have this main page which is written in JSP together with the 
> opencms tag to act as a template.
> However on the body content, i wish to have a banner that rotate 
> everytime the user refresh the page.
> Since OpenCMS doesnt provide banner management i tot of writing it on my 
> own.
> 
> The problem start here. in my openCMS system directory, i created an 
> photoalbum and upload all the banner in the album.
> When i check it, i notice that the image is not upload physically to 
> system but rather store in somewhere (im asumming DB).
> I was thinking of retriving the entire images from that photoalbum into 
> a JAVA:List and then randomly choose the image from the list and display 
> as my banner in the main page.
> 
> problem is, i couldnt find any API that could help me retrieve all the 
> images in the photoalbum.
> 
> Any idea on this or is there other method of doing this banner thingy.
> 
> Thanks,
> 
> Keith
> 
> 
> ------------------------------------------------------------------------
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev

-- 
Claus Priisholm, CodeDroids ApS
Phone: +45 48 22 46 46
cpr (you know what) codedroids.com - http://www.codedroids.com
cpr (you know what) interlet.dk - http://www.interlet.dk
--
Javadocs and other OpenCms stuff: 
http://www.codedroids.com/community/opencms



More information about the opencms-dev mailing list