home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

<?xml version="1.0" encoding="utf-8" ?>
<%@ page contentType="text/xml;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.Timestamp" %>
<%@ page import="net.myvietnam.mvncore.util.*" %>
<%@ page import="com.mvnforum.db.*" %>
<%@ page import="com.mvnforum.MyUtil" %>
<%@ page import="com.mvnforum.user.UserModuleConfig" %>
<%@ page import="com.mvnforum.MVNForumConfig" %>
<%@ page import="com.mvnforum.MVNForumInfo" %>
<%@ page import="com.mvnforum.MVNForumResourceBundle" %>
<% request.setAttribute("contentType", "text/xml;charset=utf-8");%>
<%@ include file="inc_common.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<% response.setContentType("text/xml;charset=utf-8");%>
<%
Collection threadBeans = (Collection) request.getAttribute("ThreadBeans");
int forumID = ((Integer)request.getAttribute("ForumID")).intValue();
String prefix = ParamUtil.getServerPath() + request.getContextPath() + UserModuleConfig.getUrlPattern();
String logoUrl = ParamUtil.getServerPath() + request.getContextPath() + "/mvnplugin/mvnforum/images/logo.gif";

String channelLink = prefix + "/index";
String channelTitle = MVNForumResourceBundle.getString(onlineUser.getLocale(), "mvnforum.common.forum.title_name");
String channelDesc;
Timestamp now = DateUtil.getCurrentGMTTimestamp();
String channelPubDate = DateUtil.getDateRFC822(now);
String channelLastBuildDate = channelPubDate;
String channelDocs = prefix + "/rsssummary";
String channelGenerator = "mvnForum Feed Generator " + MVNForumInfo.getProductVersion();
ForumCache forumCache = ForumCache.getInstance();
if (forumID > 0) {
    // Forum specific RSS
    String forumName = forumCache.getBean(forumID).getForumName();
    channelTitle = channelTitle + " (Forum: " + forumName + ")";
    channelDesc  = "RSS Feed of " + channelTitle;
} else {
    // global RSS
    channelTitle = channelTitle;
    channelDesc  = "RSS Feed of " + channelTitle + " (Global RSS)";
}
%>
<rss version="2.0">
<channel>
  <title><%=channelTitle%>
  <link><%=prefix%>/index
  <description><%=channelDesc%>
  <language>en-us
<%--   --%>
  <lastBuildDate><%=channelLastBuildDate%>
  <docs><%=channelDocs%>
  <generator><%=channelGenerator%>
  <image>
    <title>
    <url><%=logoUrl%>
    <link><%=prefix%>/index
    <width>141
    <height>50
    <description>mvnForum - free open source Jsp/Servlet forum
  </image>

  <textInput>
    <title>Search
    <description>Search all posts
    <name>key
    <link><%=prefix%>/search
  </textInput>
<%
for (Iterator iterator = threadBeans.iterator(); iterator.hasNext(); ) {
  ThreadBean threadBean = (ThreadBean)iterator.next(); %>
  <item>
    <title><%=MyUtil.filter(threadBean.getThreadTopic(), false/*html*/, false/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%>
    <link><%=prefix%>/viewthread?thread=<%=threadBean.getThreadID()%>
    <description><%=MyUtil.filter(StringUtil.getShorterString(threadBean.getThreadBody(), MVNForumConfig.getMaxCharsInRss()), false/*html*/, false/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%>
    <%-- author><%=threadBean.getMemberName()%>
    <pubDate><%=DateUtil.getDateRFC822(threadBean.getThreadCreationDate())%>
    <category><%=forumCache.getBean(threadBean.getForumID()).getForumName()%>
    <guid><%=prefix%>/viewthread?thread=<%=threadBean.getThreadID()%>&lastpage=yes
  </item>
<% }//for%>
</channel>
</rss>
</fmt:bundle>



my book on functional programming

 

new blog posts

 

Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.