Skip to content

Experimental implementation. Aims to replace relational database/django by xml technologies

License

Notifications You must be signed in to change notification settings

EditionOpenAccess/eoa2-xmldb

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
res
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 

eoa2-xmldb

Experimental implementation. Aims to replace relational database/django by xml technologies

It can be used either with Docker or in virtual environment with an external eXist database.

Docker

Dependencies

Scripts to control the Webserver

  • Initialize the repository

      $ git_deps
      $ ./scripts/install.py
    
  • Start the Webserver

      $ ./scripts/run.py
    
  • Create superuser for django CMS:

      $ ./scripts/exec_in_container.py 'python manage.py createsuperuser'
    

    (enter username, etc)

  • enter basic CMS pages

    in your browser, go to 'http://localhost:8002/admin/cms/page/'. Add 3 pages:

    • Introduction (Id: 'intropage')
    • Contact (Id: 'contact')
    • Imprint (Id: 'imprint')

    These are required by the system!

  • Import example publication (similar for other publications):

      $ ./scripts/exec_in_container.py 'python manage.py publication_import $INPUT_DIR/125_tei_part'
    

    (you'll need to stop and start the webserver afterwards)

  • Stop the Webserver

      $ ./scripts/stop.py
    
  • Clean up the repository

      $ ./scripts/uninstall.py
    

Other Scripts

  • see './scripts/'. All scripts accept --help.

Extend Functionality and Design using XSLT Scripts

  1. Let a complete page be rendered using an XSL stylesheet:

    • in your browser, go to the django admin interface localhost:8002/admin. In the "XSL" row, create an new "instance", e.g. named "example" of the xsl app. Enter the xml file you want to render using the stylesheet, stylesheet, and the stylesheet parameters (don't forget to enter required parameters!) (demo example: xml file: example.xml, stylesheet: example_fullpage.xsl)

    • click "Save"

    • back to localhost:8002/admin

    • under "Pages", add a new page that you want to be rendered using xsl

    • click "Save and continue editing"

    • open "Advanced Settings":

      • under "Application", select "XSL Apphook"
      • under "Application Configurations:", select the instance, you just created (e.g. "example")
      • click "Save"

    Test the created webpage. If you get an error, most likely an exception occured in the stylesheet (are you missing a required parameter?).

  2. render parts of a page using an XSL stylesheet:

    • in your browser, go to the page, on which you want some content to be rendered via an xsl script.
    • in the cms bar, click on "Edit"
    • toggle "Structure Mode"
    • add the "XSL Plugin" Enter the xml file you want to render using the stylesheet, stylesheet, and the stylesheet parameters (don't forget to enter required parameters!) (demo example: xml file: example.xml, stylesheet: example_list.xsl)
    • click "Save"

    Test the created page. If you get an error, most likely an exception occured in the stylesheet (are you missing a required parameter?).

Install new Stylesheets

- copy your stylesheet, e.g. `stylesheet.xsl` to `res/xml/stylesheets/`
- stop the webserver, if running
- `./scripts/install.py`, to synchronise `res` -> `runtime_data/res.rt`
- restart webserver, to make the xml database recognise the stylesheet

Your stylesheet can be selected for rendering via django cms now.

git_deps

For dependant packages, specify the git hash in dependencies.conf and re-run git_deps_py. It might complain about the repositor already existing. Remove the repository and run git_deps_py again.

Virtual Environment

For installation in a virtual environment, perform the following steps

- virtualenv eoaxmldb
- cd eoaxmldb
- source bin/activate
- git clone https://github.molgen.mpg.de/EditionOpenAccess/eoa2-xmldb.git
- cd eoa2-xmldb
- pip3 install -r requirements.txt
- cd src
- python manage.py migrate
- python manage.py createsuperuser (klaus/3333)
- python manage.py runserver localhost:8003

Design files

You should obtain the webdesign files from https://github.molgen.mpg.de/EditionOpenAccess/webdesign_platform and build them. Then copy the contents of the dist folder to the project

- rm ../res/static/webdesign_platform
- mkdir -p ../res/static/webdesign_platform
- cp -r $path_to_webdesign_platform/dist/a{pp,ss}* ../res/static/webdesign_platform

About

Experimental implementation. Aims to replace relational database/django by xml technologies

Resources

License

Stars

Watchers

Forks

Releases

No releases published