Ticket #152 (closed enhancement: fixed)

Opened 12 years ago

Last modified 9 years ago

Allow different paths to collect dir

Reported by: oranfry Owned by: ak19
Priority: moderate Milestone: 2.84 Release
Component: GLI Severity: enhancement
Keywords: Cc:

Description

Make it use a collectdir option so it can be outside of greenstone, eg on a pen drive.

Change History

Changed 10 years ago by kjdon

  • severity set to enhancement
  • milestone set to Collection building wishlist

Changed 9 years ago by kjdon

  • milestone changed from Collection building wishlist to 2.84 Release

Is this done??

Changed 9 years ago by kjdon

collectdir handling is done. But need to look at similar file prefix for log files. Or maybe for etc directory???

GSDLETCHOME or something would then be added into gsdlsite.cfg.

Changed 9 years ago by ak19

Need to check that collectdir can be located elsewhere. Last time I tested this with Greenstone 2.83 for someone using Greenstone in R-block and who needed this feature, it seemed to ignore the collectdir value. (Is it still the llssite and glisite config files where the collectdir can be specified?)

Changed 9 years ago by ak19

  • owner changed from nobody to ak19

Changed 9 years ago by ak19

Allowing different paths to collect dir so that GLI can work with collect dirs on pen drives.

Note that NONE OF THESE CHANGES ARE FOR Client-GLI AS YET.

GLI code changes. Committed with revision 22605.

1. Preferences (Connection tab), Open and New Collection dialogs allow one to change the current collect directory containing the collections to select from.

2. New Collection dialog allows one to base a new collection on an existing collection in a collect dir other than the current collect dir.

3. Collections in the Documents in Greenstone Collections Workspace Tree Node now have two additional rightclick options: to move and copy these collections to another location." .

Files changed in GLI:

A classes/images/gsCollection.gif M classes/dictionary.properties M src/org/greenstone/gatherer/file/FileManager.java M src/org/greenstone/gatherer/file/WorkspaceTree.java M src/org/greenstone/gatherer/file/FileQueue.java M src/org/greenstone/gatherer/Gatherer.java M src/org/greenstone/gatherer/gui/GUIManager.java M src/org/greenstone/gatherer/gui/OpenCollectionDialog.java M src/org/greenstone/gatherer/gui/Preferences.java M src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java M src/org/greenstone/gatherer/collection/CollectionManager.java M src/org/greenstone/gatherer/util/Utility.java

Changed 9 years ago by ak19

Files changed in GLI (commits for revision 22605):

A classes/images/gsCollection.gif

M classes/dictionary.properties

M src/org/greenstone/gatherer/Gatherer.java

M src/org/greenstone/gatherer/file/FileManager.java

M src/org/greenstone/gatherer/file/WorkspaceTree.java

M src/org/greenstone/gatherer/file/FileQueue.java

M src/org/greenstone/gatherer/gui/GUIManager.java

M src/org/greenstone/gatherer/gui/OpenCollectionDialog.java

M src/org/greenstone/gatherer/gui/Preferences.java

M src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java

M src/org/greenstone/gatherer/collection/CollectionManager.java

M src/org/greenstone/gatherer/util/Utility.java

Changed 9 years ago by ak19

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

Changed 9 years ago by ak19

More changes. This time to get the apache web server's httpd.conf file's alias for collecthome set both from the gsicontrol commandline scripts as well as from GLI's LocalLibraryServer? and its interaction with server.jar (Greenstone 3 code).

The LocalLibraryServer? case was more complicated in that the web server needed to send a reconfigure and restart message to the web server (via server.jar) when the collect dir had been changed, so that this could update the httpd.conf file. But this only happens if GLI launches GSI, not if it was independently launched (in which case server.jar would use glisite.cfg, not llssite.cfg).

Next, when the GSI dialog has been closed, changing the collectdir should relaunch the GSI and web server reconfigured, ready for the new collectdir, just as pressing the preview relaunches the web server. Finally, fixes to get proper communication with the GSI/server.jar to work whenever the GSI is suddenly closed and restarted through Preview and when GLI is thereafter exited: needed to get GLI to still close the GSI then.

Commit Revision numbers and changed files:

- 22613: gsicontrol.bat and windows-httpd.conf.in

- 22635: gsicontrol.sh and httpd.conf.in (runtime/src/packages/apache-httpd)

- 22660: greenstone3/src/java/org/greenstone/server/Server2.java

- 22661: GLI's dictionary.properties, Gatherer.java and LocalLibraryServer?.java

- 22662: Greenstone 2's lib/java/server.jar was updated from a compile-core rebuild of Greenstone 3

Changed 9 years ago by ak19

More changes for making the collectdir movable (ticket 152):

(1) Changes to GLI code so that llssite and glisite are updated to contain the COLLECTHOME property to tell server.exe where the new collect dir is.

REVISION 22678:

- collection/CollectionManager.java (modified) (1 diff)

- greenstone/LocalLibraryServer.java (modified) (5 diffs)

(2) server.exe must be told that it needs to restart (so it can read the new collecthome).

REVISION 22677:

- recpt/configaction.cpp (modified) (2 diffs)

- w32server/fnord.cpp (modified) (3 diffs)

Changed 9 years ago by ak19

Further changes for ticket 152: making the collectdir moveable.

(1) When using server.exe, if GLI was last shutdown when another collectdir was active, this needs to be read in from the user config.xml by GLI, and server.exe needs to use it.

Revision 22770 - runtime-src and common-src:

