After downloading and unpacking, the Jetty configuration must be adjusted so that the application is only accessible on localhost. To do this, ensure in the configuration file /opt/digiverso/basex/webapp/WEB-INF/jetty.xml that the host is set to 127.0.0.1 and the port to 8984:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- Default connector. The Jetty stop port can be specified
in the .basex or pom.xml configuration file. -->
<Call name="addConnector">
<Arg>
<New id="httpConnector" class="org.eclipse.jetty.server.ServerConnector">
<Arg name="server"><Ref refid="Server"/></Arg>
<Set name="host">127.0.0.1</Set>
<Set name="port">8984</Set>
<Set name="idleTimeout">60000</Set>
<Set name="reuseAddress">true</Set>
</New>
</Arg>
</Call>
</Configure>
The port for stopping BaseX must also be adjusted. To do this, the following must be entered under /opt/digiverso/basex/.basex: STOPPORT = 8985.
Then the Systemd Unit File is installed to this path:
To ensure that the administration interface of BaseX can also be accessed externally, this can be configured in the Apache web server, for example, with the following section:
To log in, login credentials must be set beforehand. This can be done with the following command:
/opt/digiverso/basex/bin/basexhttp -c PASSWORD
After BaseX has been downloaded and started, XML files can be imported as new databases. To do this, first open the menu item Database Administration, where a login can be made with the previously defined credentials.
Therefore, after logging in for the first time, a new password should be assigned. To do this, open the menu item Users. Here you can click on the account name and set the new password.
After the successful login, an overview of the installed databases, log files, etc. is displayed.
New databases for the EAD files can be created under the menu item 'Databases'. The Archive Management Plugin requires a created database.
There you can now enter a name for the new database. Then the button Create must be clicked.
After the new database has been created, an XML file can be imported as content. To do this, click on the Add button.
Here, an EAD file can be selected as an XML file and a path can be assigned under which this data inventory is to be accessible. Then click on the 'Add' button.
After importing the EAD file, the content is already available for the Goobi archive management plugin.
In the administration area of BaseX, files can also be removed. To do this, these must be marked by means of the associated checkbox and then deleted by clicking on Delete. Updating an EAD file is only possible by deleting it first and then adding it again.
Definition of the queries
To set up BaseX for query from Goobi, the database must be made aware of what such a query looks like, what is to be done with the result of the query and what the result of the query is to look like. BaseX offers various options for this. We have chosen 'RESTXQ' because, in contrast to the REST interface, it does not require any additional authentication.
To configure the queries, several new files must be created in the path /opt/digiverso/basex/webapp/. These are located within the plug-in repository under the path plugin/src/main/resources/(basex9|basex10) and can also be copied from there into the folder /opt/digiverso/basex/webapp/. Alternatively, they can also be created automatically with the following commands:
(: XQuery file to return the names of all available databases :)
module namespace page = 'http://basex.org/examples/web-pagepage';
(:declare default element namespace "urn:isbn:1-931666-22-9";:)
declare
%rest:path("/databases")
%rest:single
%rest:GET
function page:getDatabases() {
let $ead := db:list()
return
<databases>
{
for $c in $ead
return
<database>
<name>
{$c}
</name>
{
let $files := db:list-details($c)
return
<details>
{$files}
</details>
}
</database>
}
</databases>
};
Content of the file openDatabase.xq:
(: XQuery file to return a full ead record :)
module namespace page = 'http://basex.org/examples/web-page';
declare default element namespace "urn:isbn:1-931666-22-9";
declare
%rest:path("/db/{$database}/{$filename}")
%rest:single
%rest:GET
function page:getDatbase($database, $filename) {
let $ead := db:open($database, $filename)/ead
return
<collection>
{$ead}
</collection>
};
Content of the file importFile.xq:
(: XQuery file to return a full ead record :)
module namespace page = 'http://basex.org/examples/web-page';
declare default element namespace "urn:isbn:1-931666-22-9";
declare
%rest:GET
%rest:path("/import/{$db}/{$filename}")
updating function page:import($db, $filename) {
let $path := '/opt/digiverso/basex/import/' || $filename
let $details := db:list-details($db, $filename)
return
if (fn:empty($details)) then
db:add($db, doc($path), $filename)
else
db:replace($db, $filename, doc($path))
};
Depending on where the BaseX database was installed, two adjustments must still be made for writing EAD files in the file system. First, a folder must be created and given the appropriate rights so that EAD files can be saved in it. This folder could be, for example, as follows:
/opt/digiverso/basex/import/
In order to be able to access this specified directory, it must of course actually exist on the system and therefore still be created if necessary and the rights adjusted:
This directory must now be configured correctly within two configuration files. First of all, the adjustment is made in configuration file plugin_intranda_administration_archive_management.xml so that the path is defined there: