Browse Source

Fedora specific info (like path and parent) are coming back asynchronously.

7.x-2.x
Daniel Lamb 10 years ago
parent
commit
d560e23524
  1. 11
      islandora/islandora.module
  2. 1
      islandora_collection/islandora_collection.info
  3. 10
      islandora_collection/islandora_collection.module

11
islandora/islandora.module

@ -52,6 +52,17 @@ function islandora_rdf_namespaces() {
); );
} }
/**
* Implements hook_entity_load().
*/
function islandora_entity_load($entities, $type) {
foreach ($entities as $entity) {
if (strcmp($type, "node") == 0) {
$entity->rdf_namespaces = rdf_get_namespaces();
}
}
}
/** /**
* Implements hook_default_services_endpoint(). * Implements hook_default_services_endpoint().
*/ */

1
islandora_collection/islandora_collection.info

@ -5,3 +5,4 @@ version = 7.x-dev
core = 7.x core = 7.x
dependencies[] = islandora dependencies[] = islandora
dependencies[] = hook_post_action dependencies[] = hook_post_action
dependencies[] = httprl

10
islandora_collection/islandora_collection.module

@ -54,6 +54,11 @@ function islandora_collection_rdf_mapping() {
* Implements hook_node_postinsert(). * Implements hook_node_postinsert().
*/ */
function islandora_collection_node_postinsert($node) { function islandora_collection_node_postinsert($node) {
if (isset($_SERVER['HTTP_IGNORE_HOOKS']) && strcmp(strtolower($_SERVER['HTTP_IGNORE_HOOKS']), "true") == 0) {
dd("IGNORING HOOK!");
return;
}
// Exit early if it's not a collection. // Exit early if it's not a collection.
if (strcmp($node->type, ISLANDORA_COLLECTION_CONTENT_TYPE) != 0) { if (strcmp($node->type, ISLANDORA_COLLECTION_CONTENT_TYPE) != 0) {
return; return;
@ -67,7 +72,6 @@ function islandora_collection_node_postinsert($node) {
} }
$node = array_pop($nodes); $node = array_pop($nodes);
$node->rdf_namespaces = rdf_get_namespaces();
httprl_request("http://localhost:8080/islandora-services/rest/collection", httprl_request("http://localhost:8080/islandora-services/rest/collection",
array( array(
'method' => 'POST', 'method' => 'POST',
@ -82,4 +86,8 @@ function islandora_collection_node_postinsert($node) {
*/ */
function islandora_collection_node_postupdate($node) { function islandora_collection_node_postupdate($node) {
dd("FROM POST UPDATE HOOK"); dd("FROM POST UPDATE HOOK");
if (isset($_SERVER['HTTP_IGNORE_HOOKS']) && strcmp(strtolower($_SERVER['HTTP_IGNORE_HOOKS']), "true") == 0) {
dd("IGNORING HOOK!");
return;
}
} }

Loading…
Cancel
Save