Skip to content

marriott-library/eadxsl

Repository files navigation

Author:
	Alan Witkowski (alan.witkowski@utah.edu)
	
Requirements:
	ContentDM version 6.6 or newer
	Access to ContentDM web files
	php5-xsl module for XSL processing (http://php.net/manual/en/book.xsl.php)
	
Notes:
	Follow the steps below to make the necessary adjustments to the ContentDM code.
	
	Be sure to change the variable $ead_collections in CdmController.php to
	match the list of aliases for your EAD collections. See below.


*** FILES **********************************************************************
Note: path_to_contentdm_webroot is where the contentDM website files are installed. (e.g. /usr/local/Content6/Website)

Start by downloading the eadxsl zip file from this URL:
https://github.com/marriott-library/eadxsl/zipball/master

The following files will need to be modified:
[path_to_contentdm_webroot]/cdm_common/cdm/controllers/CdmController.php
[path_to_contentdm_webroot]/cdm_common/cdm/views/scripts/cdm/singleitem.phtml

The following files will need to be added:
[path_to_contentdm_webroot]/cdm_common/cdm/views/scripts/cdm/ead_view.phtml
[path_to_contentdm_webroot]/public_html/ead/images/nav_background.jpg
[path_to_contentdm_webroot]/public_html/ead/ss-committee-cdm.xsl
[path_to_contentdm_webroot]/public_html/ead/ss-committee-container.xsl
[path_to_contentdm_webroot]/public_html/ead/stylesheet-committee.css
[path_to_contentdm_webroot]/public_html/ead/stylesheet-committee-IE.css
[path_to_contentdm_webroot]/public_html/ead/stylesheet-committee-print.css


*** MODIFICATIONS TO CONTENTDM *************************************************

STEP 1: In cdm_common/cdm/controllers/CdmController.php, around Line 730, at the end of the function itemviewerAction, add the code:

// Check if the current collection is in the EAD list, then get the file path to the xml file and pass it to the view
$ead_collections = array("UU_EAD", "ww-EAD", "ushs_ead", "westmin_ead");
if(in_array($this->view->collection, $ead_collections)) {
	$image_info = simplexml_load_string($this->cdmapi->api_get_data("dmGetImageInfo/".$this->view->collection."/".$this->view->id."/xml","xml"));
	$this->view->upload_filepath = $image_info->filename;
}

--------------------------------------------------------------------------------

STEP 2a: In cdm_common/cdm/views/scripts/cdm/singleitem.phtml, around line 233, after <!-- ITEM_VIEWER -->, add the code:

<?php
if(isset($this->upload_filepath)) {
	echo $this->partial("cdm/ead_view.phtml", array("xml_file"=>$this->upload_filepath));   
}
else {
?>

--------------------------------------------------------------------------------

STEP 2b: Add the end brace before the comment <!-- META_DATA --> around line 457:

<?php
} // End brace
?>

--------------------------------------------------------------------------------

STEP 3: Add the file cdm_common/cdm/views/scripts/cdm/ead_view.phtml:

<?php
    // Author: Alan Witkowski
    //   Info: Processes an EAD XML file with XSLT and outputs the result.
    
    // Create XML objects
    $doc_xml = new DOMDocument(); 
    $doc_xsl = new DOMDocument();
    
    // Load XML file
    if($doc_xml->load($this->xml_file)) {
    
        // Load XSL transform file
        if($doc_xsl->load($_SERVER['DOCUMENT_ROOT'] . "/ead/ss-committee-cdm.xsl")) {
            $xslt_proc = new XSLTProcessor;
            $xslt_proc->importStyleSheet($doc_xsl);
    
            // Output the transformed version
            if($output = $xslt_proc->transformToXML($doc_xml)) {
                echo "<div class=\"ead_container\">$output</div>";
            }  
        }  
    }  
?>

About

EAD display templates for contentDM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published