README
TableView version 0.01 ======================
This is an initial development release of code in progress. Hackers and other help welcome!
A TableView displays a folder of objects as an HTML table. Each object in the folder is displayed as a row in the table, and the columns show property values from the objects.
You can also use a ZClass that subclasses from ObjectManager. So if you have a CD_Collection class that contains CD objects, the TableView will display your collection of CD's.
Goals of the project:
- Create a general-purpose Zope interface for editing data in a tabular format.
- Let users easily arrange a list of items in a particular order.
- Allow web site designers to display information in an HTML table
with needing to know the ins and outs of HTML coding with the
tag.
INSTALL ======= Unpack TableView-0.01.tgz or .zip, and you'll get a "Products" and an "import" directory.
Copy Products/TableView into your
/lib/python/Products directory. Copy import/TableView.zexp into your
/import directory. You may need to create your "import" directory if it doesn't exist yet. Restart Zope. Go into Control_Panel/Product_Management. You will see "TableView (Installed product TableView)". This is good. This means the Python mixin classes got loaded.
Next step is to import the TableView classes; however we need to first delete the "TableView" product that Zope automatically created when it saw the Python code in the Products/TableView directory. So click the checkbox next to "TableView (Installed product TableView)", and click the Delete button.
Now to import. Click on the Export... button. Scroll down, and in "Import file name" type in "TableView.zexp". Click on Import.
CREATING A TABLEVIEW ====================
You want the TableView to the aquirable from the displayed Folder, but not inside the folder itself. So organize like this:
/example | - /myfolder | | - object1 | | - object2 | | - object3 | | - /tableView
For objects in "myfolder" you can use anything that has properties, such as DTML Documents. (The contents of the Document would be ignored by the TableView; it only looks at the properties).
In the management screen for the TableView, you'll see a "Columns" tab. Add a column for each column you want to display in the table. Enter anything for the id of the column; it's ignored.
Properties of columns:
columnTitle: title of the column displayed in the first row of the table.
columnOrder: enter "1" for the first column, "2" for the second, and so on.
columnProperty: enter the name of the property in the object that will be displayed in this column.
Great! A TableView has a default index_html, so now you can go to http://myzopeserver.com/example/myfolder/tableView, and and you'll see the table displayed.
To render the table inside of your own page, you can call tableView.renderTable(REQUEST). So, let's say you put a "showAsTable" DTML Method inside of "example":
Here's the stuff:
Now you can go to http://myzopeserver.com/example/myfolder/showAsTable, and it will find the showAsTable method up in "example" by acquisition.
FEEDBACK ======== Can't get it to work? Missing features? Did exactly what you needed? Let me know at
. BUGS ==== Bypasses security. Objects will be displayed in a TableView row even if the user does not have "View" permission for the object.
Looking for the folder in the REQUEST.PARENTS is seems awkward. Might it break easily?
TODO and IDEAS ============== Should a TableView be a superclass for ZClass containers, which would then add renderTable method to the user's ZClass? Hmm, but then how to have more than one TableView for a collection?
Table options: align, valign.
Column options: left, right, center alignment; font; bold; italic.
An [edit] link in each row to take the user to the manage_edit screen of the object.
An [arrange] button to let the user rearrange the order of the rows.
When the above is done, use a TableView for the column specifications!
Hierarchical display of folders and subfolders a'la tree tag.
Other ideas or desirable features? Let me know at
.