Index: main/trunk/greenstone2/runtime-src/configure
===================================================================
--- main/trunk/greenstone2/runtime-src/configure	(revision 24902)
+++ main/trunk/greenstone2/runtime-src/configure	(revision 24958)
@@ -310,5 +310,5 @@
 
 ac_subdirs_all="$ac_subdirs_all packages"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION USE_FASTCGI USE_LANGACTION USE_CORBA MICO_DIR USE_Z3950 USE_YAZ ENABLE_JAVA USE_JDBM USE_GDBM ENABLE_ACCENTFOLD USE_SQLITE USE_APACHE_HTTPD ENABLE_MG ENABLE_MGPP ENABLE_LUCENE LDFLAGS CFLAGS CC CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX JAVAC JAVACFLAGS JAVA uudecode AWK YACC build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB COMPAT32BITFLAGS MICO_VER CPP EGREP U ANSI2KNR ALLOCA LIBOBJS STATIC gsdlos gsdlarch MODULEDIRS subdirs LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION USE_FASTCGI USE_LANGACTION USE_CORBA MICO_DIR USE_Z3950 USE_YAZ ENABLE_JAVA USE_JDBM USE_GDBM ENABLE_ACCENTFOLD USE_SQLITE USE_RSS USE_APACHE_HTTPD ENABLE_MG ENABLE_MGPP ENABLE_LUCENE LDFLAGS CFLAGS CC CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX JAVAC JAVACFLAGS JAVA uudecode AWK YACC build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB COMPAT32BITFLAGS MICO_VER CPP EGREP U ANSI2KNR ALLOCA LIBOBJS STATIC gsdlos gsdlarch MODULEDIRS subdirs LTLIBOBJS'
 ac_subst_files=''
 
@@ -862,4 +862,5 @@
   --disable-accentfold    Disable Accent Folding for MGPP
   --disable-sqlite        Disable SQLite support
+  --disable-rss        Disable RSS support
   --enable-apache-httpd  Enable Apache httpd support
   --disable-mg        Disable MG compilation
@@ -1519,4 +1520,23 @@
 
 
+# Check whether --enable-rss or --disable-rss was given.
+if test "${enable_rss+set}" = set; then
+  enableval="$enable_rss"
+  USE_RSS=$enableval
+else
+  USE_RSS=yes
+fi;
+if test $USE_RSS = "yes" -o $USE_RSS = "1" ; then
+  USE_RSS=1
+  cat >>confdefs.h <<\_ACEOF
+#define USE_RSS
+_ACEOF
+
+else
+  USE_RSS=0
+fi
+
+
+
 # Check whether --enable-apache-httpd or --disable-apache-httpd was given.
 if test "${enable_apache_httpd+set}" = set; then
@@ -2991,5 +3011,5 @@
 CLASS_TEST=Test.class
 cat << \EOF > $JAVA_TEST
-/* #line 2993 "configure" */
+/* #line 3013 "configure" */
 public class Test {
 }
@@ -3168,5 +3188,5 @@
         ac_cv_prog_uudecode_base64=yes
 else
-        echo "configure: 3170: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
+        echo "configure: 3190: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
         echo "configure: failed file was:" >&5
         cat Test.uue >&5
@@ -3292,5 +3312,5 @@
 CLASS_TEST=Test.class
 cat << \EOF > $JAVA_TEST
-/* #line 3294 "configure" */
+/* #line 3314 "configure" */
 public class Test {
 }
@@ -3333,5 +3353,5 @@
 TEST=Test
 cat << \EOF > $JAVA_TEST
