DMR Upgrade Project 2013 Code Changes

From Ball State University Libraries Wiki
Jump to: navigation, search

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\.


e:\scripts\PurgeTMPFiles.bat

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.


common\php533\php.ini

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.


website\public_html\ui\custom\default\collection\default\js\bsu_custom_scripts.js

A custom Javascript 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 Javascript goes, such as Google Analytics code, or helper code for sub-collection themes.


website\public_html\ui\custom\default\collection\default\css\custom\bsu_custom_css.css

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.


website\cdm_common\cdm\controllers\LoginController.php

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.


website\cdm_common\cdm\controllers\LogoutController.php

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.


website\cdm_common\cdm\layouts\scripts\default.phtml

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.


website\cdm_common\cdm\layouts\scripts\custom.phtml

Added a meta tag for Pinterest business account verification. This only shows up on "custom" pages, which includes the homepage and browse by pages.


server\conf\bsupriv.php

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.


website\cdm_common\cdm\models\CdmApi.php

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.


website\cdm_common\cdm\views\scripts\cdm\singleitem.phtml

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.)

website\cdm_common\cdm\views\scripts\cdm\compoundobject.phtml

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.


server\conf\bsumediasite.php

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.


server\conf\bsu3dobj.php

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.


website\cdm_common\cdm\views\scripts\cdm\error.phtml

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.


website\cdm_common\cdm\views\scripts\login\index.phtml

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.


website\public_html\index.php

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.


website\public_html\collections.php

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.


website\public_html\ui\cdm\default\collection\default\viewers\videoViewer\loader.php

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.


website\public_html\ui\cdm\default\collection\default\viewers\showLink\loader.php

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.


website\cdm_common\cdm\views\scripts\cdm\landingpage.phtml

This file was modified to add a "Browse Full Collection" button just above the collection description on landing pages.


Custom Pages

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).