-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
92 lines (67 loc) · 3.49 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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>";
}
}
}
?>