Ticket #321 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

Macros unresolved in GS3: images in collections don't display

Reported by: ak19 Owned by: ak19
Priority: very high Milestone: 3.04 Release
Component: Greenstone3 Runtime Severity: major
Keywords: images macros httpprefix httpdocimage Cc:

Description

- In Greenstone 3 - _httpprefix_ and _httpdocimage_ macros weren't getting resolved suddenly so that images in collections didn't display

GS3 svn version of 26 April 2008 still works fine (and possibly some versions thereafter).

Problem location: - AbstractGS2DocumentRetrieve.java. Older working versions created the database and the MacroResolver? in the AbstractGS2DocumentRetrieve constructor. The change over to a new database meant that the db construction code moved into the configure() method. So did the construction of the MacroResolver? (GS2MacroResolver in this particular case) which is initialised with the db upon construction.

Prelimary solution that works (but must ask Katherine if this is a tidy enough solution): 1. Added a default constructor to GS2MacroResolver.java and a setDB(db) method. 2. AbstractGS2DocumentRetrieve constructor now creates the GS2MacroResolver object by calling its default constructor. Now configure() does not call the GS2MacroResolver constructor anymore, but instead calls the GS2MacroResolver.setDB(db) method and passes the database object just created.

Problem with solution: Untidyness. Method setDB() is specific to GS2MacroResolver. This means that AbstractGS2DocumentRetrieve.configure() has to cast its MacroResolver? member variable to GS2MacroResolver to call setDB.

Many thanks to Dr Bainbridge for lots of help in hunting down this bug.

Change History

Changed 11 years ago by ak19

I've committed these changes now.

Changed 11 years ago by ak19

  • status changed from new to closed
  • resolution set to fixed

Dr Bainbridge okayed the changes with some slight modification.

Note: See TracTickets for help on using tickets.