This Django project allows to browse a large base of XML documents using faceted browsing. It relies on Django-haystack to manage the faceting. Several search-indexing systems can be used in Django-haystack, such as Solr or ElasticSearch.
xmlfacets requires Python 2.7 and PostgreSQL.
To set up a local development environment, install Fabric
and make sure you have the following dependencies
- libxml2
- libxslt
- Optional: Watchdog, for use with the
fab watch_static
command to automatically collect and compile static files as they are changed.
- Run the command
fab setup
inside the project directory - Edit the generated "editorsnotes/settings_local.py" file with your database information
- Run
fab sync_database
- Start the development server with
fab runserver
More specifically, for Ubuntu Linux 12.04TLS:
-
Postgresql
sudo apt-get install postgresql sudo apt-get install pgadmin3sudo -u postgres psql postgres sudo apt-get install postgresql-client sudo apt-get install postgresql-server-dev-9.1
sudo -u postgres createuser -P -s xmlfacets sudo -u postgres createdb -O xmlfacets xmlfacets
-
Fabric sudo pip install fabric
-
libxml2 + libxslt sudo apt-get install libxml2
sudo apt-get install libxml2-dev libxslt-dev
-
Elastic Search
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.0.deb sudo dpkg -i elasticsearch-1.1.0.deb sudo service elasticsearch start
-
Libgeos is required to use geographical positions
sudo apt-get install libgeos-dev
-
Virtual Environment
sudo pip install virtualenv
-
Install flup
To use it with Apache2/fcgi, install flup
sudo pip install flup
-
Inside xmlfacets directory
fab setup
-
Database
edit xmlfacets/settings_local.py with database info, then: fab sync_database
you will be asked the name of the administrator login/pw, let's call it "admin"
-
Start the debug server and check the site:
fab runserver
open on a web browser http://localhost:8000/
-
Import existing XML documents
Importing one XML document in /SVN-REPOS/ALBANIA/AL/ImportMe.xml bin/python manage.sh import -u admin -p /SVN-REPOS/ /SVN-REPOS/ALBANIA/AL/ImportMe.xml
Assume all the documents are at directory /SVN-REPOS, to import the all, type:
./import.sh /SVN-REPOS admin
-
Import existing XML documents using the Cendari API
bin/python manage.py import_cendari -a 'CKAN-API-KEY' -u 'username'