Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#808 closed defect (fixed)

Tidying up Greenstone support for RSS.

Reported by: ak19 Owned by: ak19
Priority: moderate Milestone: 2.86 Release
Component: Collection Building Severity: major
Keywords: Cc:

Description

Commit revision: 24958

First commit to do with Greenstone's support for RSS. Committing Dr Bainbridge's code which was already working for windows. This has now been tested on Linux, where it can be got to work with changes to zextra.dm and base.dm and if the rss-items.rdf file generated by the update to BasePlugout is moved to the index folder). The next set of commits will make the way rssaction.cpp accesses the rss-items.rdf file independent of where the GS server is located, with changes to the protocol class.

http://trac.greenstone.org/changeset/24958

  • configure.in configure win32.mak
  • runtime-src: configure.in configure
  • runtime-src/src/recpt: rssaction.h rssaction.cpp (2 newly added files) and cgiwrapper.cpp
  • runtime-src/src/recpt: Makefile.in win32.mak
  • perllib/plugouts/BasePlugout.pm

Change History (21)

comment:1 by ak19, 12 years ago

Second commit to do with Greenstone's support for RSS. Has been tested on Linux, and works if zextra.dm and base.dm are setup properly and if the rss-items.rdf file generated by the update to BasePlugout is moved to the index folder. Modified Dr Bainbridge's code to make the way that rssaction.cpp accesses the rss-items.rdf file independent of where the GS server is located, by adding a new method to get the rss-items.rdf file's contents to the recptproto protocol class and implementing it in nullproto. The method is also mirrored in corba/corbaproto, however compilation with corba fails in a part of the code that I've not modified.

All changes are in runtime-src/src:

  • corba: corbaServer.mpp, corbaproto.h corbaproto.mpp
  • protocol: nullproto.cpp nullproto.h recptproto.cpp recptproto.h
  • recpt: rssaction.cpp rssaction.h

comment:2 by ak19, 12 years ago

The changes necessary for the RSS support to work:

  1. macros/base.dm:

-_httpdocumenthandle_ {_httpprefix_handle/_1_/_2_}

+##_httpdocumenthandle_ {_httpprefix_handle/_1_/_2_}

+_httpdocumenthandle_ {_httpprefix_/collect/_1_/document/_2_}

  1. macros/zextra.dm:

