funderburkjim / testing

For testing various features of github. Nothing important here.
0 stars 0 forks source link

work on csl-websanlexicon servepdf documentation #38

Open funderburkjim opened 5 years ago

funderburkjim commented 5 years ago

$dictinfowhich

The dictinfowhich.php module defines a PHP variable $dictinfowhich whose value provides a run-time switch used to distinguish the server running the application.

Currently, $dictinfowhich has one of two string values, "cologne" or "xampp" (see server agnostic enhancement intro comment above).

If the file system name of the current directory (provided by the PHP constant __DIR__) starts with 'afs', then the value is set to "cologne"; otherwise it is set to "xampp". The test could be made more precise if and when the need arises.

Dictinfo::get_pdfpages_url()

This method in dictinfo.php returns a string used (by ServepdfClass) to construct a URL string for a scanned image of a particular page in a particular dictionary.

get_pdfpages_url() uses the value of $dictinfowhich to tailor the computation depending on the server type.

flexibility of cologne solution

Currently, the cologne url is the pdfpages directory within the 'old' web directory, e.g. for VCP, the url is //www.sanskrit-lexicon.uni-koeln.de/scans/VCPScan/2013/web/pdfpages

When we construct a new version of the dictionary, in VCPScan/2020/, we can still use //www.sanskrit-lexicon.uni-koeln.de/scans/VCPScan/2013/web/pdfpages. i.e., the same url will work for the old VCPScan/2013 and the new VCPScan/2020.

Also, if we decide to change the location of the cologne images for any (or all) dictionaries, this can be accomplished by changing the get_cologne_pdfpages_url() function in the Dictinfo class in dictinfo.php.

funderburkjim commented 5 years ago

server agnostic solution

The Dictinfo::get_pdfpages_url() method described above is the key to the current server agnostic solution provided by ServepdfClass in servepdfClass.php.

Here are the steps used to get a URL for the scanned image of a particular page of a particular dictionary. Assume that strings representing the page and dictionary are in variables $page and $dict in an ServepdfClass instance.

funderburkjim commented 5 years ago

https://github.com/sanskrit-lexicon/csl-websanlexicon/issues/6

funderburkjim commented 5 years ago

pdffiles.txt

In the web/webtc directory for each dictionary there is a file named pdffiles.txt.

This file is NOT maintained by csl-websanlexicon, but must be present in order for the display of scanned images if the scanned images are on the server.

This file is used by the getfiles method of the ServepdfClass instance. This method returns the filename corresponding to a page number for a particular scanned image.

Each dictionary digitization has

The pdffiles.txt file lists the correspondences between page reference and file name. The getfiles method is responsible for matching a given page reference to one of those in pdffiles.txt, and thus determining the filename corresponding to the given page reference.

The pdffiles.txt lines are assumed to be in the order of the text. This permits the getfiles method to also return the filenames corresponding to the scanned images of the page preceding and following the given page reference. These two file names in turn permit the 'next' and 'previous' arrow controls that are part of the scanned image display generated by servepdf.

image