
1. Install Product
# cd /path/to/zope/Products # tar zxvf Hornet-version.tar.gz
Requirements
- A Zope Database Adapter. We have currently only tested with ZMySQLdb (We internally use a custom ZMySQLdb adapter modified for speed, however the standard one will work)
-
If using MySQL, you need to use mysql-python > 2.0.
0.9 is distributed with many linux distributions and will *NOT* work. You can download both mysql-python and the Zope MySQL adapter from http://sourceforge.net/projects/mysql-python/
2. Configure Plone (Optional)
We intend Hornet to be able to function completely independant of CMF/Plone, However the current pre-alpha builds work best with it.
- While logged in as a manager, Go to "Plone Setup" => "Add/Remove Products"
- Select the checkbox next to 'Hornet' and click 'Install' at the bottom of the form
3. Setup Hornet
- Create a `Hornet Mount Point` at the root of your portal;
id can be anything but we recommend using db_dbname (where dbname is your database name) - Inside the Hornet Mount Point, choose the tab 'Setup'
- Choose DB Connection to use
If none are defined, you can create a MySQL connection using the `Add New` button,
or any standard Zope Database Adapter using the Zope Management Interface
After you create your connection, return to the Hornet Mount Point 'Setup' Tab. - A list of available tables should be displayed. Select all that you wish to mount and click 'Create Hornet Folders'
- Hornet will attempt to guess a Folder name and primary key, however you can override if required. Once you are happy click 'Mount'
- A Hornet Folder should now exist in your Mount Point for each table you mounted. You can now browse the database using the `Contents` Tab, and access each object programatically as if it were a zope object*
* (Currently you must treat a Hornet Folder as a dictionary (i.e. folder[record]) rather than folder.record; this is due to problems with Acquisition which we are attempting to overcome).
As a test, try creating a page template to view/edit your records and call it in context (i.e. /mountpoint/table/id/template_name).
You can edit any record by posting form data to manage_main in the context of a record
You can create new records by posting to folder/create/manage_edit
(i.e. hornet_articles/articles/create/manage_edit)
You can delete records by deleting the corrosponding record object from the Hornet Folder (You can safely delete the Hornet Folder or Mount Point without deleting your entire table)
The standard Zope objectValues/objectIds etc methods will work, and any standard folder view (i.e. folder_contents) will work.
Hornet support subclassing the standard types to create archetypes style objects. API Documentation for this is still pending