No description, website, or topics provided.
Java RAML Shell Other
marcjohnson-kint Merge pull request #128 from folio-org/MODINVSTOR-26-fix-version-number
Update implementation version following MODINVSTOR-26
Latest commit ab24269 Jul 17, 2018
Permalink
Failed to load latest commit information.
database-setup Move inventory storage into new repository May 1, 2017
descriptors Update News, ModuleDesriptor, instance-storage version Jul 16, 2018
docker Move inventory storage into new repository May 1, 2017
environment Move inventory storage into new repository May 1, 2017
okapi-registration/managed-deployment No longer need to define module ID separately during un-registration Jan 3, 2018
okapi-setup Move inventory storage into new repository May 1, 2017
ramls Update News, ModuleDesriptor, instance-storage version Jul 16, 2018
reference-data Sync location reference data with folio-ansible. Jun 29, 2018
sample-data Correct contributorTypeId for sample data. Jul 12, 2018
scripts Ensure bash 4+ Apr 12, 2018
src Replace wrong HTTP status name HTTP_ACCEPTED by correct value 200 Jul 16, 2018
.editorconfig Re-introduce * editor config after removing during specific python de… Jan 3, 2018
.eslintrc Move inventory storage into new repository May 1, 2017
.gitignore MODINVSTOR-120: Drop src/main/**/client/ from .gitignore (target/gene… May 18, 2018
.gitmodules Move raml-util to ramls/raml-util RMB-30 Oct 3, 2017
CONTRIBUTING.md Fix dev URLs FOLIO-1179 Apr 16, 2018
CONTRIBUTORS.md Move inventory storage into new repository May 1, 2017
Dockerfile switch to fabric8-based docker base image Dec 19, 2017
Jenkinsfile switch to new pipeline libs Nov 17, 2017
LICENSE Move inventory storage into new repository May 1, 2017
NEWS.md Update implementation version following MODINVSTOR-26 Jul 17, 2018
README.MD Fix dev URLs FOLIO-1179 Apr 16, 2018
build-ci.sh Move inventory storage into new repository May 1, 2017
build.sh Change admin role name and dataabase name to reflect change in module… Oct 3, 2017
clean.sh compile to generate code from RAML during clean Dec 20, 2017
create-okapi-database.sh Move inventory storage into new repository May 1, 2017
create-tenant.sh Move inventory storage into new repository May 1, 2017
delete-sample-data.sh Add script to delete sample data MODINVSTOR-57 Feb 13, 2018
delete-tenant.sh Move inventory storage into new repository May 1, 2017
demo-postgres-conf.json Change admin role name and dataabase name to reflect change in module… Oct 3, 2017
destroy-demo-and-test-dbs.sh Add single script to delete demo and test databases May 8, 2017
destroy-demo-db.sh Change admin role name and dataabase name to reflect change in module… Oct 3, 2017
destroy-test-db.sh Change admin role name and dataabase name to reflect change in module… Oct 3, 2017
external-test-postgres-conf.json Change admin role name and dataabase name to reflect change in module… Oct 3, 2017
import-reference-data.sh Separate reference and sample records MODINVSTOR-57 Feb 13, 2018
import-sample-data.sh Move inventory storage into new repository May 1, 2017
pom.xml Update implementation version following MODINVSTOR-26 Jul 17, 2018
quick-test.sh Clean prior to running quick tests Dec 5, 2017
register-managed.sh Only use artefact version during start managed demo script Oct 22, 2017
reset-db.sh Add script to reset test and demo databases Oct 19, 2017
setup-demo-db.sh Change admin role name and dataabase name to reflect change in module… Oct 3, 2017
setup-test-db.sh Change admin role name and dataabase name to reflect change in module… Oct 3, 2017
start-managed-demo.sh Use generated Descriptors FOLIO-701 Oct 3, 2017
start-okapi.sh Move inventory storage into new repository May 1, 2017
stop-managed-demo.sh No longer delete tenant when un-registering managed module instance Jan 3, 2018
unregister-managed.sh No longer need to define module ID separately during un-registration Jan 3, 2018

README.MD

mod-inventory-storage

Copyright (C) 2016-2018 The Open Library Foundation

This software is distributed under the terms of the Apache License, Version 2.0. See the file "LICENSE" for more information.

Goal

FOLIO compatible inventory storage module.

Provides PostgreSQL based storage to complement the inventory module. Written in Java, using the raml-module-builder and uses Maven as its build system.

Prerequisites

  • Java 8 JDK
  • Maven 3.3.9
  • Postgres 9.6.1 (running and listening on localhost:5432, logged in user must have admin rights)
  • Node 6.4.0 (for API linting and documentation generation)
  • NPM 3.10.3 (for API linting and documentation generation)
  • Python 3.6.0 (for un-registering module during managed deployment scripts)

Preparation

Git Submodules

There are some common RAML definitions that are shared between FOLIO projects via Git submodules.

To initialise these please run git submodule init && git submodule update in the root directory.

If these are not initialised, the module will fail to build correctly, and other operations may also fail.

More information is available on the developer site.

Postgres

Run the setup-test-db.sh script in the root directory to setup Postgres with a database to be used in tests. This is only required to run tests against an external Postgres instance, the default is to use an embedded Postgres instance.

Building

run mvn install from the root directory.

To run the tests against both embedded and external databases, run ./build.sh from the root directory.

Running

Preparation

Running Okapi

Make sure that Okapi is running on its default port of 9130 (see the guide for instructions).

A script for building and running Okapi is provided. Run ../mod-inventory-storage/start-okapi.sh from the root of the Okapi source.

As this runs Okapi using Postgres storage, some database preparation is required. This can be achieved by running ./create-okapi-database.sh from the root of this repository.

Registration

To register the module with deployment instructions and activate it for a demo tenant, run ./start-managed-demo.sh from the root directory.

To deactivate and unregister the module, run ./stop-managed-demo.sh from the root directory.

Sample Data

Importing/ingesting of sample data is done via Okapi, so modules must be registered prior to importing.

To load some sample data run ./import-sample-data.sh from the root directory.

Making Requests

These modules provide HTTP based APIs rather than any UI themselves.

As FOLIO is a multi-tenant system, many of the requests made to these modules are tenant aware (via the X-Okapi-Tenant header), which means most requests need to be made via a system which understands these headers (e.g. another module or UI built using Stripes).

Therefore, it is suggested that requests to the API are made via tools such as curl or postman, or via a browser plugin for adding headers, such as Requestly.

Okapi Root Address

It is recommended that the modules are located via Okapi. Access via Okapi requires passing the X-Okapi-Tenant header (see the Okapi guide above for details).

http://localhost:9130/instance-storage http://localhost:9130/item-storage

Operating System Support

Most of the development for these modules, thus far, has been performed on OS X, with some on Ubuntu. Feedback for these, and particularly other operating systems is very welcome.

Additional Information

The guide and other documentation for this module.

Other modules.

See project MODINVSTOR at the FOLIO issue tracker.

Other FOLIO Developer documentation is at dev.folio.org

Appendix 1 - Docker Information

When Using the Modules as Docker Containers

For the modules to communicate via Okapi Proxy, when running in Docker containers, the address for Okapi Proxy needs to be routable from inside the container.

This can be achieved by passing a parameter to the script used to start Okapi, as follows ../mod-metadata/start-okapi.sh http://192.168.X.X:9130

Where 192.168.X.X is a routable IP address for the host from container instances and both repository clones are at the same directory level on your machine.

Finding a Routable Address

Finding the appropriate IP address can be OS and Docker implementation dependent, so this is a very early guide rather than thorough treatment of the topic.

If these methods don't work for you, please do get in touch, so this section can be improved.

On Linux, ifconfig docker0 | grep 'inet addr:' should give output similar to inet addr:192.168.X.X Bcast:0.0.0.0 Mask:255.255.0.0, , the first IP address is usually routable from within containers.

On Mac OS X (using Docker Native), ifconfig en0 | grep 'inet ' should give output similar to inet 192.168.X.X netmask 0xffffff00 broadcast 192.168.X.X, the first IP address is usually routable from within containers.