Difference between revisions of "ESciDoc Admin"
Line 102: | Line 102: | ||
==== Testing the Installation ==== | ==== Testing the Installation ==== | ||
Note: The following tests assume that escidocadmin is configured to access a running core services instance. | |||
1. You can test your installation by running the unit tests with [http://somethingaboutorange.com/mrl/projects/nose/ nose]. | 1. You can test your installation by running the unit tests with [http://somethingaboutorange.com/mrl/projects/nose/ nose]. |
Revision as of 19:44, 24 June 2008
Overview[edit]
eSciDoc admin is a a solution for the management of master data in an installation of the eSciDoc core services. Currently it is implemented as TurboGears web application talking to the core service handler's REST interfaces.
It implements (parts of) the use cases specified in
- PubMan_Func_Spec_Organizational_Unit_Management
- PubMan_Func_Spec_Collection_Administration
- PubMan_Func_Spec_User_Management
Repository URL: https://subversion1.escidoc.mpg.de/admin/
Installation/Deployment[edit]
Requirements[edit]
- Python (>= 2.4),
- TurboGears (>= 1.0.1, <= 1.0.3.4) (see http://docs.turbogears.org/1.0/Install for details),
- SQLAlchemy (0.3.x) (download from http://www.sqlalchemy.org/download.html and install from source package with easy_install),
- Depending on your platform it may be necessary to upgrade to a newer version of pysqlite.
Notes[edit]
To install a compatible version of TurboGears download the setup script http://www.turbogears.org/download/tgsetup.py and change
TGVERSION = "1.0.4.4"
to
TGVERSION = "1.0.3.4"
then run
python tgsetup.py
To install a compatible version of sqlalchemy, download the correct version with the link above and use easy_install
easy_install SQLAlchemy-0.3.11.tar.gz
Download[edit]
You may download the application as egg appropriate for your architecture:
TODO
Or run eSciDoc admin from a repository checkout: run
svn co https://subversion1.escidoc.mpg.de/admin/trunk/escidocadmin
in a suitable directory.
Deployment[edit]
Configuration[edit]
To configure eSciDoc admin, you need to provide several settings in a configuration file (possibly using test.cfg as a template). Details about syntax and semantic of the runtime configuration can be found on the TurboGears site. In the following we explain eSciDoc admin specific settings.
You need to supply some basic configuration settings for the application by adding the following lines to the global section of the configuration file.
Configure the core services instance to which to talk
framework.host="host[:port]"
Provide a database connection string:
sqlalchemy.dburi="sqlite:///path/to/sqlite/db"
Note: If you give an absolute path to the sqlite db file, the connection URI should start with "sqlite:////", i.e. 4 slashes.
When deploying the web application behind a proxy (e.g. apache), make sure to set
server.webpath="http://your.domain/escidoc/admin/path/"
Depending on your usage of the admin application, you have to specify
server.environment="development|production" autoreload.package="escidocadmin|"
To enable sessions you need to set:
session_filter.on = True
You may rename the configuration file (here: test.cfg) to dev.cfg to have it picked up by TurboGears automatically.
Database Initialization[edit]
eSciDoc admin stores session data in a sqlite database. To initialize this database run
tg-admin sql create
in the application directory, i.e. in the directory where the configuration file resides.
Controlling the Application[edit]
You may use the start-escidocadmin.py script to start the application from the commandline.
Testing the Installation[edit]
Note: The following tests assume that escidocadmin is configured to access a running core services instance.
1. You can test your installation by running the unit tests with nose.
Running
nosetests --exclude=twill_tests.py
in the application directory should result in something like
.......... ---------------------------------------------------------------------- Ran 10 tests in 7.039s
OK
2. You can test your running application with twill as follows. Start the application
./start-escidocadmin
then run
./twill_tests.py --cfg=/path/to/config USER PASSWORD
Warning: Running the twill tests assumes a set of existing resources in the framework administration. The tests will alter these resources and add new ones. So don't run these tests on a framework with valuable data.
Running eSciDoc admin behind Apache HTTPD[edit]
To run eSciDoc admin behind Apache HTTPD add the following to your apache configuration:
RewriteRule ^/escidoc/admin/path/(.*) http://127.0.0.1:8080/$1 [proxy,L] <Location /escidoc/admin/path> Order allow,deny Allow from all </Location>
Technical Documentation[edit]
Overview[edit]
eSciDoc admin manages resources of the following kinds:
- Organizational Units, abbreviated ou,
- Contexts, abbreviated ctx,
- User Accounts (and Grants), subsumed under aa (for authentication and authorization).
Automatically generated package documentation is available in the repository.
Architecture[edit]
eSciDoc admin - as a web interface to a REST API supporting basic CRUD operations - has a very simple architecture:
- All communication with the core services resource handlers is implemented in a core services client library
- As a TurboGears aplication, escidocadmin subscribes to the MVC pattern, or better the VC pattern, because the persistence layer is implemented by the eSciDoc core services.
- The management logic for each resource is implemented in one controller class.
- The views for each resource are implemented in one (or several) templates.
Core services Client Library[edit]
The core services client library provides a client class which mediates access to a core services installation much like a database connection mediates access to a database.
Since resources are transferred between core service resource handlers and clients as xml representations, the client library treats resources basically as (wrapped) xml dom objects (more precisely as etree.Element instances). A Resource instance is initialized with an appropriate Element of a parsed core service resource handler response, and can be serialized for passing it back to the core service resource handler.
User Management[edit]
eSciDoc admin uses eSciDoc user accounts to access the core services resource handlers. After successful authentication with the external identity provider the admin application receives a token which is subsequently used to authenticate requests to the core service resource handlers (see login_finish).