Browse Source

Addding add stuff

pull/108/head
jonathangreen 13 years ago
parent
commit
2a041f9ef0
  1. 23
      RestConnection.inc
  2. 32
      includes/add-menu.inc
  3. 7
      islandora.module

23
RestConnection.inc

@ -13,9 +13,32 @@ require_once 'sites/all/libraries/tuque/FedoraRelationships.php';
class RestConnection { class RestConnection {
/**
* Connection to the repository
*
* @var RepositoryConnection
*/
public $connection = NULL; public $connection = NULL;
/**
* The Fedora API we are using
*
* @var FedoraAPI
*/
public $api = NULL; public $api = NULL;
/**
* The cache we use to connect.
*
* @var SimpleCache
*/
public $cache = NULL; public $cache = NULL;
/**
* The repository object.
*
* @var FedoraRepository
*/
public $repository = NULL; public $repository = NULL;
function RestConnection($user) { function RestConnection($user) {

32
includes/add-menu.inc

@ -0,0 +1,32 @@
<?php
function islandora_add_callback($pid) {
module_load_include('inc', 'islandora', 'RestConnection');
global $user;
$connection = new RestConnection($user);
$object = $connection->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);
}
*
*/
}

7
islandora.module

@ -96,9 +96,12 @@ function islandora_menu() {
'access arguments' => array(FEDORA_VIEW), 'access arguments' => array(FEDORA_VIEW),
); );
$items['islandora/object/%/add'] = array( $items['islandora/object/%/add'] = array(
'title' => 'Add stream', 'title' => 'Add to an object',
'page callback' => 'islandora_add_stream', 'file' => 'includes/add-menu.inc',
'page callback' => 'islandora_add_callback',
'page arguments' => array(2),
'type' => MENU_NORMAL_ITEM, 'type' => MENU_NORMAL_ITEM,
'access arguments' => array(FEDORA_ADD_DS) 'access arguments' => array(FEDORA_ADD_DS)
); );

Loading…
Cancel
Save