Opened 16 years ago
Closed 16 years ago
#321 closed defect (fixed)
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):
- Added a default constructor to GS2MacroResolver.java and a setDB(db) method.
- 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 (2)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Dr Bainbridge okayed the changes with some slight modification.
I've committed these changes now.