Browse Source

Fixed ConnectionHelper

pull/50/head
Ben Woodhead 13 years ago
parent
commit
150d208346
  1. 2
      api/ConnectionHelper.inc
  2. 4
      api/fedora_item.inc
  3. 4
      core/CollectionClass.inc
  4. 8
      core/ObjectHelper.inc
  5. 6
      fedora_repository.module

2
core/ConnectionHelper.inc → api/ConnectionHelper.inc

@ -1,7 +1,5 @@
<?php <?php
/** /**
* @file * @file
* Connection Helper Class * Connection Helper Class

4
api/fedora_item.inc

@ -28,7 +28,7 @@ class Fedora_Item {
*/ */
function __construct($pid) { function __construct($pid) {
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$this->pid = $pid; $this->pid = $pid;
@ -848,7 +848,7 @@ class Fedora_Item {
*/ */
static function soap_call($function_name, $params_array, $quiet = FALSE) { static function soap_call($function_name, $params_array, $quiet = FALSE) {
if (!self::$connection_helper) { if (!self::$connection_helper) {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
self::$connection_helper = new ConnectionHelper(); self::$connection_helper = new ConnectionHelper();
} }
switch ($function_name) { switch ($function_name) {

4
core/CollectionClass.inc

@ -220,7 +220,7 @@ class CollectionClass {
* $dsid is the datastream id of the content model. * $dsid is the datastream id of the content model.
*/ */
function getNextPid($pid, $dsid) { function getNextPid($pid, $dsid) {
module_load_include('inc', 'Fedora_Repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
$pidNameSpace = $this->getPidNameSpace($pid, $dsid); $pidNameSpace = $this->getPidNameSpace($pid, $dsid);
$pname = substr($pidNameSpace, 0, strpos($pidNameSpace, ":")); $pname = substr($pidNameSpace, 0, strpos($pidNameSpace, ":"));
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
@ -437,7 +437,7 @@ class CollectionClass {
'name' => variable_get('fedora_admin_user', 'fedoraAdmin') 'name' => variable_get('fedora_admin_user', 'fedoraAdmin')
); );
$admin_user = user_load($username); $admin_user = user_load($username);
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
$connectionHelper = new ConnectionHelper(); $connectionHelper = new ConnectionHelper();
try { try {
$soapClient = $connectionHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); $soapClient = $connectionHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'));

8
core/ObjectHelper.inc

@ -33,7 +33,7 @@ class ObjectHelper {
*/ */
function ObjectHelper() { function ObjectHelper() {
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
$connectionHelper = new ConnectionHelper(); $connectionHelper = new ConnectionHelper();
//$this->fedoraUser = $connectionHelper->getUser(); //$this->fedoraUser = $connectionHelper->getUser();
//$this->fedoraPass = $connectionHelper->getPassword(); //$this->fedoraPass = $connectionHelper->getPassword();
@ -360,7 +360,7 @@ class ObjectHelper {
function getFormattedDC($item) { function getFormattedDC($item) {
global $base_url; global $base_url;
$path = drupal_get_path('module', 'fedora_repository'); $path = drupal_get_path('module', 'fedora_repository');
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
$dsid = array_key_exists('QDC', $item->get_datastreams_list_as_array()) ? 'QDC' : 'DC'; $dsid = array_key_exists('QDC', $item->get_datastreams_list_as_array()) ? 'QDC' : 'DC';
$xmlstr = $item->get_datastream_dissemination($dsid); $xmlstr = $item->get_datastream_dissemination($dsid);
@ -440,7 +440,7 @@ class ObjectHelper {
*/ */
function get_formatted_datastream_list($object_pid, $contentModels, &$fedoraItem) { function get_formatted_datastream_list($object_pid, $contentModels, &$fedoraItem) {
global $fedoraUser, $fedoraPass, $base_url, $user; global $fedoraUser, $fedoraPass, $base_url, $user;
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
@ -514,7 +514,7 @@ class ObjectHelper {
* *
*/ */
function getStream($pid, $dsid, $showError = FALSE) { function getStream($pid, $dsid, $showError = FALSE) {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
$soapHelper = new ConnectionHelper(); $soapHelper = new ConnectionHelper();
try { try {
$client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'));

6
fedora_repository.module

@ -495,7 +495,7 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL)
* @return type * @return type
*/ */
function fedora_repository_purge_object_form_submit($form, &$form_state) { function fedora_repository_purge_object_form_submit($form, &$form_state) {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
$pid = $form_state['values']['pid']; $pid = $form_state['values']['pid'];
if (!isset($form_state['storage']['confirm'])) { if (!isset($form_state['storage']['confirm'])) {
$form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form $form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form
@ -729,7 +729,7 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) {
} }
module_load_include('inc', 'fedora_repository', 'formClass'); module_load_include('inc', 'fedora_repository', 'formClass');
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
$soapHelper = new ConnectionHelper(); $soapHelper = new ConnectionHelper();
$client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'));
// Check if there is a custom edit metadata function defined in the content model. // Check if there is a custom edit metadata function defined in the content model.
@ -787,7 +787,7 @@ function fedora_repository_edit_qdc_form_submit($form, &$form_state) {
$xml_form->submit($form, $form_state); $xml_form->submit($form, $form_state);
} }
else { else {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
global $base_url; global $base_url;
if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) { if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) {

Loading…
Cancel
Save