sul-dlss/swap

Name: swap

Owner: Stanford University Digital Library

Description: Java application to query and access archived web material -- the code for the Stanford Web Archiving Portal (SWAP). Overlay of iipc/openwayback.

Created: 2017-02-01 19:01:30.0

Updated: 2017-09-24 12:45:11.0

Pushed: 2017-08-16 18:16:22.0

Homepage: null

Size: 1808

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Stanford Web Archiving Portal (SWAP)

Build Status Coverage Status Latest GitHub tagged version

Java application to query and access archived web material. This is the code for the Stanford Web Archiving Portal (SWAP).

Stanford University Libraries overlay of iipc/openwayback. (See IIPC wiki [Creating a WAR overlay] https://github.com/iipc/openwayback/wiki/Creating-a-WAR-overlay.) There are a small number of local modifications to the upstream code:

Rough list of Stanford changes (see also sul-dlss/openwayback):

devopsy:

For more documentation on this code, see the OpenWayback wiki.

Deployment

Deployment is via deployment artifacts created at jenkinsqa. These artifacts are deployed to:

Development

The code is organized in the same way as IIPC openwayback: The top directory holds the maven build for all the modules represented by subdirectories.

Build

You can build all the code using maven from the top directory.

clean install

You can also run maven builds for individual steps from within their subdirectory.

Run Tests

You can run tests the usual way with maven:

test -B

You can create a coverage report:

test jacoco:report

See also .travis.yml

Subdirectories:
upstream-wayback-core

In order to create the final swap war file to deploy to a remote VM, we must ensure the java class loader won't have to choose between two versions of a class.

We do this by REMOVING from the upstream IIPC wayback-core jar any class present in swap wayback-core code.

pstream-wayback-core
clean install

creates a jar file upstream-wayback-core/target/openwayback-core-modified-[version].jar identical to the IIPC openwayback-core jar, but without the Stanford modified classes in wayback-core. It also installs said jar in the local maven repository (in ~/.m2/repository) so it can be used by other modules, such as wayback-core.

When making changes to wayback-core, be sure to update assembly/distribution.xml

We must specify which classes to remove from the IIPC openwayback-core-modified.jar file by adding them to the exclude list in upstream-wayback-core/assembly/distribution.xml:

embly>

ileSets>
<fileSet>
  ...
  <excludes>
    <exclude>**/ArchivalUrlSAXRewriteReplayRenderer.class</exclude>
    <exclude>**/ToolBarData.class</exclude>
  </excludes>
  ...

This is how the maven-assembly-plugin will know what to exclude from upstream-wayback-core/target/openwayback-core-modified-[version].jar

wayback-core

This contains only those classes with Stanford modifications, and any additional classes needed for testing. The maven build

ayback-core
clean install

creates a jar file: wayback-core/target/swap-wayback-core-[version].jar which only contains our locally modified classes.

There may be some WARNING messages from maven; these can be ignored. ERROR messages would be a problem.

When making changes to wayback-core files, be sure to update upstream-wayback-core/assembly/distribution.xml

We must specify which classes to remove from the IIPC openwayback-core-modified.jar file by adding them to the exclude list in upstream-wayback-core/assembly/distribution.xml. See above (under upstream-wayback-core).

wayback-webapp

This contains only those files with Stanford modifications; we build a war file using the WAR overlay approach (see https://github.com/iipc/openwayback/wiki/Creating-a-WAR-overlay and https://maven.apache.org/plugins/maven-war-plugin/overlays.html).

As with IIPC openwayback, maven builds a war file.

ayback-webapp
clean war:war  # actual goal, executed as part of package
clean install  # installs it in local repo for sibling builds to find

creates a war file in wayback-webapp/target/swap-[version].war. This contains Stanford's modified webapp files and all additional upstream dependencies for the war file EXCEPT for wayback-core files. We must add the wayback-core files in ourselves to get our local modifications.

To make changes to wayback-webapp …

FIXME: blah blah

wayback-cdx-server

Stanford puppet deploys the cdx-server war file, so this is a way for our maven build to create one. (TODO: possibly just download the artifact from a maven repo?).

ayback-cdx-server
clean package

creates a jar file wayback-cdx-server/target/openwaybck-cdx-server-[version].war which can be deployed by puppet. Currently we do this via a jenkins build. (FIXME: add details about jenkins)

dist or top level build or … FIXME:

FIXME: blah blah

ist
clean dependency:unpack assembly:single

takes the war file from wayback-webapp/target/swap-[version].war and adds in wayback-core/target/swap-wayback-core-[version].jar and openwayback-core/target/openwayback-core-modified-[version].jar. This war file is a deployable artifact that contains Stanford modifications to the upstream IIPC openwayback code.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.