Remove some unused code
[sitka/overdrive-evergreen-opac.git] / README.txt
CommitLineData
19ec4380 1The source code for the project is written in Coffeescript.
8ebc3fff
SC
2
3The source needs to be completed by writing a od_config.coffee file to define
4configuration parameters, primarily related to authentication. Use the template
19ec4380 5file 'od_config_template.coffee' by following its instructions.
8ebc3fff 6
19ec4380
SC
7The source also needs to be compiled into Javascript and minimized on a
8development machine before executable code can be deployed on a production
9server.
8ebc3fff 10
19ec4380 11
1bae196f 12A. Prerequisites
8ebc3fff
SC
13
141. Install nodejs.org
15
162. Install node packages
19ec4380
SC
17# sudo npm install --global coffee-script
18# sudo npm install --global requirejs
8ebc3fff
SC
19
20
1bae196f
JD
21B. Compiling and Production Deployment
22
231. Configure od_config.coffee to match your production
24values.
25
26#cp src/od_config_template.coffee src/od_config.coffee
27#vi src/od_config.coffee
28
29Map the full org unit name for each branch (as displayed in the Home
30Library field of the Account Preferences tab in My Account in the OPAC)
31to its corresponding Overdrive authorization name (provided by
32Overdrive).
33
34Follow the comments in the file to create your oAuth credential in
35Base64 format.
36
37Add your account and website ID values as described here:
38https://developer.overdrive.com/apis/patron-auth
39
40Indicate whether a user password is required for Overdrive
41authentication (this depends on how your Overdrive account is
42configured). The no_password array should contain a comma-separated
43list of the full long name of each library that does not require
44passwords. Alternatively, you can modify the password_required block to
45always return true (if all your libraries require a password for
46Overdrive) or false (if none require a password).
47
48Edit the value for baseURL. This is your specific
49*.lib.overdrive.com/ContentDetails.htm URL. Overdrive can assist with
50finding this if you do not know it.
51
52Define productbaseURLs. This is the FQDN for your library specific URLs
53for Overdrive products (i.e. the domain name used in your links to
54Overdrive titles in MARC 856 tags).
8ebc3fff 55
8ebc3fff 56
19ec4380
SC
572. Compile source files from Coffeescript to Javascript
58
59(long form)
8ebc3fff
SC
60# coffee --compile --bare --output app src
61
62(short form)
63# coffee -cb -o app src
64
1bae196f
JD
65
663. Minify Javascript files (optional, but recommended)
8ebc3fff
SC
67# r.js -o build.js
68
1bae196f
JD
694. Deploy files to production server
70
71If you minified the files:
72# cp build/overdrive.js /openils/var/web/js/ui/default/opac
73
74If you did not minify the files:
75# cp app/* /openils/var/web/js/ui/default/opac
76
77
78C. Configuration of the TPAC template files
19ec4380 79
1bae196f
JD
80Merge the following commits from Sitka into your local Evergreen git repo.
81The best method for this is to add Sitka as a remote, and cherry-pick from it.
82You could also attempt to patch by hand, but this is prone to more errors.
19ec4380 83
1bae196f
JD
84# git remote add sitka git://git.sitka.bclibraries.ca/sitka/evergreen.git
85# git fetch sitka
19ec4380 86
1bae196f
JD
87http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=f8d5d13
88http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=b4e4270
89http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=2ba716b
90http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=946333b
91http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=4ab3d89
19ec4380 92
1bae196f 93(TODO: Make these changes available in a branch in the working repo.)
19ec4380 94
19ec4380 95
1bae196f
JD
96D. Enabling the mod_proxy_http module for Apache
97
981. Create the file /etc/apache2/mods-available/proxy_http.conf, with the
19ec4380
SC
99following contents.
100
101<IfModule mod_proxy_http.c>
102 SSLProxyEngine On
103 ProxyPass /od/oauth https://oauth.overdrive.com
104 ProxyPassReverse /od/oauth https://oauth.overdrive.com
105 ProxyPass /od/oauth-patron https://oauth-patron.overdrive.com
106 ProxyPassReverse /od/oauth-patron https://oauth-patron.overdrive.com
107 ProxyPass /od/api http://api.overdrive.com
108 ProxyPassReverse /od/api http://api.overdrive.com
109 ProxyPass /od/api-patron http://patron.api.overdrive.com
110 ProxyPassReverse /od/api-patron http://patron.api.overdrive.com
111 ProxyPass /od/images http://images.contentreserve.com
112 ProxyPassReverse /od/images http://images.contentreserve.com
113 ProxyPass /od/fulfill http://fulfill.contentreserve.com
114 ProxyPassReverse /od/fulfill http://fulfill.contentreserve.com
115</IfModule>
116
19ec4380 117
1bae196f
JD
1182. Ensure that the proxy_http module is enabled.
119
120# sudo a2enmod proxy_http.load
121
8ebc3fff 122
1bae196f 1233. Gracefully restart the Apache web service.
8ebc3fff 124
19ec4380
SC
125# sudo service apache2 graceful
126
127
128D. Web Browser
129
130Reload the browser at http://libraryname.servername.domainname/eg/opac/home, to
131run the home page of the OPAC. Ensure that the browser's cache is disabled.
132By monitoring the network traffic, you should see new JS and CSS files load, in
133the following approximate sequence.
134
135require.min.js
136overdrive.js
137jquery.min.js
138lodash.min.js
139cookies.min.js
140json3.min.js
141moment.min.js
142jquery-ui.min.js
143jquery-ui.min.css
144
1bae196f 145(You will see additional files if you did not minify JS.)
19ec4380 146