This application emulates most of the ALMA provider behavior, used in ding2 based instances.
The service is based on Symfony2-framework, so some special setup is required when deploying this application.
By default, the application contains a SQL dump with a single user, couple of reservations, loans and debts.
Example instance located at (http://dummy-alma.inlead.dk/web/).
Test users (login/pass): 3206596642/12345 3207795592/12345
-
Clone this repository;
-
Copy the
app/config/parameters.yml.dist
file toapp/config/parameters.yml
; -
Edit this file according to your settings.
Normally, only database specific settings are required;
-
Edit the
web/reset.php
file if reseting service data to it's initial state is planned to be used (useful for unit-testing); -
Create a virtual host, pointing to repository root(!) - not
web
directory; -
Being in the app root, run this command:
php app/console cache:clear -e prod
This will clear the cache and make the app accessible in the web;
-
Make sure
app/cache
andapp/logs
directories have write permissions for all (i.e.chmod -R 777
); -
Create the database, with the name provided in the config in steps (2) and (4).
Import the data dump located in src/Provider/AlmaBundle/dummy_alma.sql
- Access the
http://HOST_NAME/web
.
There should be initial page with all supported requests and examples of usage.
Same url is used when setting the provider url in ding2tal instance;
- To reset the database state, ie. restore the data to it's initial state, run
http://HOST_NAME/web/reset.php
.
The script returns nothing. It just imports the dump again into the database.
This is safe to be called via curl
or file_get_contents()
.
-
Renewing loans is not supported, for now.
-
When reserving a periodical, the reservations list (in ding2 user profile page) will show
Title not available
as item title.
This happens because ALMA has it's own internal mechanism of relating items to reservations, this cannot be normally achieved.
-
Item availability is returned always as available (TRUE).
-
Item details (holdings) are hard-cached. Each item has it's own pre-defined XML response located in the
src/Provider/AlmaBundle/Resources/alma_xml
directory.
Each file name is ITEM_LOCAL_ID.xml
.
To add a new entry there follow the http://ALMA_PROVIDER_URL:PORT/alma/catalogue/detail?catalogueRecordKey=ITEM_LOCAL_ID
URL in your browser, copy the XML response and create a XML file with those contents in the path described above.
Important: Do not copy the contents directly from browser window (this output cannot be parsed by SimpleXml). Instead, see the generated markup of the page and copy it's contents into the destination file.
For items that do not have this pre-defined response, the service will return that an item with this ID was not found.