uid == 0) { $user_string = 'anonymous'; $pass_string = 'anonymous'; } else { $user_string = $user->name; $pass_string = $user->pass; } if (!isset($url)) { $url = variable_get('islandora_base_url', 'http://localhost:8080/fedora'); } if (self::exists()) { $this->connection = new IslandoraRepositoryConnection($url, $user_string, $pass_string); $this->connection->reuseConnection = TRUE; $this->api = new IslandoraFedoraApi($this->connection); $this->cache = new IslandoraSimpleCache(); $this->repository = new IslandoraFedoraRepository($this->api, $this->cache); } } static function exists() { return class_exists('RepositoryConnection'); } static function getError() { $islandora_doc_link = l(t('Islandora documentation'), 'https://wiki.duraspace.org/display/ISLANDORA/Islandora'); $tuque_link = l(t('Tuque Fedora API'), 'http://github.com/islandora/tuque'); $message = t('Islandora requires the !tuque_url. Please install in /sites/all/libraries/tuque before continuing. See the !islandora_url.', array( '!tuque_url' => $tuque_link, '!islandora_url' => $islandora_doc_link)); drupal_set_message(filter_xss($message), 'error', FALSE); } } /** * Just a wrapper around fetchings the IslandoraTuque object, with some very * basic error logging. * * @return IslandoraTuque * A IslandoraTuque instance */ function islandora_get_tuque_connection() { $tuque = &drupal_static(__FUNCTION__); if (!$tuque) { 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 {}