- runtime-src\src\w32server\settings.cpp (read_settings method, when there is no value to a key in a config file, the key was wrongly assumed to be a start of a new [section])

- common-src\src\lib\cfgread.cpp (Dr Bainbridge fixed error in method read_ini_line, surrounding the reading of a newline when there is no value to a key in a config file)

Revision 22771 - GLI:

- gatherer\Gatherer.java

- gatherer\greenstone\LocalLibraryServer?.java

(2) To tell the local library server to release a collection, need to pass the current loadedCollectionName (which is the group-qualified collection name) with a URL style slash:

Revision 22772 - GLI (also undoes error in accidental commit of these files in revision 22771)

- gatherer\cdm\CollectionConfiguration?.java

- gatherer\collection\CollectionManager?.java

Changed 9 years ago by ak19

Revision 22780: GLI's collect\CollectionManager?.java

closeCollection is not supposed to do a releaseCollection, else one can't view a collection after it has been closed in GLI.

Changed 9 years ago by ak19

Further changes to GLI for ticket 152 (movable collectdir): Need to deal with GLI being started and reading in a non-standard collectdir from config files (stored from a previous GLI session) that now no longer exists. In this case need to revert back to the default Greenstone collectdir. Tested on Windows with the included Apache webserver and server.exe

Revision 22806:

- gatherer\Gatherer.java

- gatherer\greenstone\LocalLibraryServer?.java

Changed 9 years ago by ak19

Further changes for ticket 152 (movable collectdir), to get server.exe to load all the collections in a non-standard collect directory. Previously the runtime-src\src\w32server\cgiwrapper.cpp code read in all collections in any collecthome property listed in a section OTHER THAN the default [gsdl] section of gli/llssite.cfg.

Now the code has been adjusted to additionally handle a non-standard collecthome value specified in the [gsdl] section itself. (Moved the shared code into a function, since it was a lot of code duplication.)

Revision 22822 - runtime src code

1. src\w32server\cgiwrapper.cpp

Forgot to commit. Minor edit to output message when a restart message is sent to server.exe from GLI's LocalLibraryServer?.java class:

2. src\recpt\configaction.cpp

Changed 9 years ago by ak19

Code for loading collections from the default Greenstone collect directory is already duplicated in new method load_collections_from_collectdir, so it's now being called. There were some minor changes to make the references to collecthome consistent for the default GS collectdir case. Also fixed the new method load_collections_from_collectdir method so that it works with collect groups (just as the code for the standard collect dir has been working for collectgroups), by not checking for the existence of build_cfg, since colgroups don't have this but ought to be loaded on the home page nevertheless.

Revision 22833: runtime-src\src\w32server\cgiwrapper.cpp

Changed 9 years ago by ak19

Tested the changes for revision 22806 on Linux. (Reloading GLI when the previous non-standard collectdir no longer exists makes GLI default to using the standard GS collectdir)

Changed 9 years ago by ak19

The following *appear* to be the final changes necessary to make non-standard collectdirs work in GLI:

Both export.pl and exportcol.pl--for Export (to other formats) and Write To CD-Rom menu options, respectively--are now given a collectdir parameter so exporting can work for collections in non-standard collect directories.

1. Revision 22848:

- src\org\greenstone\gatherer\gui\ExportAsPrompt?.java

- src\org\greenstone\gatherer\gui\WriteCDImagePrompt.java

2. Revision 22849:

- bin\script\exportcol.pl

- perllib\strings.properties

Changed 9 years ago by ak19

More changes.

If the default GS collectdir is the one active in GLI (but all collections are closed) when exiting GLI, this default GS collectdir is not stored in config.xml (in the User Data location). Instead of the last opened collection or last open collectdir, an empty value is written out in the case of the default GS collectdir. This will allow other GS installations to open in their own collectdir. This benefit does not extend to if a collection in another GS' default collectdir was left open. In that case, the collection path is written out to the config.xml file, and the collectdir that a 2nd GLI loads will be the 1st GLI's collect dir.

Files committed with revision 23015 in gli:

- src\org\greenstone\gatherer\Gatherer.java

- src\org\greenstone\gatherer\gui\GUIManager.java

- src\org\greenstone\gatherer\collection\CollectionManager?.java

- src\org\greenstone\gatherer\greenstone\LocalLibraryServer?.java

Changed 9 years ago by ak19

More changes to making collectdir movable:

1. When not working with a remote GS or server.exe: if the collecthome set in GLI is not the same as the one in gsdlsite.cfg used by the apache web server, then a dialog pops up on exiting GLI allowing the user to set the collecthome value for both GLI (in the user's GLI config.xml) and the server (in gsdlsite.cfg).

2. Collecthome line in gsdlsite.cfg is removed if it is the default GS collect folder. (Just as a recent commit stores an empty string for the open_collection element in the GLI config.xml file if no collection is left open on exiting GLI and the collect folder is the default GS collect directory.)

3. Some bug fixes

4. Tested with apache web server. And then tested that the changes for step 1 do not affect server.exe and applet (and hence remote GS). Applet still works too.

Changes to the following GLI files, committed with revision 23143:

classes\dictionary.properties

src\org\greenstone\gatherer\Gatherer.java

src\org\greenstone\gatherer\collection\CollectionManager?.java

src\org\greenstone\gatherer\greenstone\LocalLibraryServer?.java

src\org\greenstone\gatherer\gui\GUIManager.java

src\org\greenstone\gatherer\util\Utility.java

Note: See TracTickets for help on using tickets.