[opencms-dev] I_CmsXmlContentContainer changed in OpenCms 8
Paul-Inge Flakstad
flakstad at npolar.no
Fri Sep 16 10:46:41 CEST 2011
Hi,
Just noticed that org.opencms.jsp.I_CmsXmlContentContainer has changed in v8.
This is bad news, as I use this interface for reading structured content (with scriptlet code). The first problem I see is that the method hasMoreContent() is gone. Can I just use hasMoreResources() instead? Will I encounter other problems?
To illustrate, here's an example of my existing code:
I_CmsXmlContentContainer structuredContent = cms.contentload("singleFile", "%(opencms.uri)", EDITABLE);
while (structuredContent.hasMoreContent()) {
String title = cms.contentshow(paragraph, "Title"); // OpenCmsString element
I_CmsXmlContentContainer paragraph = cms.contentloop(structuredContent, "Paragraph");
while (paragraph.hasMoreContent()) {
String heading = cms.contentshow(paragraph, "Heading"); // OpenCmsString element
String text = cms.contentshow(paragraph, "Text"); // OpenCmsHtml element
}
}
Best regards,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20110916/c85bd308/attachment.htm>
More information about the opencms-dev
mailing list