|
|
|
@ -6,6 +6,29 @@
|
|
|
|
|
* This file contains a class to include the Tuque php library. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
$islandora_module_path = drupal_get_path('module', 'islandora'); |
|
|
|
|
|
|
|
|
|
//do this until we expost these in a module or library |
|
|
|
|
@include_once 'sites/all/libraries/tuque/Datastream.php'; |
|
|
|
|
@include_once 'sites/all/libraries/tuque/FedoraApi.php'; |
|
|
|
|
@include_once 'sites/all/libraries/tuque/FedoraApiSerializer.php'; |
|
|
|
|
@include_once 'sites/all/libraries/tuque/Object.php'; |
|
|
|
|
@include_once 'sites/all/libraries/tuque/RepositoryConnection.php'; |
|
|
|
|
@include_once 'sites/all/libraries/tuque/Cache.php'; |
|
|
|
|
@include_once 'sites/all/libraries/tuque/RepositoryException.php'; |
|
|
|
|
@include_once 'sites/all/libraries/tuque/Repository.php'; |
|
|
|
|
@include_once 'sites/all/libraries/tuque/FedoraRelationships.php'; |
|
|
|
|
|
|
|
|
|
@include_once "$islandora_module_path/libraries/tuque/Datastream.php"; |
|
|
|
|
@include_once "$islandora_module_path/libraries/tuque/FedoraApi.php"; |
|
|
|
|
@include_once "$islandora_module_path/libraries/tuque/FedoraApiSerializer.php"; |
|
|
|
|
@include_once "$islandora_module_path/libraries/tuque/Object.php"; |
|
|
|
|
@include_once "$islandora_module_path/libraries/tuque/RepositoryConnection.php"; |
|
|
|
|
@include_once "$islandora_module_path/libraries/tuque/Cache.php"; |
|
|
|
|
@include_once "$islandora_module_path/libraries/tuque/RepositoryException.php"; |
|
|
|
|
@include_once "$islandora_module_path/libraries/tuque/Repository.php"; |
|
|
|
|
@include_once "$islandora_module_path/libraries/tuque/FedoraRelationships.php"; |
|
|
|
|
|
|
|
|
|
class IslandoraTuque { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -55,11 +78,11 @@ class IslandoraTuque {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (self::exists()) { |
|
|
|
|
$this->connection = new RepositoryConnection($url, $user_string, $pass_string); |
|
|
|
|
$this->connection = new IslandoraRepositoryConnection($url, $user_string, $pass_string); |
|
|
|
|
$this->connection->reuseConnection = TRUE; |
|
|
|
|
$this->api = new FedoraApi($this->connection); |
|
|
|
|
$this->cache = new SimpleCache(); |
|
|
|
|
$this->repository = new FedoraRepository($this->api, $this->cache); |
|
|
|
|
$this->api = new IslandoraFedoraApi($this->connection); |
|
|
|
|
$this->cache = new IslandoraSimpleCache(); |
|
|
|
|
$this->repository = new IslandoraFedoraRepository($this->api, $this->cache); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -85,11 +108,61 @@ class IslandoraTuque {
|
|
|
|
|
function islandora_get_tuque_connection() { |
|
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
|
if (!$tuque) { |
|
|
|
|
try { |
|
|
|
|
$tuque = new IslandoraTuque(); |
|
|
|
|
} catch (Exception $e) { |
|
|
|
|
drupal_set_message(t('Unable to connect to the repository %e', array('%e' => $e)), 'error'); |
|
|
|
|
if(IslandoraTuque::exists()) { |
|
|
|
|
try { |
|
|
|
|
$tuque = new IslandoraTuque(); |
|
|
|
|
} catch (Exception $e) { |
|
|
|
|
drupal_set_message(t('Unable to connect to the repository %e', array('%e' => $e)), 'error'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return $tuque; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class IslandoraFedoraRepository extends FedoraRepository { |
|
|
|
|
protected $queryClass = 'IslandoraRepositoryQuery'; |
|
|
|
|
protected $newObjectClass = 'IslandoraNewFedoraObject'; |
|
|
|
|
protected $objectClass = 'IslandoraFedoraObject'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class IslandoraRepositoryQuery extends RepositoryQuery {} |
|
|
|
|
|
|
|
|
|
class IslandoraNewFedoraObject extends NewFedoraObject { |
|
|
|
|
protected $newFedoraDatastreamClass = 'IslandoraNewFedoraDatastream'; |
|
|
|
|
protected $fedoraDatastreamClass = 'IslandoraFedoraDatastream'; |
|
|
|
|
protected $fedoraRelsExtClass = 'IslandoraFedoraRelsExt'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class IslandoraFedoraObject extends FedoraObject { |
|
|
|
|
protected $newFedoraDatastreamClass = 'IslandoraNewFedoraDatastream'; |
|
|
|
|
protected $fedoraDatastreamClass = 'IslandoraFedoraDatastream'; |
|
|
|
|
protected $fedoraRelsExtClass = 'IslandoraFedoraRelsExt'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class IslandoraRepositoryConnection extends RepositoryConnection {} |
|
|
|
|
|
|
|
|
|
class IslandoraFedoraApi extends FedoraApi {} |
|
|
|
|
|
|
|
|
|
class IslandoraSimpleCache extends SimpleCache {} |
|
|
|
|
|
|
|
|
|
class IslandoraNewFedoraDatastream extends NewFedoraDatastream { |
|
|
|
|
protected $fedoraRelsIntClass = 'IslandoraFedoraRelsInt'; |
|
|
|
|
protected $fedoraDatastreamVersionClass = 'IslandoraFedoraDatastreamVersion'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class IslandoraFedoraDatastream extends FedoraDatastream { |
|
|
|
|
protected $fedoraRelsIntClass = 'IslandoraFedoraRelsInt'; |
|
|
|
|
protected $fedoraDatastreamVersionClass = 'IslandoraFedoraDatastreamVersion'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class IslandoraFedoraDatastreamVersion extends FedoraDatastreamVersion { |
|
|
|
|
protected $fedoraRelsIntClass = 'IslandoraFedoraRelsInt'; |
|
|
|
|
protected $fedoraDatastreamVersionClass = 'IslandoraFedoraDatastreamVersion'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class IslandoraFedoraRelsExt extends FedoraRelsExt {} |
|
|
|
|
|
|
|
|
|
class IslandoraFedoraRelsInt extends FedoraRelsInt {} |
|
|
|
|