From ce48edd0cf28a460a44dab35c0d0f23176922197 Mon Sep 17 00:00:00 2001 From: withanage Date: Mon, 6 Mar 2017 15:09:58 +0100 Subject: [PATCH] Restructured documentation --- .gitignore | 1 + README.md | 88 ++------------------------------------- static/docs/DEVELOPERS.md | 27 ++++++++++++ static/docs/INSTALL.md | 21 ++++++++++ static/docs/SOLR.md | 26 +++++++++--- static/docs/VGWORT.md | 21 ++++++++++ 6 files changed, 94 insertions(+), 90 deletions(-) create mode 100644 static/docs/DEVELOPERS.md create mode 100644 static/docs/INSTALL.md create mode 100644 static/docs/VGWORT.md diff --git a/.gitignore b/.gitignore index eaeff253..c03f8939 100755 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ *.so *.pyc *.*~ +*.ipynb # Packages # ############ diff --git a/README.md b/README.md index f0e4ceae..93013adf 100755 --- a/README.md +++ b/README.md @@ -6,18 +6,10 @@ Table of Contents * [Demo](#demo) * [Features](#features) * [Installation](#installation) - * [Help Tools](#help-tools) - * [Solt Search](https://github.com/UB-Heidelberg/UBHD-OMPPortal/blob/categories/static/docs/SOLR.md) - * [VGWort Pixel Import](#vgwort-pixel-import) - * [Description](#description) - * [Installation](#installation-1) - * [Usage](#usage) - * [Add keys](#add-keys) - * [Run program](#run-program) - * [For developers](#for-developers) - * [General information](#general-information) - * [Folder structure](#folder-structure) - * [Additional information for customizations](#additional-information-for-customizations) + * Plugins + * [Solr Search](https://github.com/UB-Heidelberg/UBHD-OMPPortal/blob/categories/static/docs/SOLR.md) + * [VGWort Pixel Import](https://github.com/UB-Heidelberg/UBHD-OMPPortal/blob/categories/static/docs/VGWORT.md) + * [License](#license) * [Credits](#Credits) @@ -36,80 +28,8 @@ Table of Contents - Detailed usage statistics - Easy migration using web2py app structure - VGWORT plugin for royalties (for Germany, requires pythonn- urllib to check if the vgwort is enabled ) -- Solr Plugin (Work in progress) - -# Installation -- Prerequisites - 1. Install Open Monograph Press. See [documentation](http://pkp.sfu.ca/omp/README) - 2. Install web2py - 1. [Download] (http://web2py.com/init/default/download) web2py - 2. Unzip it - 3. change directory to the the unzipped folder - 4. If you have python installed : run ```python2.7 web2py.py``` or install [python](https://www.python.org/downloads/release/python-2710/) for your distribution -- Install UBHD-OMPPortal - 1. ```cd web2py_folder/applications/``` - 2. ```git clone https://github.com/UB-Heidelberg/UBHD-OMPPortal.git press_name``` - - Notice: press_name *should* contain only characters, numbers or _ - - Please do not use **-** in the **press_name** - 3. Change the settings for your local omp installation private/appconfig.ini - 1. **username** and **password** for the OMP database - 2. **press_id** of the local omp press - 3. define the **press_name** you selected when cloning from git - 4. Mount or symlink the files folder of the OMP to **web2py_folder**/applications/**press_name**/static/monographs/ - - ``` - ln -s web2py_folder/applications/press_name/static/monographs/ omp_folder/files/presses/press_id/monographs - ``` - -# Help Tools -## VGWort Pixel Import -### Description - This tool imports royalty information for germany's vgwort using a Excel File -### Installation - 1. Requires python xlrd library ```sudo pip2 install xlrd``` - -## Solr Plugin -### Description - -### Usage - -#### Add keys - - Add new VGWORT keys to UBHD_OMPPortal/static/utils/vgwort.xls - - ``` cd $WEB2PY_HOME/ ``` - which may be something like - ``` - cd /usr/local/web2py/ - ``` - -#### Run program - ``` - python web2py.py -R applications/UBHD_OMPPortal/static/utils/vgwortInsertBySubmission.py -M --shell UBHD_OMPPortal - ``` - -# For developers - -## General information - - A general knowledge in python and sql is necessary for further development. - - Some basic knowledge in web2y is helpful. See [docs](http://web2py.com) - - The OJS intergration is in progress. - - We have included a minified [lens](https://github.com/elifesciences/lens/) viewer. If you want to customize it, either use the [lens git](https://github.com/elifesciences/lens/) or [contact us](mailto:dulip.withanage@gmail.com). We will be happy to help you. - -## Folder structure -**strictly follows MVC (Model-View-Control) design principle** - - **controllers** - contains all the functions for enabling pages. - - **cron** - automated tasks - - **databases** - automatically generated by web2py. Do not edit this folder contents - - **languages** - language files. Web2py generates automatic entries for any word written in T() Block. e.g. T('word') in python files or {{=T('word')}} in HTML. Default language is english. - - **models** - database models for Open monograph press. Web2py uses a data abstraction layer. - - **private** - all the files, which contain sensitive information and configuration files - - **modules** - table mappings of omp and varibales that are globally accessible from the application. - - **static** - all the static files as such as javascript files and css files. - - **views** - for each controller (e.g. catalog.py) file, you have to add a folder with the same name (e.g. catalog) and a html file (index.html) for each function in the controller file. -## Additional information for customizations --Book view - - Current book details page views/catalog/book.html displays xml files in the lens viewer, if you name the category into XML. But this can ba changed in private/appconfig.ini # License This software is released under the the [GNU General Public License](LICENSE.md). diff --git a/static/docs/DEVELOPERS.md b/static/docs/DEVELOPERS.md new file mode 100644 index 00000000..835a8095 --- /dev/null +++ b/static/docs/DEVELOPERS.md @@ -0,0 +1,27 @@ +* [For developers](#for-developers) + * [General information](#general-information) + * [Folder structure](#folder-structure) + * [Additional information for customizations](#additional-information-for-customizations) + +## General information + - A general knowledge in python and sql is necessary for further development. + - Some basic knowledge in web2y is helpful. See [docs](http://web2py.com) + - The OJS intergration is in progress. + - We have included a minified [lens](https://github.com/elifesciences/lens/) viewer. If you want to customize it, either use the [lens git](https://github.com/elifesciences/lens/) or [contact us](mailto:dulip.withanage@gmail.com). We will be happy to help you. + +## Folder structure +**strictly follows MVC (Model-View-Control) design principle** + + - **controllers** - contains all the functions for enabling pages. + - **cron** - automated tasks + - **databases** - automatically generated by web2py. Do not edit this folder contents + - **languages** - language files. Web2py generates automatic entries for any word written in T() Block. e.g. T('word') in python files or {{=T('word')}} in HTML. Default language is english. + - **models** - database models for Open monograph press. Web2py uses a data abstraction layer. + - **private** - all the files, which contain sensitive information and configuration files + - **modules** - table mappings of omp and varibales that are globally accessible from the application. + - **static** - all the static files as such as javascript files and css files. + - **views** - for each controller (e.g. catalog.py) file, you have to add a folder with the same name (e.g. catalog) and a html file (index.html) for each function in the controller file. + +## Additional information for customizations +- Book view + - Current book details page views/catalog/book.html displays xml files in the lens viewer, if you name the category into XML. But this can ba changed in private/appconfig.ini \ No newline at end of file diff --git a/static/docs/INSTALL.md b/static/docs/INSTALL.md new file mode 100644 index 00000000..d1b62b2e --- /dev/null +++ b/static/docs/INSTALL.md @@ -0,0 +1,21 @@ +# Installation +- Prerequisites + 1. Install Open Monograph Press. See [documentation](http://pkp.sfu.ca/omp/README) + 2. Install web2py + 1. [Download] (http://web2py.com/init/default/download) web2py + 2. Unzip it + 3. change directory to the the unzipped folder + 4. If you have python installed : run ```python2.7 web2py.py``` or install [python](https://www.python.org/downloads/release/python-2710/) for your distribution +- Install UBHD-OMPPortal + 1. ```cd web2py_folder/applications/``` + 2. ```git clone https://github.com/UB-Heidelberg/UBHD-OMPPortal.git press_name``` + - Notice: press_name *should* contain only characters, numbers or _ + - Please do not use **-** in the **press_name** + 3. Change the settings for your local omp installation private/appconfig.ini + 1. **username** and **password** for the OMP database + 2. **press_id** of the local omp press + 3. define the **press_name** you selected when cloning from git + 4. Mount or symlink the files folder of the OMP to **web2py_folder**/applications/**press_name**/static/monographs/ + + ``` + ln -s web2py_folder/applications/press_name/static/monographs/ omp_folder/files/presses/press_id/monographs \ No newline at end of file diff --git a/static/docs/SOLR.md b/static/docs/SOLR.md index fbbc3276..cde01cb2 100644 --- a/static/docs/SOLR.md +++ b/static/docs/SOLR.md @@ -1,6 +1,6 @@ # Installation -## (Ubuntu / Debian Systems) +Cut and paste for (Ubuntu / Debian Systems) for other systems, plese see relevent docucmentation ### Install JDK, if not installed. ``` @@ -18,6 +18,10 @@ sudo apt-get update sudo apt-get install oracle-java8-installer java -version ``` + + + + ### Install Solr ``` cd /tmp/ @@ -28,20 +32,30 @@ sudo ./install_solr_service.sh solr-6.4.1.tgz Solr will be installed under /opt/solr and it start in port 8983 Check with [http://localhost:8983/solr](http://localhost:8983/solr) + + +--- + + ### Install Python dependancy ``` sudo pip install sunburnt ``` -# Configuration -## Create a OMP Collection and scheme +## Configuration + + +### Create a OMP Collection and scheme ``` sudo su - solr -c "/opt/solr/bin/solr create -c presss_portal -n omp" ``` -## Install Python dependancy + + +### Copy solr schema.xml in to your solr directory ``` -sudo pip install sunburnt -``` +cp /UBHD_OMPPortal/static/utils/solr/schema.xml /data/presss_portal/conf + ``` + diff --git a/static/docs/VGWORT.md b/static/docs/VGWORT.md new file mode 100644 index 00000000..af95e310 --- /dev/null +++ b/static/docs/VGWORT.md @@ -0,0 +1,21 @@ +## VGWort Pixel Import +### Description + This tool imports royalty information for germany's vgwort using a Excel File +### Installation +- Requires python xlrd library + + ```sudo pip2 install xlrd``` + + +#### Configuration + - Add new VGWORT keys to UBHD_OMPPortal/static/utils/vgwort.xls + + +#### Run program +- Change directory in to web2py folder + + ``` cd /usr/local/web2py/ ``` +- Execute + + ```python web2py.py -R applications/UBHD_OMPPortal/static/utils/vgwortInsertBySubmission.py -M --shell UBHD_OMPPortal ``` +