Skip to content

Commit

Permalink
Merge branch 'master' into release-2.5
Browse files Browse the repository at this point in the history
Conflicts:
	common/src/main/java/digilib/conf/DigilibConfiguration.java
	webapp/src/main/webapp/jquery/jquery.digilib.js
  • Loading branch information
robcast committed Nov 23, 2017
2 parents 0937ccf + 9b4d666 commit 9028a52
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 83 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A versatile image viewing environment for the internet.

`digilib` documentation can be found on the
[digilib documentation pages](https://robcast.github.io/digilib/) on GitHub
or on [SourceForge](http://digilib.sourceforge.net).
or on [SourceForge](https://sourceforge.net/projects/digilib/).

## How do I run digilib?

Expand Down
60 changes: 58 additions & 2 deletions doc/src/site/markdown/build-maven.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,66 @@ http://localhost:8080/digilib/server/dlConfig.jsp

## Additional Maven build options

Some build options have to be activated as Maven profiles with the `-P` command line option
when building digilib. For example, to build digilib with the Manifester servlet ("iiif-presentation")
use:

mvn -Piiif-presentation package

You can add multiple profiles at the same time if necessary.


### servlet2

Digilib uses the Asynchronous Servlet API (3.0) by default. You will need Java version 6 or later
and Tomcat version 7 or Jetty version 8 or later to use it.
If you want to use the old non-Asynchronous Servlet API (2.3) add `-Pservlet2`
to the Maven command line above.

`-Pservlet2` builds a servlet with the the old non-Asynchronous Servlet API (2.3).

This creates a WAR file with the postfix "-srv2".
The build process uses the file `webapp/src/main/webapp/WEB-INF/web-2.4.xml` as `web.xml` file.

### servlet3

`-Pservlet3` builds digillib with the Asynchronous Servlet API (3.0). This is the default profile, it will be used
if you do not specify any profile.

This creates a WAR file with the postfix "-srv3".
The build process uses the file `webapp/src/main/webapp/WEB-INF/web-3.0.xml` as `web.xml` file.

### iiif-presentation

`-Piiif-presentation` builds digilib with the "Manifester" servlet for IIIF Presentation API support
(see [digilib IIIF support documentation](iiif-api.html)).

This creates a WAR file with the postfix "-srv3p".
The build process uses the file `webapp/src/main/webapp/WEB-INF/web-iiif-pres.xml` as `web.xml` file.

### text

`-Ptext` builds digilib with the "Texter" servlet to download plain text or XML files
(see [the source](https://github.com/robcast/digilib/tree/master/text)). You have
to add `-Pservlet3` or `-Pservlet2` as well.

You also have to copy the mapping for the "Texter" servlet from `web-additional.xml` into the `web.xml` file
used by the selected servlet API like `web-3.0.xml`.

### pdf

`-Ppdf` builds digilib with the "PDFCache" servlet to generate and download PDF files from images.
(see [the source](https://github.com/robcast/digilib/tree/master/pdf)).

You also have to copy the mapping for the "PDFCache" servlet from `web-additional.xml` into the `web.xml` file
used by the selected servlet API like `web-3.0.xml`.

## create-sprites

`-Pcreate-sprites` re-creates the image sprite file (`webapp/src/main/webapp/jquery/img/dl-buttons-full-32-sprite.png`)
from the separate icon image files. This option only needs to be used if you are a developer and you want to
change the icon images.

## running tests

`-DskipTests=false` enables some functional tests. The tests are run as part of the normal build process.
You can also run just the tests with `mvn -DskipTests=false test`.

68 changes: 38 additions & 30 deletions doc/src/site/markdown/digilib-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If relative paths are provided as file locations, these will be resolved with
the web application's directory as base.

You can inspect a summary of your running digilib configuration at the URL
`<base_url>/server/dlConfig.jsp`.
`<base_url>/server/dlConfig.jsp` e.g. <http://localhost:8080/digilib/server/dlConfig.jsp>.

### Image locations

Expand All @@ -44,7 +44,7 @@ You can inspect a summary of your running digilib configuration at the URL
```

A list of directories where images are searched. See
[this document](image-directories.html) for details.
[this document](image-directories.html) for details (**required**).

```xml
<parameter name="denied-image" value="img/digilib-denied.png" />
Expand Down Expand Up @@ -79,7 +79,7 @@ The location of the mapping file. Refer to
[digilib-map.xml.template](https://github.com/robcast/digilib/blob/master/webapp/src/main/webapp/WEB-INF/digilib-map.xml.template)
for an example.

The file contains `mapping` elements with a `link` attribute containing a 'virtual directory' name that is mapped to the
The file contains `mapping` elements with a `link` attribute containing a 'virtual directory' name that is redirected to the
directory given in the `dir` attribute.


Expand Down Expand Up @@ -121,6 +121,13 @@ subsampling, i.e. by skipping pixels.
Details are provided in the
[documentation on authentication and authorization](auth.html).

```xml
<parameter name="use-authorization" value="false" />
```

Enables or disables all authorization. If `use-authorization` is `true` you also have to configure
`authnops-class`, `authzops-class` and the `auth-file` and its contents.

```xml
<parameter name="auth-file" value="digilib-auth.xml" />
```
Expand All @@ -146,13 +153,6 @@ The class to handle authentication.

The class to handle authorization.

```xml
<parameter name="use-authorization" value="false" />
```

Enable or disable all authorization. If `use-authorization` is `true` it also needs to be configured
using `authnops-class` and `authzops-class` and the `auth-file`.


### IIIF API options

Expand All @@ -168,13 +168,15 @@ The IIIF API version for the generated `info.json` information response.
<parameter name="iiif-info-cors" value="true" />
```

Enables the `Cross-Origin Resource Sharing` header in IIIF info requests.
Enables the [Cross-Origin Resource Sharing](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
header in IIIF info requests (`Access-Control-Allow-Origin: *`).

```xml
<parameter name="iiif-image-cors" value="true" />
```

Enables the `Cross-Origin Resource Sharing` header in IIIF image requests.
Enables the [Cross-Origin Resource Sharing](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
header in IIIF image requests (`Access-Control-Allow-Origin: *`).

```xml
<parameter name="iiif-prefix" value="IIIF" />
Expand All @@ -195,7 +197,7 @@ The character that replaces a slash in the identifier of IIIF requests.
<parameter name="max-waiting-threads" value="20" />
```

The maximum number of requests waiting in the queue before sending "service unavailable".
The maximum number of requests waiting in the queue before new requests get "service unavailable".

```xml
<parameter name="worker-threads" value="2" />
Expand All @@ -210,7 +212,7 @@ The maximum number of concurrently working threads.
Timeout for worker threads in milliseconds.


### Assorted options
### Other options

```xml
<parameter name="default-errmsg-type" value="image" />
Expand All @@ -234,39 +236,45 @@ and lead to resource issues if digilib runs for a long time.
<parameter name="log-config-file" value="log4j-config.xml" />
```

Location of the logging configuration file. The current logger is
Location of the logging configuration file. The current logging library is
[Log4J 1.2](https://logging.apache.org/log4j/1.2/manual.html).

### Options for developers

### Unknown category

**TODO** move items to appropriate sections
Using these options you can replace default classes used by digilib with your own implementations
to change the behaviour of digilib.

```xml
<parameter name="dirmeta-class" value="digilib.meta.IndexMetaDirMeta" />
<parameter name="docuimage-class" value="digilib.image.ImageLoaderDocuImage" />
```

Class for **TODO**.

Class of the `DocuImage` instance. You can replace the `digilib.image.DocuImage` implementation to use a different image
toolkit than Java ImageIO. (There are deprecated alternative implementations in the `common-jai`,
`common-imagej` and `common-bioformats` modules.)

```xml
<parameter name="docudirectory-class" value="digilib.io.BaseDirDocuDirectory" />
<parameter name="docuimage-hacks" value="" />
```

Class for **TODO**.
Text string to selectively enable specific `Hacks` in the `DocuImage` implementation
(see [the source](https://github.com/robcast/digilib/blob/master/common/src/main/java/digilib/image/ImageLoaderDocuImage.java))

```xml
<parameter name="docuimage-class" value="digilib.image.ImageLoaderDocuImage" />
<parameter name="filemeta-class" value="digilib.meta.IndexMetaFileMeta" />
<parameter name="dirmeta-class" value="digilib.meta.IndexMetaDirMeta" />
```

Class for the `DocuImage` instance, **TODO** elaborate intended use
Classes of the `digilib.meta.FileMeta` and `digilib.meta.DirMeta` implementations. You can change these implementations
to change the way digilib finds metadata about image files.

`IndexMetaFileMeta` and `IndexMetaDirMeta` read metadata from `index.meta` and `*.meta` XML files according to
the [index meta standard](http://intern.mpiwg-berlin.mpg.de/digitalhumanities/mpiwg-metadata-documentation/formate/indexmeta-standard).

```xml
<parameter name="docuimage-hacks" value="" />
<parameter name="docudirectory-class" value="digilib.io.BaseDirDocuDirectory" />
```

**TODO** elaborate
Class of the `digilib.io.DocuDirectory` implementation. You can change this implementation to change the way
digilib finds image files (including different resolutions).

```xml
<parameter name="filemeta-class" value="digilib.meta.IndexMetaFileMeta" />
```
Class for **TODO**.
24 changes: 12 additions & 12 deletions doc/src/site/markdown/install-digilib.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ later) or [Jetty](http://www.eclipse.org/jetty/) (version 8 or later)
## Start the Servlet Container

Install and run the Servlet Container of your choice:
[Tomcat](http://tomcat.apache.org/tomcat-7.0-doc/setup.html) or
[Jetty](http://wiki.eclipse.org/Jetty/Howto/Run_Jetty).
[Tomcat](http://tomcat.apache.org/) or
[Jetty](http://wiki.eclipse.org/Jetty/).

When the Servlet Container runs you should be able to access the start page on
<http://localhost:8080/>
Expand All @@ -35,7 +35,7 @@ or web application directory any time you need.
Also you get the chance to always use the latest digilib version by updating the source code.

You can also download a digilib WAR file with a default configuration from the
[SourceForge download page](https://sourceforge.net/projects/digilib/files/)
[GitHub release page](https://github.com/robcast/digilib/releases)
or the latest digilib build from the
[daily build page](https://it-dev.mpiwg-berlin.mpg.de/downloads/digilib/daily-build/).
The default configuration will only show a set of sample images. If you want to show your own images
Expand All @@ -47,12 +47,12 @@ you will need to change the [digilib configuration](digilib-config.html) to poin
1. Get a digilib WAR file.
2. Rename the WAR file to `digilib.war`.
3. Deploy the WAR file by copying it into the `webapps` directory of your
Servlet Container.
Servlet Container.
4. Restart your Servlet Container (this may not be necessary).
5. Access your digilib instance at <http://localhost:8080/digilib/digilib.html>.

You will now be able to see the sample images provided with the digilib
installation in the default configuration yor your own images
installation in the default configuration or your own images
if you have updated the [configuration](digilib-config.html).

In digilib you can view images by providing the directory and file
Expand All @@ -68,14 +68,14 @@ Read more about the layout of image files and directories
## Install digilib as a web application directory

1. Get a digilib web application directory.
2. Rename the WAR file to `digilib.war`.
3. Deploy the WAR file by copying it into the `webapps` directory of your
Servlet Container.
2. Rename the directory to `digilib`.
3. Deploy the directory by copying it into the `webapps` directory of your
Servlet Container.
4. Restart your Servlet Container (this may not be necessary).
5. Access your digilib instance at <http://localhost:8080/digilib/digilib.html>

You will now be able to see the sample images provided with the digilib
installation in the default configuration yor your own images
installation in the default configuration or your own images
if you have updated the [configuration](digilib-config.html).

In digilib you can view images by providing the directory and file
Expand All @@ -98,6 +98,6 @@ Container (when its not running) to see if it created an unpacked web
application directory called `digilib`. Then:

1. Make sure that your Servlet Container is not running and remove any
`digilib.war` files from the `webapps` directory.
2. Copy your `digilib` directory into the `webapps` directory of the
Servlet Container.
`digilib.war` files from the `webapps` directory.
2. Keep the `digilib` directory in the `webapps` directory of the
Servlet Container.
2 changes: 1 addition & 1 deletion iiif-presentation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0</version>
<version>1.0.4</version>
</dependency>
</dependencies>
</project>
11 changes: 11 additions & 0 deletions servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,20 @@
<scope>provided</scope>
</dependency>
<dependency>
<!-- implementation of JWT JOSE specification -->
<groupId>org.bitbucket.b_c</groupId>
<artifactId>jose4j</artifactId>
<version>0.5.0</version>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0.4</version>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit 9028a52

Please sign in to comment.