Added LOCKSS-o-matic stubs

refs #5425

Added a Space class for the LOCKSS-o-matic.  Functionality relating
to LOM on the changes to the METS file are stubs, since those
requirements not yet decided on.

Updated store AIP and download file functions to work with LOM, and
added a stub callback function for when LOM is done storing the file.
Added a new status for a package for when it is on the Storage Server,
but not yet in LOM.

Split chunks of an AIP are found at <aip_uuid>/download/<chunk_number>/
LOCKSS Space can parse service document

Add function to fetch and parse a service document, update the au_size and
collection_iri.

Added dependency on sword2 client library. Github version is newer and more
featureful than the version on PyPI. Install dependency from github.
Add common NSMAP

Add a common namespace map for use when working with METS and XML.
Update existing lxml code to use it. Add ipython as a development
dependency.
Create AtoM entry for AIP

refs #6009

Create the AtoM entry with the title, ID, agent, and description of the
AIP. Title, agent and description parsed from the METS file Dublin Core
title, description and an 'organization' agent.  Extract state IRI for
polling LOCKSS-o-matic from the deposit receipt.
Update LOCKSS-o-matic service doc and resource creation

refs #6009

Update LOCKSS handling of service document and atom entries to create
resources to match API changes.

Add checksumType parsing to service document.  Resource creation uses
lom:content tags, add checksum and checksum type to content tags.

Code moved to LOCKSS Space from Package, since it deals more with
Space-specific problems than Package.
LOCKSS WIP - edit & state IRI

refs #5425

Properly parse the edit and state IRIs from the deposit receipt.  Add sword
and Lockss-o-matic related namespaces to the namespace map.  Start on
polling for state, comments and logs where work needed.
Initial LOCKSS tests

Add pytest and pytest-django as testing dependencies.  Add testing fixtures
- initial data needed for everything, and a lockss-o-matic specific one.
Start on adding tests; currently only work if the modified simple sword
server is running.
Update for LOM changes

refs #5425

Update namespace for LOM, and make common.utils the only place it is
defined.  Add content provider ID, input by the user, and used to identify
the SS to LOM.
File splitting for LOCKSS uses tar

refS #5425

Splitting the file into chunks of no more than au_size uses tar instead of
split.  A tar file has headers and stores some of its own metadata, making
it a safer choice.
Update Lockssomatic to use new infrastructure

refs #5425

Update Lockssomatic to use (post) move to/from storage service.  Removed
now duplicate _store_aip_lom.  Store AIP calls post move functions.
Sizes to/from LOM are in kB

refs #5425

maxUploadSize in the service document, and lom:content size in the atom
entry are both in kilobytes, while all internal sizes are stored in bytes.
Add unit conversion.  Outgoing size rounded up.
Save State & Edit IRI in Packages.misc

refs #5425

Save state & edit IRI from deposit receipt into the misc attributes field
of Packages.
Add package Update Status button for LOCKSS

refs #5425

Add button to check the status of a Package.  Calls update_package_status
in Lockssomatic Space, which queries the state IRI and sets it to success if
all the server states are 'agreement'.
Update pointer file for entry creation

refs #5425

Update structMap and fileGrp, for when a package is split or unsplit.  Add
event and SS agent when the file is split.

Add helper function for writing PREMIS events and agents.  Update structMap
and fileGrp of pointer file with information on chunks.

Add version.py for tracking storage service version and providing string
display of it.
Update pointer file with LOCKSS URLs

refs #5425

Query the state_iri for this package and parse it for the server states. If
all are in agreement, add those URLs to the pointer file for each LOCKSS
chunk.  Works for both split and unsplit packages.

Factor out generation of download URL, as that is the ID of lom:content
elements in the SWORD statement.
Minor fixes

refs #5425

Misc minor fixes: update_package_status idempotent (removes LOCKSS URLs
before adding new ones), download path returns correct URL for tar changes,
checksum name is always uppercase, others.
Update pointer file - delete local copy

refs #5425

Delete LOCKSS chunks once AIP is safely stored, and remove their local URLs
from the pointer file.  If configured, delete local copy of AIP and update
pointer file: add deletion event, remove local URLs, etc.  Ensure that
multiple delete events not added if update status called repeatedly.
Download URL is absolute

refs #5425

Require the externally available URL to be configured for LOM Spaces, as
programatically determining the IP is unreliable.  Download URLs provided
to Lockss-o-matic prepend this to the relative path.

Service Document IRI converted to URLField to ensure it is a valid URL.
Collection IRI left as CharField, as it is read from the SD, and any
validation error would probably get buried.
Update LOM to stop harvesting before deleting files

refs #5425

Require LOM to be updated to stop harvesting before deleting local
copies of files.  If updating the package status fails, return an error
string to display.  Refactor code relating to delete files into its own
function.
Update package status will re-post to LOM

refs #5425

Updating package status will re-submit the atom entry to LOM, if the
first entry failed. post_move_from_storage_service updated to be
idempotent, including all the functions it calls.

Refactored split_package to include all modifications to the pointer
file, and create_resource to only create the atom entry.  split_package
will return the output files if a split has already been performed.

Generate checksum moved to utils.  Parsed pointer file for current
Package made an attribute of Lockssomatic, populated on demand, so it
is easier for functions to reuse it.