[opencms-dev] Using the news module with version 5.0

Carlos Lopez Molina clopez at epsa.junta-andalucia.es
Mon Nov 4 09:30:50 CET 2002


Thanks a lot, Rod.

-----Mensaje original-----
De:	Rod Thorburn [SMTP:rod.thorburn at pavtech.co.nz]
Enviado el:	jueves, 31 de octubre de 2002 19:48
Para:	'opencms-dev at www.opencms.org'
Asunto:	RE: [opencms-dev] Using the news module with version 5.0

Carlos,
I use a jsp template to access page Properties, and where reqired I have
created new page Properties to hold the data that I want in the news
channel. The jsp template code is below, though this functionality would be
better served by a jstl custom tag (which is on my list of to-dos).
Note:
1. I use the page Property "keywords" to identify the news channel/s that an
article will appear in.
2. All current news articles are in the folder news/articles/ . This way I
can either select all or some articles to display. I move old articles to
another folder to archive.
3. I use the nav pos Property to determine position in navigation.

This is not a good utilisation of jsp's - too much code. All of this should
wrapped in a class (bean or jstl) that the jsp calls. I have'nt tested on
performance issues. 

To make this really work (from a users perspective) the page creation
properties function needs to be upgraded to include the new properties that
I need - then the user will be able to create a new page (the news release)
and headlines (news channel data) in one easy step. Any ideas on how to do
this?

Rod.

<%@ page
import="com.opencms.core.I_CmsConstants,com.opencms.flex.jsp.CmsJspNavElemen
t" %>
<table cellpadding="0" celspacing="0" border="0" width="100%">
	<tr><td> </td></tr>
	<tr><td>


	<%
    // Link substitutor to make sure static export works 
    com.opencms.util.LinkSubstitution subst = new
com.opencms.util.LinkSubstitution();

	// Collect the objects required to access the OpenCms VFS from the
request
	com.opencms.flex.cache.CmsFlexRequest req =
(com.opencms.flex.cache.CmsFlexRequest)request;
	com.opencms.file.CmsObject cms = req.getCmsObject();

	// Get the current folder name
	String foldername = "/news/articles/";
	

	// Get a list of all pages / subfolders in the folder (sorted by
NavPos property)
	java.util.ArrayList list =
CmsJspNavElement.getNavigationForFolder(cms, foldername);	
    java.util.Iterator i = list.iterator();
    
    String keyWords;
	
    while (i.hasNext()) 
    {
    	CmsJspNavElement ne = (CmsJspNavElement)i.next();
    	keyWords = cms.readProperty(ne.getResourceName(), "KeyWords") ;
    	
    	if( keyWords != null )
    	{
    		if( keyWords.indexOf("m") > -1 )
    		{
    			%>
    			<p>
    				<div class="newsHeading"><%=ne.getTitle() !=
null ? ne.getTitle() : "" %></div>
    				<i><%=cms.readProperty(ne.getResourceName(),
"Date")%></i><br>
    				<%=ne.getDescription() != null ?
ne.getDescription() : "" %><br>
					<a
href="<%=subst.getLinkSubstitution(cms,
ne.getResourceName())%>"><%=ne.getNavText()%></a>
					<hr color="#EFD80D" size="4">
    	  		</p><%
    		}
    	}
    }
	%>
	
	</td></tr>
</table>

-----Original Message-----
From: Carlos Lopez Molina [mailto:clopez at epsa.junta-andalucia.es]
Sent: Thursday, October 31, 2002 8:58 PM
To: 'opencms-dev at www.opencms.org'
Subject: RE: [opencms-dev] Using the news module with version 5.0


Rod:

I am also using the news funcionality, and find it usefull, but I also 
found those caveats. Please, send me details about your jsp templates for 
news.

Best regards.
Carlos Lopez

-----Mensaje original-----
De:	Rod Thorburn [SMTP:rod.thorburn at pavtech.co.nz]
Enviado el:	miercoles, 30 de octubre de 2002 19:50
Para:	'opencms-dev at www.opencms.org'
Asunto:	RE: [opencms-dev] Using the news module with version 5.0

Hi Joe,
If you plan to us JSP's then in my opinion you should use v.5.0 . The news
module does work with v.5.0, but when I set this up I executed the SQL
statements to update the database / create tables "manually" (i.e. don't
rely on the automated setup routine) - the scripts are in the news module
zip file - and then afterwards import the news module from the
Administration View of opencms.

I would add though (and again in my experience and for my purposes) that I
have since disposed of the news module. Whilst the concept is good it is
functionally inadequate from the perspective of the user e.g. a news item
can only appear in 1 channel / most of the time users had to create a 
"page"
and news item (two separate functions). As an alternative I use JSP 
template
of which I can provide details if you wish.

Rod

-----Original Message-----
From: Joe Burkhart [mailto:jburkhar at tdhca.state.tx.us]
Sent: Thursday, October 31, 2002 7:15 AM
To: 'opencms-dev at www.opencms.org'
Subject: [opencms-dev] Using the news module with version 5.0


Can someone help me understand the best version to use?  I'll need the
functionality of the news module and possibly JSPs.

I succesfully installed the latest version 5.0 beta, but couldn't get the
news module nor the opencms website demo functioning.  I downgraded to
version 4.6 and both items are installed and working now.  Should the news
module work automatically with the 5.0 release?  If not, is there a way to
make it work?

Thanks for any direction you can give.

Joe

NOTICE: The information contained in this electronic mail message and any
attachments is confidential to Pavilion Technologies, Inc. or one of its
subsidiaries and may contain proprietary information or be legally
privileged. This message and any attachments are intended only for the
personal and confidential use of the designated recipient(s). If you are 
not
the intended recipient or an agent responsible for delivering it to the
intended recipient, you are hereby notified that you have received this
message in error, and that any review, dissemination, distribution or
copying of this message and any attachments is unauthorised and strictly
prohibited. If you have received this message in error, please notify me
immediately by telephone and electronic mail, and delete this message, any
attachments, and all copies thereof. Thank you very much.
 <<Archivo: ATT00004.html>> 
NOTICE: The information contained in this electronic mail message and any
attachments is confidential to Pavilion Technologies, Inc. or one of its
subsidiaries and may contain proprietary information or be legally
privileged. This message and any attachments are intended only for the
personal and confidential use of the designated recipient(s). If you are not
the intended recipient or an agent responsible for delivering it to the
intended recipient, you are hereby notified that you have received this
message in error, and that any review, dissemination, distribution or
copying of this message and any attachments is unauthorised and strictly
prohibited. If you have received this message in error, please notify me
immediately by telephone and electronic mail, and delete this message, any
attachments, and all copies thereof. Thank you very much.



More information about the opencms-dev mailing list