[opencms-dev] News 2.0 for Opencms 5.0

Trevor Lee Trevor.Lee at 4Loop.com.au
Fri Oct 17 03:49:01 CEST 2003


Hi

Thanks to Sarah and Paolo for your prompt responses.

I did what Sarah suggested and i am able to create and edit news items.
Thank you!

1. I've also edited the
/system/modules/com.opencms.modules.homepage.news/templates/NewsStandard and
/system/modules/com.opencms.modules.homepage.news/templates/ChannelStandard
files to have:
<ELEMENTDEF name="frametemplate">
        <CLASS>com.opencms.template.CmsXmlTemplate</CLASS>
        <TEMPLATE>/system/modules/MyModule/templates/newsTemplate</TEMPLATE>
</ELEMENTDEF>

However when i try to load
/system/moduledemos/com.opencms.modules.homepage.news/ChannelOverview.html,
I get the following error message:
[frametemplate] ??? com.opencms.core.CmsException: 2 Not found. Detailed
error: [com.opencms.file.mySql.CmsDbAccess]
/default/vfs/system/modules/MyModule/templates/newsTemplate.

newsTemplate is an empty file and is available in the offline project view
not the online view.
What should i do?

2. I also tried modifying the <TEMPLATE></TEMPLATE> to point to a published
xml template and on this ocasion I get a page that returns the header and
footer as defined in the published xml template. No news item is displayed
when ChannelOverview is loaded.
What do i do?


3. I've followed the instructions in NewsHack/readme.rtf and created a
/systems/modules/pages directory where news.jsp, news-nav.jsp and
NewsItem.jsp reside.
The only line i changed in my news.jsp is as follows:
out.print("<p><a
href=\"/system/modules/pages/NewsItem.jsp?id="+newsItem.getID()+"\">"+newsIt
em.getHeadline()+"</a></p>");
Is the above correct? Do i need to change the other two files?


4. The other thing i'm confused about is how the instructions in
NewsHack/readme.rtf (part of news-stuff.zip) relates to the moduledemo. I'm
trying to write a page that retrieves the current articles and subsequently
displaying messages users selects on.
How should i do this? Is there a file that gives an example of this?


5. I've created a file -
/system/modules/MyModule/jsptemplates/default_news.jsp that contains:
<%@ page session="false" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>

<!doctype html public "-//W3C//DTD HTML 4.01 Translational//EN">
<html>
<head>

<title><cms:property name="title" escapeHtml="true" /></title>

<meta HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; CHARSET=<cms:property
name="content-encoding" default="ISO-8859-1" />">

</head>
<body>

<!-- Begin Page Content -->
<div id="content">
<cms:include element="body" />
<!-- Test News -->
<h1>News</h1>
<cms:include file="/system/modules/pages/news.jsp">
   <cms:param name="id">1</cms:param>
</cms:include>
</div>

</body>
</html>

The above file generates the following error:
javax.servlet.ServletException: Resource loader error in file
'/system/modules/MyModule/jsptemplates/default_news.jsp'
Root cause:
org.apache.jasper.JasperException: FlexDispatcher: Dectected inclusion loop
for target /system/modules/MyModule/jsptemplates/default_news.jsp
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
48)
		:
		:
		:

What does the "Detected inclusion loop for target" mean?

6. Can i use "default_news.jsp" as the "template" property in my own jsp
files related to displaying news items?

My apologies if the questions seem stupid, as i am new to opencms and
content management in general. It's all abit overwhelming.

I just basically need help to get the news module going, so i can view
articles and have something to start on.

Thank you in advance for any help you can give.

Cheers

Trevor




More information about the opencms-dev mailing list