From 2a041f9ef01fb44c14ac9890072cbca138e2e8b0 Mon Sep 17 00:00:00 2001 From: jonathangreen Date: Tue, 22 May 2012 15:45:07 -0300 Subject: [PATCH] Addding add stuff --- RestConnection.inc | 23 +++++++++++++++++++++++ includes/add-menu.inc | 32 ++++++++++++++++++++++++++++++++ islandora.module | 7 +++++-- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 includes/add-menu.inc diff --git a/RestConnection.inc b/RestConnection.inc index 3d74d85b..24e65f83 100644 --- a/RestConnection.inc +++ b/RestConnection.inc @@ -13,9 +13,32 @@ require_once 'sites/all/libraries/tuque/FedoraRelationships.php'; class RestConnection { + /** + * Connection to the repository + * + * @var RepositoryConnection + */ public $connection = NULL; + + /** + * The Fedora API we are using + * + * @var FedoraAPI + */ public $api = NULL; + + /** + * The cache we use to connect. + * + * @var SimpleCache + */ public $cache = NULL; + + /** + * The repository object. + * + * @var FedoraRepository + */ public $repository = NULL; function RestConnection($user) { diff --git a/includes/add-menu.inc b/includes/add-menu.inc new file mode 100644 index 00000000..d1fb988d --- /dev/null +++ b/includes/add-menu.inc @@ -0,0 +1,32 @@ +repository->getObject($pid); + + dsm($object->id); + + /** + + $ingest_registry = module_invoke_all('islandora_ingest_registry', $collection_pid); + + $registry_count = count($ingest_registry); + + if ($registry_count == 0) { + // No ingest implementations. + drupal_set_message(t('There are no ingest methods specified for this collection.')); + drupal_goto('islandora/object/' . $collection_pid); + } + elseif ($registry_count == 1) { + // One registry implementation, go there + drupal_goto($ingest_registry[0]['url']); + } + else { + // Multiple ingest routes registered + return islandora_ingest_registry_render($ingest_registry); + } + * + */ +} \ No newline at end of file diff --git a/islandora.module b/islandora.module index 2a6fbae9..5de421e3 100644 --- a/islandora.module +++ b/islandora.module @@ -96,9 +96,12 @@ function islandora_menu() { 'access arguments' => array(FEDORA_VIEW), ); + $items['islandora/object/%/add'] = array( - 'title' => 'Add stream', - 'page callback' => 'islandora_add_stream', + 'title' => 'Add to an object', + 'file' => 'includes/add-menu.inc', + 'page callback' => 'islandora_add_callback', + 'page arguments' => array(2), 'type' => MENU_NORMAL_ITEM, 'access arguments' => array(FEDORA_ADD_DS) );