DMR Upgrade Project 2013 Code Changes
This article is meant to track what files on the New Server after the DMR Upgrade Project 2013 have been modified and a brief description of the reason for the modification(s).
Actual code samples won't be listed here, only file names/paths and modification descriptions. This is for future reference when these modifications must be re-implemented the next time we need to upgrade CONTENTdm.
Note: Unless otherwise stated, it is assumed that all file paths are prefixed with OCLC\CONTENTdm\Content6\.
- 1 e:\scripts\PurgeTMPFiles.bat
- 2 common\php533\php.ini
- 3 server\docs\cdm4\admin\indexing.php
- 4 website\public_html\ui\custom\default\collection\default\js\bsu_custom_scripts.js
- 5 website\public_html\ui\custom\default\collection\default\css\custom\bsu_custom_css.css
- 6 website\cdm_common\cdm\controllers\LoginController.php
- 7 website\cdm_common\cdm\controllers\LogoutController.php
- 8 website\cdm_common\cdm\layouts\scripts\default.phtml
- 9 website\cdm_common\cdm\layouts\scripts\custom.phtml
- 10 server\conf\bsupriv.php
- 11 website\cdm_common\cdm\models\CdmApi.php
- 12 website\cdm_common\cdm\views\scripts\cdm\singleitem.phtml
- 13 website\cdm_common\cdm\views\scripts\cdm\compoundobject.phtml
- 14 server\conf\bsumediasite.php
- 15 server\conf\bsu3dobj.php
- 16 website\cdm_common\cdm\views\scripts\cdm\error.phtml
- 17 website\cdm_common\cdm\views\scripts\login\index.phtml
- 18 website\public_html\index.php
- 19 website\public_html\collections.php
- 20 website\public_html\ui\cdm\default\collection\default\viewers\videoViewer\loader.php
- 21 website\public_html\ui\cdm\default\collection\default\viewers\showLink\loader.php
- 22 website\cdm_common\cdm\views\scripts\cdm\landingpage.phtml
- 23 server\conf\bsudowntimemessage.php
- 24 website\public_html\web.config
- 25 Custom Pages
This file was created to delete any cdm*.tmp files in C:\Windows\Temp folder that are older than 30 days. This is required to prevent the folder from getting too large and causing issues with PDF viewing/downloading. (See the php.ini file below. It must be configured AS WELL.) A daily scheduled task was added to the machine to run this script with the same name as the script file.
This file was edited so that temporary session files are placed in the C:\php-temp folder instead of the default Windows temp folder, to prevent the folder from getting too large and causing issues with PDF viewing/downloading. The session.save_path, log_errors to "on" and error_log to C:\php-temp\phperror.log.
This file was created as a tool to keep track of what collections are currently being indexed. It also shows what collections have been recently indexed. It was placed in this directory so that it could only be accessed by administrators.
A custom CSS file uploaded via the Website Configuration Tool. When uploaded this way, this script will be loaded globally on every page. This is where various custom CSS declarations go, such as styles for sub-collection togglers.
The authAction() function was modified to include a check for LDAP authentication with the given user credentials. If LDAP authentication fails (or if the LDAP server is unavailable), it rolls back to default CONTENTdm authentication.
If LDAP authentication succeeds, it sets up standard CONTENTdm session variables as if the user was NOT logged in, but sets its own special "auth_by_ldap" session variable so that other files (including LogoutController.php) can treat the user as logged in, but restricted.
The indexAction() function was slightly modified with a single line of code that clears the "auth_by_ldap" session variable mentioned above to log out users, even if they were authenticated via LDAP.
The "nav_top_right" section of this page was modified to show the "Logout" link at the top right of every page when a user is logged in, even if they logged in via LDAP.
While users logged in via LDAP don't share the same privileges as those logged in through CONTENTdm, this change at least shows LDAP users that they are, in fact, logged into the site, meaning they can view BSU-restricted collections, among other privileges.
This file was also modified so that the label next to the main search box says "Search all collections" by default, and "Search this collection" when a user is viewing a particular collection.
Last but not least, a portion of this page has been modified by including bsudowntimemessage.php to display system downtime messages across all pages.
Included bsudowntimemessag.php. Added a meta tag for Pinterest business account verification. This only shows up on "custom" pages, which includes the homepage and browse by pages.
Custom file for keeping track of collections that can only be viewed by users logged in via LDAP. It's a simple PHP array of the alias of each collection.
The api_get_collection_list() function has been modified to hide collections listed in the bsupriv.php file above unless the user has been logged in via LDAP.
The ITEM_VIEWER section has been altered to display in-line audio and video streamed from Mediasite. It determines if the currently viewed collection is enabled via the bsumediasite.php file below. A similar change was made to enable the 3D Object Viewer for displaying 3D OBJ files.
Also commented out code relevant to "Text Tab" and the content of that tab.
There is a temporary addition here (from 4/17/14) that singles out an item from the Friends of Bracken Library collection since it uses a different type of Mediasite presentation. (We may move all videos to this type of presentation in the future.)
The ITEM_VIEWER section has been altered similarly to the singleitem.phtml file to display in-line media. It determines if the collection is enabled in the same way, however, metadata is stored a bit differently in compound objects, thus the code is slightly different. This only works when showing in-line media associated with the parent item of the compound object (not for each page). A similar change was made to enable the 3D Object Viewer for displaying 3D OBJ files.
Also commented out code relevant to "Text Tab" and the content of that tab.
Custom file for keeping track of collections that have in-line audio and video streamed from Mediasite enabled. It's a simple PHP array of the alias of each collection.
Custom file for keeping track of collections that have in-line 3D Object Viewer enabled. It's a simple PHP array of the alias of each collection.
This file was heavily modified to display collection recommendations when bad collection aliases are used in the URL. The primary purpose of this is to redirect users to the appropriate pages when using outdated sub-collection aliases (such as LSTACivWar12, which used to lead to a sub-collection landing page). The file will also now suggest similarly named collections if the user only enters part of a collection alias, or if the collection aliases are 50% similar using the PHP similar_text function.
This file now also will redirect the user to the /login page if the collection they are trying to view is one in the bsupriv.php file.
This file contains the HTML for the /login page. The text of this page has been edited to provide more information to the user, mostly to tell them to use their BSU username and password, and to let them know why they're on the page. A link back to the home page has been provided as well.
This file was modified to add a redirect for CardCat linking. This was required since we didn't want to mess around with the server rewrite settings, and the cdmlink.php file would no longer work for us. Instead, index.php now checks for users requesting cdmlink.php and uses the parameters in the same fashion to appropriately redirect them.
This customization will (hopefully) eventually go away after we update the links in CardCat.
There was one other modification that checks for "/cgi-bin/oai.exe" and forwards users to the correct new OAI harvest point (same URL with the new 2013 port). This modification won't go away unless we instruct other harvesters to use the new point.
Yet another modification was made to redirect the five long-alias collections to their shortened versions. These collections were: /ArtHisImgCpght /BSU_ArchSlidesCpght /CiaNatRegMap /CoveredBridges /WWIIHistFilm. There were respectively changed to: /ArtHisImgC,/ArchSlidesC,/CiaNatMaps,/CvrdBrdgs,/WWIIHstFlm. The old versions of these collections were later removed.
Turns out the old front-end used a file called collections.php to refer users to splash pages. Obviously this file no longer existed after the upgrade, but because some places still link to us using that file, we had to reinstate it. Because collections.php wasn't under some other directory, the above index.php file is never called, and so autoforwarding of any kind doesn't work. In this very special case, we had to set the redirect up in a separate collections.php file.
This file was modified to remove the built-in CONTENTdm video player since it wasn't working with most of our non-MediaSite videos. The video player was instead replaced with instructional text on how to use the Download button and special instruction for if downloading a 3D object.
This file was modified to remove the "There is no file associated with this item." text that appears beneath null items, since we are now using null items for Mediasite-enabled collections, rather than URL items. The line around 58 was simply commented out.
This file was modified to add a "Browse Full Collection" button just above the collection description on landing pages.
This is included by the appropriate pages so that only one file needs to be updated in order to display a system-wide downtime message. (As opposed to editing the default.phtml and multiple custom index files.)
The following code was added to the "configuration" part of this file:
<system.web> <httpRuntime requestPathInvalidCharacters="" requestValidationMode="2.0" /> <pages validateRequest="false" /> </system.web>
This prevents thousands of IIS warnings from appearing in the server when users do searches for strings with special characters, such as colons, in them.
Also edited this file to enable the new "responsive/mobile" view provided by CONTENTdm 6.9.
website\public_html\ui\custom\default\collection\default\resources\custompages\home website\public_html\ui\custom\default\collection\default\resources\custompages\contact website\public_html\ui\custom\default\collection\default\resources\custompages\browseby
The files in these folders were uploaded either through the Website Configuration Tool or directly in conjunction with the WCT to create the newly designed Home Page, Contact page.
Browse By is a special page that houses all of the categories in the "Browse By" navigational menu. All of the content in this page is produced through system calls to the underlying CONTENTdm system. Most calls pull data from the Collection of Collections (or the BSU DMR Collections collection).