Configuration¶
Configuration variables for defining invenio-sip2.
SIP2_DATASTORE_HANDLER | datastore, default: Sip2RedisDatastore |
SIP2_DATASTORE_REDIS_PREFIX | Prefix for redis keys, default sip2 |
SIP2_DATASTORE_REDIS_URL | Redis Datastore URL |
SIP2_MESSAGE_ACTIONS | Dictionary of all selfcheck actions. |
SIP2_REMOTE_ACTION_HANDLERS | Dictionary of remote action handlers. See example below. |
SIP2_MESSAGE_TYPES | Define all message types conforming to SIP2 protocol. |
SIP2_FIXED_FIELD_DEFINITION | All fixed field available. |
SIP2_VARIABLE_FIELD_DEFINITION | All variable field available. |
Datastore handlers¶
Use SIP2_DATASTORE_HANDLER to define your custom datastore.
- Provided datastore by invenio-sip2 is:
class: invenio_sip2.datastore:Sip2RedisDatastore
Remote action handlers¶
Handlers allow customizing endpoints for each selfcheck actions.
Each custom handler actions must be defined in the SIP2_ACTIONS_HANDLERS
dictionary, where the keys are the application names and the values the
configuration parameters for the application.
SIP2_REMOTE_ACTION_HANDLERS = dict(
myapp=dict(
# configuration values for myapp ...
),
)
The application name is used to start invenio-sip2 server and call customized handlers.
Configuration of a single remote application is a dictionary with the following keys:
login_handler
- Import path to login selfcheck callback handler.logout_handler
- Import path to logout selfcheck callback handler.system_status_handler
- Import path to automated system status callback- handler.
patron_handlers
- A dictionary of import path to patron callback handler.validate_patron
- Import path to validate patron callback handler.authorize_patron
- Import path to authorize patron callback handler.enable_patron
- Import path to enable patron callback handler.patron_status
- Import path to patron status callback handler.account
- Import path to retrieve patron account callback handler.
item_handlers
- A dictionary of import path to item callback handler.item
- Import path to retrieve item callback handler.
circulation_handlers
- A dictionary of import path to circulation- callback handler.
-
checkout
- Import path to checkout item callback handler. -checkin
- Import path to checkin item callback handler. -hold
- Import path to hold item callback handler. -renew
- Import path to renew item callback handler. -renew_all
- Import path to renew_all items callback handler.
fee_paid_handler
- Import path to fee paid callback handler.``
SIP2_REMOTE_ACTION_HANDLERS = dict(
app=dict(
login_handler="...",
logout_handler="...",
system_status_handler="...",
patron_handlers=dict(
validate_patron="...",
authorize_patron="...",
enable_patron="...",
patron_status="...",
account="...",
),
item_handlers=dict(
item="..."
),
circulation_handlers=dict(
checkout="...",
checkin="...",
hold="...",
renew="...",
),
fee_paid_handler="...",
)
)
-
invenio_sip2.config.
BABEL_DEFAULT_LANGUAGE
= 'en'¶ Default language
-
invenio_sip2.config.
SIP2_CIRCULATION_DATE_FORMAT
= '%Y%m%d %H%M%S'¶ SIP2 date format for circulation.
-
invenio_sip2.config.
SIP2_DATE_FORMAT
= '%Y%m%d %H%M%S'¶ SIP2 date format for transaction.
-
invenio_sip2.config.
SIP2_DEFAULT_LANGUAGE
= 'en'¶ Default SIP2 language
-
invenio_sip2.config.
SIP2_DEFAULT_SECURITY_MARKER
= '00'¶ SIP2 default security marker type.
-
invenio_sip2.config.
SIP2_ERROR_DETECTION
= True¶ Enable error detection on message.
-
invenio_sip2.config.
SIP2_LINE_TERMINATOR
= '\r'¶ Message line separator.
-
invenio_sip2.config.
SIP2_LOGGING_CONSOLE
= True¶ Enable logging to the console.
-
invenio_sip2.config.
SIP2_LOGGING_CONSOLE_LEVEL
= 'INFO'¶ Console logging level.
All requests and responses will be written to the console if the level is on info mode. Otherwise, they will not logged.
-
invenio_sip2.config.
SIP2_LOGGING_FS_BACKUPCOUNT
= 5¶ Number of rotated log files to keep.
-
invenio_sip2.config.
SIP2_LOGGING_FS_LEVEL
= 'INFO'¶ Console logging level.
Defaults to write all requests and responses.
-
invenio_sip2.config.
SIP2_LOGGING_FS_LOGFILE
= None¶ Enable logging to the filesystem.
A valid filesystem path is required to enable logging.
-
invenio_sip2.config.
SIP2_LOGGING_FS_MAXBYTES
= 104857600¶ Maximum size of logging file. Default: 100MB.
-
invenio_sip2.config.
SIP2_PERMISSIONS_FACTORY
(action)¶ Define factory permissions.
-
invenio_sip2.config.
SIP2_PROTOCOL
= '2.00'¶ SIP2 protocol version.
-
invenio_sip2.config.
SIP2_REMOTE_ACTION_HANDLERS
= {}¶ Configuration of remote handlers.
-
invenio_sip2.config.
SIP2_RETRIES_ALLOWED
= 10¶ Number of retries allowed.
-
invenio_sip2.config.
SIP2_SOCKET_BUFFER_SIZE
= '1024'¶ Socket buffer size.
-
invenio_sip2.config.
SIP2_SUPPORT_CHECKIN
= True¶ Support check in items.
-
invenio_sip2.config.
SIP2_SUPPORT_CHECKOUT
= True¶ Support check out items.
-
invenio_sip2.config.
SIP2_SUPPORT_OFFLINE_STATUS
= True¶ Support off line operation.
-
invenio_sip2.config.
SIP2_SUPPORT_ONLINE_STATUS
= True¶ Support online status send by automatic circulation system.
-
invenio_sip2.config.
SIP2_SUPPORT_RENEWAL_POLICY
= True¶ Support patron renewal requests as a policy.
-
invenio_sip2.config.
SIP2_SUPPORT_STATUS_UPDATE
= True¶ Support patron status updating by the selfcheck.
-
invenio_sip2.config.
SIP2_TEXT_ENCODING
= 'UTF-8'¶ Message text charset encoding.
-
invenio_sip2.config.
SIP2_TIMEOUT_PERIOD
= 10¶ Server timeout.