POD and DOD

From DLXS Documentation

Jump to: navigation, search

Main Page > POD and DOD

DLXS supports various methods by which a user can get a DLXS item removed from its LDXS context: either by ordering a print copy (Print-on-Demad) or by downloading a file of the contents (Download-on-Demand).

The logic for presenting the approrpiate options for a given item, and displaying buttons whihc link to those options, is encapsulated in FullTextClass::BuildPODandDODLinks_XML.

[edit] Print-on-Demand (POD)

Note: To disable all POD features in DLXS, leave LibGlobals::gItemLevelPODtable undefined.

In order to determine whether to display POD buttons for a given item, BuildPODandDODLinks_XML does the following:

1. Checks that the 'printondemand' field in the collmgr record has a value of 'yes', indicating that this collection contains POD items.

2. Checks the DLXS database table defined by LibGlobals::gItemLevelPODtable for the presence of the current item's idno, indicating that this item is permitted for POD.

3. Checks the database defined by LibGlobals::gItemLevelPODMySQL_Database to discover what bindings are available for the current item, using logic encapsulated in FullTextClass::getPODBindings. For each available binding, XML data is emitted, including the URL the user can go to in order to order a given binding.

4. The XSLT template BuildPodButtons then uses the XML data to display the appropriate POD buttons. Currently they will display in tocheader and search results.

The POD buttons will link to the CGI script defined by LibGlobals::gPODCgiRoot. (The script used by DLPS, /cgi/p/pod/pod-idx, is provided as an example.)


[edit] Download-on-Demand (DOD)

DLXS can allow the user to download the contents of an item as a computer file. (Currently this is only implemented for PDF downloads; further development could generalize this feature to support a variety of file formats.)

Because DLXS supports pay-per-download services for restricted content, the logic for Download-on-Demand is related to the logic for POD.

In order to determine which, if any, download options to present for a given item, BuildPODandDODLinks_XML does the following:

1. Checks the auth status of the item. If full access is allowed, ViewPDFLink_XML is called, which will attempt to build a link to a free downloadable PDF.

  a. ViewPDFLink_XML only proceeds if the value of LibGlobals::gFreeDOD is set to 'y'.
  b. Then it looks for a PDF file of the current item, under the file name '$idno.pdf'.  It looks in both the item-level directory in the respository ($DLXSDATAROOT/obj/1/2/3/123456.0001.001/) and in the collection-level img directory ($DLXSROOT/img/c/collid/).
  c. If such a PDF is found, then XML is emitted containing the URL to the CGI script (defined by LibGlobals::gDODCgiRoot) with the parameters necessary for requesting the given PDF.

2. If we are not offering a free download (either because $gFreeDOD is not set to 'y', or because the user is not authorized to the full contents of the item, or because there is no PDF file on disk): then, if PDF is among the available POD bindings, XML is emitted containing the URL to the CGI script (defined by LibGlobals::gDODCgiRoot) with the parameters necessary for purchasing the given PDF.

LibGlobals::gDODCgiRoot is set by default to '/cgi/p/pod/dod-idx', which is included in the installation, but will need adjusting for your local e-commerce solution. Note that buttons for free and purchaseable PDFs will have identical HREFs; this is to prevent URL hacking that might allow an unauthorized user to get a PDF for free when they are supposed to pay.

dod-idx makes two checks before delivering a PDF: 1. It re-checks that the requestor is authorized to access the requested item, using standard DLXS methods. If authorized, the user receives the immediately. If not authorized, the user is forwarded to an e-commerce service. Once the purchase is complete, dod-idx emails the user with a temporary URL for downloading the PDF.

2. When attempting to deliver the PDF, dod-idx looks in both the item-level repository and the collection-level img directory, as described above. If no PDF is found, then it attempts to create one out of page-image TIFFs in the repository. The PDF is then 'printed' directly to the user's web browser.

Personal tools