Copyright (C) 2017-2023 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.
- Introduction
- Compiling
- Running the module locally
- Testing the module
- Docker/Deploying the module
- API documentation
- Internationalization
- Code analysis
- Issue tracking
- Download and configuration
This module provides calendar functionalities for FOLIO systems, allowing service points to maintain hours of operation.
To compile, simply run:
mvn install
Note: you will need Docker installed and running, for the integration tests that Maven runs as part
of the installation. If you wish to skip this, add -DskipTests
to the command.
To run the module locally, you can create a JAR with:
mvn package
Once the module has been packaged into a JAR, you can run it on the command line (with the appropriate environment variables):
java -jar target/mod-calendar-*.jar
For developers with VS Code, a launch.json
is provided which allows the
built-in run features to launch and debug the module within the IDE.
To test the module locally, you can run the test
Maven command:
mvn clean test jacoco:report
To do this, you must be running Docker. For more information, see the test docs.
Please see the install docs for information on building a docker container and registering it with/deploying it to Okapi.
See the built target/ModuleDescriptor.json
or the template
descriptors/ModuleDescriptor-template.json
for the interfaces that this module requires and
provides, the permissions, and the additional module metadata. An explanation of the contents of
this file may be found in the build process document.
When deploying to a module through Okapi, the following parameters are available:
Name | Default Value | Description |
---|---|---|
loadReference | "false" |
Does not do anything, however, is supported per the Okapi specification |
loadSample | "false" |
If "true" , a series of sample calendars will be added representing examples of exceptions and openings across multiple calendars and service points. This will use the same service points loaded by mod-inventory-storage. |
See .env.sample
for example values.
Name | Default Value | Description |
---|---|---|
JAVA_OPTIONS | XX:MaxRAMPercentage=66.0 |
Sets java command-line options. Default is to set the maximum ram percentage to 66% |
DB_HOST | localhost |
Postgres hostname |
DB_PORT | 5432 |
Postgres port |
DB_USERNAME | folio_admin |
Postgres username |
DB_PASSWORD | folio_admin |
Postgres password |
DB_DATABASE | okapi_modules |
Postgres database name |
Integration tests have special environment variables that control whether or not API requests are routed through a proxy. A proxy can be helpful for debugging all of the API requests associated with integration tests, providing a separate GUI interface that may provide more details.
Name | Default Value | Description |
---|---|---|
PROXY_ENABLE | false |
If requests should be proxied (true or false only) |
PROXY_SCHEME | http |
The protocol to use for a proxy |
PROXY_HOST | localhost |
The host to proxy through |
PROXY_PORT | 8888 |
The port on PROXY_HOST to proxy through |
Additionally, if PROXY_ENABLE
is true
, additional logging-only requests will be sent to a few
endpoints:
GET /_/tests/_/database-truncate
every time the database is truncated (after most modifying integration tests methods/classes)GET /_/tests/class/method
before every test beginsGET /_/tests/_/finish
after every test finishes (successful or otherwise)
These endpoints do not exist (and will correspondingly generate 404
errors), however, will appear
in any proxy logs, making it easy to isolate each test/action.
This module's API documentation.
This module is locale-aware, based on the Accept-Language
header. Translations are stored in the
translations folder.
See MODCAL in the FOLIO issue tracker.
The built artifacts for this module are available. See configuration for repository access, and the Docker image.