+package Global + +_httpdomain_ {http://localhost:8282}

  1. BasePlugout generates the file rss-items.rdf in the collection's archives folder upon build. This needs to be be in the index folder.
  1. Then visit the collection's page and set the action to rss by typing a=rss in the URL (in place of the pageaction of a=p&p=about).

E.g. http://localhost:8282/greenstone/cgi-bin/library.cgi?site=localhost&a=rss&c=demo&l=en&w=utf-8

comment:3 by ak19, 12 years ago

Still need to get the Corba part to compile. Configuring with --enable-corba succeeds, but compilation fails method corbaproto.mpp's get_collectioninfo (around line 593), which does not appear to be related to the get_rss_items() method I added.

comment:4 by ak19, 12 years ago

The revision number of the second commit described in the 2nd entry for this ticket above was 24959 and its changes can be seen at

http://trac.greenstone.org/changeset/24959

comment:5 by ak19, 12 years ago

Commit revision 24970:

corba/corbaiface.idl

Dr Bainbridge noticed that previous commits to corba needed an additional change: corbaiface.idl needs the new method's definition added in as well. Still have compilation errors with corbainterface not getting generated from this even with enable-corba turned on when configuring, but this step is necessary regardless.

comment:6 by ak19, 12 years ago

Commit revision for 24970 mentioned above: http://trac.greenstone.org/changeset/24970

Corba still won't compile, same problems as mentioned a couple of comments up.

Another relevant commit (to fix oversight in earlier commit):

http://trac.greenstone.org/changeset/24961

Fixed copy and paste errors in recent commits and removed some unused comments.

main/trunk/greenstone2/runtime-src/src/corba/corbaproto.mpp (modified) (2 diffs)

http://trac.greenstone.org/changeset/24961

comment:7 by ak19, 12 years ago

To setup base.dm and zextra.dm properly:

--- base.dm (revision 24958) +++ base.dm (working copy) @@ -172,7 +172,8 @@

_httpdocument_ {_gwcgi_?e=_compressedoptions_&a=d} _httpdoc_ {_gwcgi_?e=_compressedoptions_&a=d}

-_httpdocumenthandle_ {_httpprefix_handle/_1_/_2_} +##_httpdocumenthandle_ {_httpprefix_handle/_1_/_2_} +_httpdocumenthandle_ {_httpprefix_/collect/_1_/document/_2_}

_httpextlink_ {_gwcgi_?e=_compressedoptions_&a=extlink} _httpbuild_ {_gwcgi_?e=_compressedoptions_&a=bc}

Index: zextra.dm =================================================================== --- zextra.dm (revision 24958) +++ zextra.dm (working copy) @@ -11,3 +11,8 @@

# one of the last macro files to be processed, and consequently can # redefined macros that have already been defined in the main macro # files in this folder

+ +# Make it the proper full domain URL. Localhost for testing. + +package Global + +_httpdomain_ {http://localhost:8282}

comment:8 by ak19, 12 years ago

To setup base.dm and zextra.dm properly:

base.dm:

##_httpdocumenthandle_ {_httpprefix_handle/_1_/_2_}

_httpdocumenthandle_ {_httpprefix_/collect/_1_/document/_2_}

zextra.dm # Make the _httpdomain_ the proper full domain URL. (Localhost used here for testing purposes.)

package Global

_httpdomain_ {http://localhost:8282}

comment:9 by ak19, 12 years ago

Resolution: fixed
Status: newclosed

Corba has been cleaned up.

See trac related commits (for example http://trac.greenstone.org/changeset/25232):

16.03.2012: Today

22:27 Changeset [25232] by ak19

Adding a README file for the corba part of runtime-src so that …

21:38 Changeset [25231] by ak19

Many changes to get corba working again ever since the addition of RSS …

21:27 Changeset [25230] by ak19

We've shifted over to mico-2.3.13 (from 2.3.5), which required we use POA …

20:29 Changeset [25229] by ak19

  1. The mico version is still the new 2.3.13, but it has been altered so …

20:29 Changeset [25228] by ak19

Replaced with newest (and customised) version of mico:2.3.13

20:28 Changeset [25227] by ak19

  1. The mico version is still the new 2.3.13, but it has been altered so …

29.02.2012:

16:29 Changeset [25189] by ak19

Added new version of mico. The older version 2.3.5 does not work on the 64 …

comment:10 by ak19, 12 years ago

In runtime-src/src/recpt/win32.mak

needed to remove -DDOCHANDLE option to CXXFLAGS as this was part of Dr Bainbridge's changes for restful URLs and had nothing to do with RSS support in Greenstone and was not meant to be committed alongside.

This change has now been undone with commit http://trac.greenstone.org/changeset/25521

comment:11 by ak19, 11 years ago

Three more commits which do almost all of the setting up for RSS support. The final manual step is for the user to edit zextra.dm as explained in the replies above. Then run the apache webserver and visit http://localhost:8282/greenstone/cgi-bin/library.cgi?site=localhost&a=rss&c=demo&l=en&w=utf-8

  1. http://trac.greenstone.org/changeset/26976

where buildcol.pl now moves the rss-items.rdf file from archives to index

  1. http://trac.greenstone.org/changeset/26977

Now the linux httpd.conf.in contains the rewrite rules for pretty URls. This further required adding the --enable-rewrite configure flag so that Linux will now compile up the mod_rewrite module, which is necessary for turning on the RewriteEngine in http.conf. (The mod_rewrite module is compiled up as part of the Linux apache binary and not present as a separate .so file in apache's modules subdir)

  1. http://trac.greenstone.org/changeset/26978

With this commit, the windows-httpd.conf.in template file also contains the Rewrite rules for the pretty URLs. While the mod_rewrite.so module is already compiled up and present for windows in its apache's modules subfolder, the windows-httpd.conf.in file needed to have the line loading that module uncommented (LoadModule rewrite_module modules/mod_rewrite.so) so that it's now activated.

Before committing the changes, tested these changes on fresh checkouts of Windows and Linux.

comment:12 by ak19, 11 years ago

Added RSS support for GS3 with

http://trac.greenstone.org/changeset/27087

Commit message: Implemented RSS support for GS3. At present, can see this with a=rss in the url, when a collection is built. Soon will have a button (at least for the GS3 demo collection).

4 files added, 5 modified

Java source code

MOD: util/GSParams.java, collection/ServiceCluster.java, service/ServiceRack.java,

ADDED: service/RSSRetrieve.java, action/RSSAction.java,

web/interfaces

MOD: web/interfaces/default/interfaceConfig.xml, web/interfaces/default/transform/gslib.xsl

ADDED: web/interfaces/default/transform/pages/rss.xsl, web/interfaces/default/transform/html-output.xsl

comment:13 by ak19, 11 years ago

Commits 27093, 27095 where the rssaction.cpp code works out and sets the _httpdomain_ macro if not set in zextra.dm

Commit 27099 which allows for an rss feed button in a GS2 collection, along with the adjustments to macro files necessary for this. Demonstrated in GS2's demo collection by adjusting the collection's macros/extra.dm file.

comment:14 by ak19, 11 years ago

Commits 27100 and 27101: GS3 RSS support finished. Now the RSSRetrieve ServiceRack is commented out by default in a collectionConfig.xml file. Once uncommented and rebuilt, the collection's pages will have an RSS icon in the button bar which links to the RSS feed for that collection. The lucene-jdbm-demo collection has the RSSRetrieve ServiceRack activated in its collectionConfig.xml file to demonstrate this behaviour.

comment:16 by ak19, 11 years ago

GS2: http://trac.greenstone.org/changeset/27150

Shifting the position of the RSS link in GS2 to header area. Smaller icon. Changes to demo collection's extra.dm macro file, as the RSS link will appear on all pages in the header now the user specifies that it should appear. Moved the actual rsslink macro and javascript into nav_css which defines the header, rather than in base and style.dm where the rsslink macro and associated javacsript function were before.

comment:17 by ak19, 11 years ago

Further commits for GS3, to change the presence of the RSS link on a collection's page is specified and tested for:

http://trac.greenstone.org/changeset/27151

http://trac.greenstone.org/changeset/27152

In collectionConfig.xml, the RSSRetrieve ServiceRack is now back to being always active again. Instead, header.xsl now tests for a gsf:option on RSS to determine whether to include an RSS feed link or not. The user can set a gsf:option with name attribute set to RSS and value set to true in any of the format elements of collectionConfig.xml to display an RSS feed link in the associated sections.

comment:18 by ak19, 11 years ago

The older instructions added to the wiki 2.86 Release Notes page, which no longer apply:

If you're using a post-2.86rc2 caveat binary that is not so new that the above was implemented in it yet, try to see if the following works for your intermediate 2.86 installation then:

  1. Open your Greenstone installations's macros/zextra.dm file in an editor
  1. Copy and paste the following at the end of the file, adjusting the host and port to your situation (by default the host is localhost and the default port number is 8282 for Greenstone 2):

# Make the _httpdomain_ the proper full domain URL. (Localhost used here for testing purposes.)

package Global _httpdomain_ { http://localhost:8282}

  1. Run the apache webserver included with Greenstone
  1. Visit the following URL in your browser, making sure to adjust the host and port number once again if required:

http://localhost:8282/greenstone/cgi-bin/library.cgi?site=localhost&a=rss&c=demo&l=en&w=utf-8

If on subsequent attempts, things do not work, check that the port number hasn't changed. Otherwise you will need to re-edit the macros/zextra.dm file to refer to this new port number.

comment:19 by ak19, 11 years ago

The latest instructions on the 2.86 Release Notes page of the Wiki:

For GS2.86, go to GLI's Format panel's Collection Specific Macros, and paste the following:

package Global _optrsslink_ { _rsslink_ }

Alternatively, you can just paste the above directly into your collect/<collection-name>/macros/extra.dm file

comment:20 by ak19, 11 years ago

Correction: For GS2.86, go to GLI's Format panel's Collection Specific Macros, and paste the following:

package Global

_optrsslink_ {

_rsslink_

}

Alternatively, you can just paste the above directly into your collect/<collection-name>/macros/extra.dm file

[A similar correction to the extra.dm statement two comments up:

# Make the _httpdomain_ the proper full domain URL. (Localhost used here for testing purposes.)

package Global

_httpdomain_ { http://localhost:8282}

]

Note: See TracTickets for help on using tickets.