[opencms-dev] API-question for Previous-Next-Links

Andreas Graeff andreas at urthona.de
Thu Feb 21 13:50:52 CET 2008


Hello,
I have a question about the OpenCms-API. Actually I have developed a new 
XML-content type (named "photography") for a virtual galery. In a 
preview page I'm displaying a thumbnail of all photos together with 
title, text, datetime of shooting and a link to a new page 
(photography.jsp), where the whole image is displayed. In 
photography.jsp I want to have previous and next-links to these the 
previous and photography (like photography.jsp?idx=%(number) ). To get 
this, my idea was to get the index in the current collector and with a 
simple decrement or increment of this index I have a values for my links 
and can make a contentload with the pageIndex. Though I used not the 
XML-API but pure Java.

CmsJspXmlContentBean content = new CmsJspXmlContentBean(pageContext, 
request, response);
CmsJspTagContentLoad contentlist = 
(CmsJspTagContentLoad)content.contentload("allInFolder", 
"%(opencms.folder)%(*)|photography", false);
   
But how can I get the index of the content in contentlist? With

CmsContentInfoBean oCmsContentInfoBean = new CmsContentInfoBean();
oCmsContentInfoBean = contentlist.getContentInfoBean();

it is not possible, cause the getContentInfoBean()-method is protected, 
not public.
Is there any other way to get these informations (esp. resultsize and 
resultIndex)?

Or is there any other way to get the informations from a 
CmsJspTagContentLoad to a CmsContentInfoBean? I also tried

CmsJspTagContentInfo oCmsJspTagContentInfo = new CmsJspTagContentInfo();
oCmsJspTagContentInfo.storeContentInfoBean(contentlist);

but method storeContentInfoBean() is also protected. Why are these 
methods protected? Actually it doesn't make much sense for me, but I'm 
sure I'm missing some informations ;-).
Thank you for response,
Regards
Andreas Graeff





More information about the opencms-dev mailing list