-/* [#]line 3335 "configure" */
+/* [#]line 3355 "configure" */
 public class Test {
 public static void main (String args[]) {
@@ -8504,4 +8524,5 @@
 s,@ENABLE_ACCENTFOLD@,$ENABLE_ACCENTFOLD,;t t
 s,@USE_SQLITE@,$USE_SQLITE,;t t
+s,@USE_RSS@,$USE_RSS,;t t
 s,@USE_APACHE_HTTPD@,$USE_APACHE_HTTPD,;t t
 s,@ENABLE_MG@,$ENABLE_MG,;t t
Index: main/trunk/greenstone2/runtime-src/configure.in
===================================================================
--- main/trunk/greenstone2/runtime-src/configure.in	(revision 24902)
+++ main/trunk/greenstone2/runtime-src/configure.in	(revision 24958)
@@ -136,4 +136,17 @@
 fi
 AC_SUBST(USE_SQLITE)
+
+dnl
+dnl Set use of RSS (enabled by default)
+dnl
+AC_ARG_ENABLE(rss, [  --disable-rss        Disable RSS support], USE_RSS=$enableval, USE_RSS=yes)
+if test $USE_RSS = "yes" -o $USE_RSS = "1" ; then
+  USE_RSS=1
+  AC_DEFINE(USE_RSS,[])
+else
+  USE_RSS=0
+fi
+AC_SUBST(USE_RSS)
+
 
 dnl
Index: main/trunk/greenstone2/runtime-src/src/recpt/Makefile.in
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/Makefile.in	(revision 24902)
+++ main/trunk/greenstone2/runtime-src/src/recpt/Makefile.in	(revision 24958)
@@ -117,4 +117,15 @@
 endif
 
+USE_RSS = @USE_RSS@
+ifeq ($(USE_RSS), 1)
+RSS_DEFINES = -DUSE_RSS
+RSS_SOURCES = rssaction.cpp
+RSS_OBJECTS = rssaction.o
+else
+RSS_DEFINES =
+RSS_SOURCES =
+RSS_OBJECTS =
+endif
+
 
 USE_Z3950 = @USE_Z3950@
@@ -155,5 +166,5 @@
 CXX = @CXX@
 CXXFLAGS = @CXXFLAGS@ @COMPAT32BITFLAGS@
-DEFS = @DEFS@ -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DHAVE_CONFIG_H $(FASTCGI_DEFS) $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(Z3950_DEFS)
+DEFS = @DEFS@ -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DHAVE_CONFIG_H $(FASTCGI_DEFS) $(RSS_DEFINES) $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(Z3950_DEFS)
 INCLUDES = -I. -I$(GSDL_DIR) -I$(COMMON_DIR)/src/lib \
         -I$(COLSERVR_DIR) -I$(PROTOCOL_DIR) \
@@ -211,4 +222,5 @@
 	querytools.cpp \
 	receptionist.cpp \
+	$(RSS_SOURCES) \
 	statusaction.cpp \
 	summarise.cpp \
@@ -258,4 +270,5 @@
 	querytools.o \
 	receptionist.o \
+	$(RSS_OBJECTS) \
 	statusaction.o \
 	summarise.o \
Index: main/trunk/greenstone2/runtime-src/src/recpt/cgiwrapper.cpp
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/cgiwrapper.cpp	(revision 24902)
+++ main/trunk/greenstone2/runtime-src/src/recpt/cgiwrapper.cpp	(revision 24958)
@@ -72,4 +72,8 @@
 #endif
 
+#if defined(USE_RSS)
+#include "rssaction.h"
+#endif
+
 #include "tipaction.h"
 #include "statusaction.h"
@@ -531,4 +535,9 @@
 #endif
 
+#if defined(USE_RSS)
+  rssaction *arssaction = new rssaction();
+  recpt.add_action (arssaction);
+#endif
+
   queryaction *aqueryaction = new queryaction();
   aqueryaction->set_receptionist (&recpt);
Index: main/trunk/greenstone2/runtime-src/src/recpt/rssaction.cpp
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/rssaction.cpp	(revision 24958)
+++ main/trunk/greenstone2/runtime-src/src/recpt/rssaction.cpp	(revision 24958)
@@ -0,0 +1,137 @@
+/**********************************************************************
+ *
+ * rssaction.cpp -- 
+ * Copyright (C) 1999  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+#include "gsdl_modules_cfg.h"
+#ifdef USE_RSS
+
+#include "fileutil.h"
+
+#include "rssaction.h"
+
+rssaction::rssaction () {
+  // this action uses cgi variable "a"
+  cgiarginfo arg_ainfo;
+  arg_ainfo.shortname = "a";
+  arg_ainfo.longname = "action";
+  arg_ainfo.multiplechar = true;
+  arg_ainfo.multiplevalue = false;
+  arg_ainfo.defaultstatus = cgiarginfo::weak;
+  arg_ainfo.argdefault = "rss";
+  arg_ainfo.savedarginfo = cgiarginfo::must;
+
+  argsinfo.addarginfo (NULL, arg_ainfo);
+
+}
+
+void rssaction::get_cgihead_info (cgiargsclass &/*args*/, recptprotolistclass * /*protos*/,
+				   response_t &response, text_t &response_data, 
+				   ostream &/*logout*/) {
+  response = content;
+  response_data = "application/rdf+xml";
+}
+
+void rssaction::generate_rss_header( displayclass &disp, 
+				     outconvertclass &outconvert, ostream &textout, 
+				     ostream &logout)
+{
+  textout << outconvert << disp
+	  << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+	  << "<rss version=\"2.0\"\n"
+	  << "xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n"
+	  << "  xmlns:taxo=\"http://purl.org/rss/1.0/modules/taxonomy/\"\n"
+	  << "  xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n"
+	  << "  xmlns:syn=\"http://purl.org/rss/1.0/modules/syndication/\"\n"
+	  << "  xmlns:admin=\"http://webns.net/mvcb/\">\n"
+
+	  << "<channel>\n"
+	  << "  <title>_collectionname_</title>\n"
+	  << "  <link>_httppageabout_</link>\n"
+	  << "  <description>_collectionextra_</description>\n"
+	  << "  <language>_cgiargl_</language>\n"
+	  << "  <pubDate>Thu, 23 Aug 1999 07:00:00 GMT</pubDate>\n"
+	  << "  <lastBuildDate>Thu, 23 Aug 1999 16:20:26 GMT</lastBuildDate>\n"
+	  << "  <managingEditor>_creator_</managingEditor>\n"
+	  << "  <webMaster>_maintainer_</webMaster>\n"
+
+	  << "<image>\n"
+	  << "  <title>_collectionname_</title>\n"
+	  << "  <url>_iconcollection_</url>\n"
+	  << "  <link>_httppageabout_</link>\n"
+	  << "  <description>_collectionextra_</description>\n"
+	  << "</image>\n";
+}
+
+void rssaction::generate_rss_content(text_t& rss_filename, displayclass &disp, 
+				     outconvertclass &outconvert, ostream &textout, 
+				     ostream &logout)
+{
+  text_t rss_items;
+
+  if (read_file(rss_filename,rss_items)) {
+    textout << outconvert << disp << rss_items;
+  }
+
+
+}
+
+void rssaction::generate_rss_footer( displayclass &disp, 
+				     outconvertclass &outconvert, ostream &textout, 
+				     ostream &logout)
+{
+
+  textout << outconvert << disp
+	  << "  </channel>\n"
+	  << "</rss>\n";
+}
+
+
+
+
+bool rssaction::do_action (cgiargsclass &args, recptprotolistclass *protos, 
+			    browsermapclass * /*browsers*/, displayclass& disp, 
+			    outconvertclass &outconvert, ostream &textout, 
+			    ostream &logout) {
+  //bool wassuccess = false;
+  //comerror_t err;
+ 
+
+  /*
+  recptproto *collectproto = protos->getrecptproto (args["c"], logout);
+  if (!args["c"].empty() && (collectproto != NULL)) {
+    collectproto->ping (args["c"], wassuccess, err, logout);
+    if (err != noError) wassuccess = false; // a communication error
+  }
+  */
+
+  text_t rss_filename = filename_cat(gsdlhome,"collect",args["c"],"index","rss-items.rdf");
+
+  generate_rss_header(disp,outconvert,textout,logout);
+  generate_rss_content(rss_filename,disp,outconvert,textout,logout);
+  generate_rss_footer(disp,outconvert,textout,logout);
+
+  return true;
+};
+
+#endif //USE_RSS
Index: main/trunk/greenstone2/runtime-src/src/recpt/rssaction.h
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/rssaction.h	(revision 24958)
+++ main/trunk/greenstone2/runtime-src/src/recpt/rssaction.h	(revision 24958)
@@ -0,0 +1,68 @@
+/**********************************************************************
+ *
+ * rssaction.h -- 
+ * Copyright (C) 1999  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+#include "gsdl_modules_cfg.h"
+#ifdef USE_RSS
+
+#ifndef RSSACTION_H
+#define RSSACTION_H
+
+#include "gsdlconf.h"
+#include "action.h"
+
+
+class rssaction : public action {
+public:
+  rssaction ();
+  virtual ~rssaction () {}
+
+  text_t get_action_name () {return "rss";}
+
+  void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
+			 response_t &response, text_t &response_data, 
+			 ostream &logout);
+
+  bool do_action (cgiargsclass &args, recptprotolistclass *protos, 
+		  browsermapclass *browsers, displayclass &disp, 
+		  outconvertclass &outconvert, ostream &textout, 
+		  ostream &logout);
+
+ protected:
+  void generate_rss_header(displayclass &disp, 
+			   outconvertclass &outconvert, ostream &textout, 
+			   ostream &logout);
+  void generate_rss_content(text_t& rss_filename, displayclass &disp, 
+		  outconvertclass &outconvert, ostream &textout, 
+		  ostream &logout);
+  void generate_rss_footer(displayclass &disp, 
+			   outconvertclass &outconvert, ostream &textout, 
+			   ostream &logout);
+
+
+};
+
+
+#endif //!RSSACTION_H
+#endif //USE_RSS
Index: main/trunk/greenstone2/runtime-src/src/recpt/win32.mak
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/win32.mak	(revision 24902)
+++ main/trunk/greenstone2/runtime-src/src/recpt/win32.mak	(revision 24958)
@@ -45,4 +45,5 @@
 DLLDEBUG = 0
 ENABLE_ACCENTFOLD = 1
+USE_RSS = 1
 USE_GDBM = 1
 USE_JDBM = 1
@@ -79,4 +80,14 @@
 !ELSE
 ACCENTFOLD_LIBS = 
+!ENDIF
+
+!IF $(USE_RSS)
+RSS_DEFINES = -DUSE_RSS
+RSS_SOURCES = rssaction.cpp
+RSS_OBJECTS = rssaction.obj
+!ELSE
+RSS_DEFINES =
+RSS_SOURCES =
+RSS_OBJECTS =
 !ENDIF
 
@@ -187,5 +198,5 @@
 CC = cl
 DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE \
-        -DGSDL_NOCACHE $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(MSSQL_DEFINES) \
+	-DGSDL_NOCACHE $(RSS_DEFINES) $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(MSSQL_DEFINES) \
 	$(Z3950_DEFS) $(MG_DEFS) $(MGPP_DEFS) $(LUCENE_DEFS)
 INCLUDES = -I. -I"$(GSDL_DIR)" -I"$(COMMON_DIR)\src\lib" -I"$(COLSERVR_DIR)" -I"$(PROTOCOL_DIR)" \
@@ -205,4 +216,5 @@
 !ENDIF
 
+CXXFLAGS = $(CXXFLAGS) -DDOCHANDLE
 
 COMPILE = $(CC) -nologo -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
@@ -263,4 +275,5 @@
 	querytools.cpp \
 	receptionist.cpp \
+	$(RSS_SOURCES) \
 	statusaction.cpp \
 	$(SQL_SOURCES) \
@@ -311,4 +324,5 @@
 	querytools.obj \
 	receptionist.obj \
+	$(RSS_OBJECTS) \
 	statusaction.obj \
 	$(SQL_OBJECTS) \
