Browse Source

Merge d3d3d458d0 into 100d8ddc05

pull/636/merge
A. Soroka 8 years ago committed by GitHub
parent
commit
b9fa78b8d5
  1. 1
      .travis.yml
  2. 15
      includes/admin.form.inc
  3. 15
      includes/tuque.inc
  4. 10
      tests/scripts/travis_setup.sh

1
.travis.yml

@ -54,3 +54,4 @@ after_failure:
- $ISLANDORA_DIR/tests/scripts/travis_after_failure.sh - $ISLANDORA_DIR/tests/scripts/travis_after_failure.sh
notifications: notifications:
irc: "irc.freenode.org#islandora" irc: "irc.freenode.org#islandora"
sudo: required

15
includes/admin.form.inc

@ -59,6 +59,21 @@ function islandora_repository_admin(array $form, array &$form_state) {
), ),
), ),
), ),
'islandora_sparql_endpoint_externalized' => array(
'#type' => 'checkbox',
'#title' => t('Use an external SPARQL Query endpoint'),
'#description' => t('If an external query endpoint is used, the repository must be configured to update it.'),
'#default_value' => variable_get('islandora_sparql_endpoint_externalized', FALSE),
),
'islandora_sparql_endpoint' => array(
'#type' => 'textfield',
'#title' => t('SPARQL Query Endpoint'),
'#default_value' => variable_get('islandora_sparql_endpoint', ""),
'#description' => t("An external SPARQL Query endpoint to use."),
'#required' => FALSE,
'#states' => array(
'invisible' => array(':input[name="islandora_sparql_endpoint_externalized"]' => array('checked' => FALSE))),
),
'islandora_repository_pid' => array( 'islandora_repository_pid' => array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Root Collection PID'), '#title' => t('Root Collection PID'),

15
includes/tuque.inc

@ -65,8 +65,10 @@ class IslandoraTuque {
* A Drupal user. * A Drupal user.
* @param string $url * @param string $url
* The url to the fedora instance. * The url to the fedora instance.
* @param string $sparql_endpoint
* The URL of a SPARQL Query endpoint for this connection.
*/ */
public function __construct($user = NULL, $url = NULL) { public function __construct($user = NULL, $url = NULL, $sparql_endpoint = NULL) {
if (!isset($user)) { if (!isset($user)) {
global $user; global $user;
} }
@ -84,9 +86,18 @@ class IslandoraTuque {
$url = variable_get('islandora_base_url', 'http://localhost:8080/fedora'); $url = variable_get('islandora_base_url', 'http://localhost:8080/fedora');
} }
if (!isset($sparql_endpoint)) {
if (variable_get('islandora_sparql_endpoint_externalized', FALSE)) {
$sparql_endpoint = variable_get('islandora_sparql_endpoint', $url);
}
else {
$sparql_endpoint = $url;
}
}
if (self::exists()) { if (self::exists()) {
module_load_include('inc', 'islandora', 'includes/tuque_wrapper'); module_load_include('inc', 'islandora', 'includes/tuque_wrapper');
$this->connection = new IslandoraRepositoryConnection($url, $user_string, $pass_string); $this->connection = new IslandoraRepositoryConnection($url, $user_string, $pass_string, $sparql_endpoint);
$this->connection->reuseConnection = TRUE; $this->connection->reuseConnection = TRUE;
$this->api = new IslandoraFedoraApi($this->connection); $this->api = new IslandoraFedoraApi($this->connection);
$this->cache = new IslandoraSimpleCache(); $this->cache = new IslandoraSimpleCache();

10
tests/scripts/travis_setup.sh

@ -73,4 +73,12 @@ drush en --user=1 --yes islandora
drush cc all drush cc all
# The shebang in this file is a bogeyman that is haunting the web test cases. # The shebang in this file is a bogeyman that is haunting the web test cases.
rm /home/travis/.phpenv/rbenv.d/exec/hhvm-switcher.bash rm /home/travis/.phpenv/rbenv.d/exec/hhvm-switcher.bash
sleep 20
# wait for Fedora to come up
fedoraIsUp=1
until [ $fedoraIsUp -eq "0" ]; do
echo "Waiting for Fedora to boot..."
sleep 10
(curl http://localhost:8080/fedora)
fedoraIsUp=$?
done

Loading…
Cancel
Save