Provides a very minimal wrapper around the CWRC-Writer, so that it can be used in an Islandora context.
This module requires the following modules/libraries:
The build directory contains the compiled version of the Islandora CWRC-Writer. It can also be built from the source, if NPM is installed.
Islandora CWRC-Writer is expected to be installed here:
- sites/default/modules/islandora_cwrc_writer/
- Navigate to
sites/default/modules/islandora_cwrc_writer/
- Clone this repo:
git clone https://github.com/cwrc/islandora_cwrc_writer.git
- Install the dependencies:
npm install
- Run the build:
npm run build
- Navigate to
sites/default/modules/islandora_cwrc_writer/
- Get the latest changes:
git pull
- Clear the Drupal cache:
drush cc all
Touchpoints between CWRC-Writer (JavaScript) and Islandora (cwrc/islandora_cwrc_writer Drupal Module)
Section goals:
- communicate the assumptions built into the integration module about how to interact with CWRC-Writer
- help determine whether or not a change to CWRC-Writer will be a breaking change to the integration module
- be updated as CWRC-Writer changes
The islandora_cwrc_writer modules uses code within the "theme", "utilities", and "js" directories to embed CWRC-Writer into a Drupal page by referencing items within the CWRC-Writer directory and overriding aspects (delegator to save/load docs).
-
islandora_cwrc_writer module loads files from within the CWRC-Writer library
- CWRC-Writer treated as a self-contained library with the Drupal module loading specific files from specified internal CWRC-Writer directory locations (e.g., JS, CSS, etc)
- If directories or filenames are changed then the Islandora integrated CWRC-Writer will break. Examples include
- https://github.com/cwrc/islandora_cwrc_writer/blob/master/js/README.md
- https://github.com/cwrc/islandora_cwrc_writer/blob/master/islandora_cwrc_writer.module#L12
- https://github.com/cwrc/islandora_cwrc_writer/blob/master/includes/utilities.inc#L164-L165
- https://github.com/cwrc/islandora_cwrc_writer/blob/master/includes/utilities.inc#L1091-L1097
- https://github.com/cwrc/islandora_cwrc_writer/blob/master/islandora_cwrc_writer.install#L17
- https://github.com/cwrc/islandora_cwrc_writer/blob/master/islandora_cwrc_writer.module#L274
- list may not be exhustive - untested
-
Config parameters passed to CWRC-Writer
- CWRC-GitWriter example: https://github.com/cwrc/CWRC-GitWriter/blob/master/src/js/config.js
- set in islandora_cwrc_writer module by
Islandora-CWRC-Writer/includes/utilities.inc
Lines 1088 to 1131 in 33c1209
- and passed to CWRC-Writer by
- set in islandora_cwrc_writer module by
- CWRC-GitWriter example: https://github.com/cwrc/CWRC-GitWriter/blob/master/src/js/config.js
-
Instantiate CWRC-Writer within the Drupal page
Islandora-CWRC-Writer/js/islandora_cwrc_writer.js
Lines 233 to 271 in 33c1209
-
Load and save the document
Islandora-CWRC-Writer/js/islandora_cwrc_writer.js
Lines 114 to 171 in 33c1209
CWRC-Writer depends on a number of Java Servlets to be functional.
Follow the instructions on the page, but also rename the generated war to validator.war. In most cases your tomcat should exist here /usr/local/fedora/tomcat.
We make the assumption that we (reverse) proxy VIAF, to fix the same-origin issue.
For Apache, with Drupal running on the same box as Apache, a couple lines like:
ProxyPass /viaf http://www.viaf.org/viaf
ProxyPassReverse /viaf http://www.viaf.org/viaf
To be able to validate documents, we require that the validator.war is deployed to your tomcat directory, and that you set up a (reverse) proxy so that the CWRC-Writer can communicate with it.
ProxyPass /cwrc/services/validator/ http://localhost:8080/validator/
ProxyPassReverse /cwrc/services/validator/ http://localhost:8080/validator/
To be able to access Geonames service you must set up a proxy with authentication:
<Location /geonames>
RequestHeader set Authorization "Basic XXXXX"
ProxyPass http://apps.testing.cwrc.ca/cwrc-mtp/geonames/
ProxyPassReverse http://apps.testing.cwrc.ca/cwrc-mtp/geonames/
</Location>
You'll need permission / authentication credentials from the CWRC organization. You can generation the credentials (replaces the XXXXX portion above) like so:
echo -n "username:password" | base64
In addition you must also enable mod_headers for the authentication credentials to be passed on to the CWRC Geonames service. With apache2 on Ubuntu this can be done like so:
sudo a2enmod headers
sudo service apache2 restart
Having problems or solved a problem? Contact discoverygarden.
Current maintainers:
If you would like to contribute to this module, please check out our helpful Documentation for Developers info, Developers section on Islandora.ca and contact discoverygarden.