From: richard Date: Tue, 10 Sep 2002 07:07:16 +0000 (+0000) Subject: more doc X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a0161e1c5ebc4fef4a65b01934224e9e05bcbedd;p=roundup.git more doc git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1119 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/TODO.txt b/TODO.txt index eb01a9f..542e3da 100644 --- a/TODO.txt +++ b/TODO.txt @@ -15,7 +15,6 @@ pending hyperdb: range searching of values (dates in particular) pending hyperdb: make creator, creation and activity available pre-commit pending hyperdb: migrate "id" property to be Number type pending instance: split instance.open() into open() and login() -pending instance: rename to "instance" to "tracker" pending mailgw: allow commands (feature request #556996) like "help", "dump issue123" (would send all info about issue123, including a digest of all messages, but probably @@ -28,11 +27,11 @@ pending mailgw: Allow multiple email addresses at one gw with different default vmbugs: "|roundup-mailgw /instances/dev component=voicemail" pending project: switch to a Roundup instance for Roundup bug/feature tracking pending project: have the demo allow anonymous login -pending security: at least an LDAP user database implementation +pending security: an LDAP user database implementation pending security: authenticate over a secure connection pending security: optionally auth with Basic HTTP auth instead of cookies pending security: use digital signatures in mailgw -pending security: submission protection +pending security: submission protection (ok, I've forgotten what this is) pending web: I18N pending web: Better message summary display (feature request #520244) pending web: Navigating around the issues (feature request #559149) @@ -45,7 +44,6 @@ pending web: search "refinement" - pre-fill the search page with the current search parameters) - add a drop-down with all queries which fills form with selected query values -pending web: have roundup.cgi pick up instance config from the environment pending web: UNIX init.d script for roundup-server pending web: rewritten documentation (can come after the beta though so stuff is settled) ... including relevant file names in customisation doc @@ -54,16 +52,9 @@ pending admin: add "unset" command pending dist: include the HTML in docs bug web: request.url is incorrect in cgi-bin environments -bug web: query editing not translated to new templating bug web: need to indicate that generated pages shouldn't be cached -done web: Re-enable link backrefs from messages (feature request #568714) -done web: have the page layout (header/footer) be templatable -done web: fixing the templating so it works -done web: re-work cgi interface to abstract out the explicit "issue" - interface -done web: have index page handle mid-page errors better so header and - footer are still visible +done instance: rename to "instance" to "tracker" done hyperdb: write a backend for gadfly (it's as done as it's going to get) done hyperdb: full-text search also search certain String properties done hyperdb: further split the *dbm backends from the core code, allowing @@ -76,11 +67,19 @@ done mailgw: better help message (feature request #558562) done security: add info from doc/security.txt to design doc done security: switch to sessions for web authentication done security: implement and use the new logical control mechanisms +done web: Re-enable link backrefs from messages (feature request #568714) +done web: have the page layout (header/footer) be templatable +done web: fixing the templating so it works +done web: re-work cgi interface to abstract out the explicit "issue" + interface +done web: have index page handle mid-page errors better so header and + footer are still visible done web: saving of named queries (GM, RJ) done web: handle "not found", access and item page render errors better done web: fix double-submit by having new-item-submit redirect at end done web: daemonify roundup-server (fork, logfile, pidfile) done web: modify cgitb to display PageTemplate errors better +done web: have roundup.cgi pick up instance config from the environment rejected instance: the use of non-Python configuration files (ConfigParser) diff --git a/doc/customizing.txt b/doc/customizing.txt index 00ccea6..7d5c922 100644 --- a/doc/customizing.txt +++ b/doc/customizing.txt @@ -2,7 +2,7 @@ Customising Roundup =================== -:Version: $Revision: 1.25 $ +:Version: $Revision: 1.26 $ .. This document borrows from the ZopeBook section on ZPT. The original is at: http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx @@ -11,7 +11,7 @@ Customising Roundup What You Can Do ---------------- +=============== Customisation of Roundup can take one of five forms: @@ -28,30 +28,25 @@ includes adding or removing properties from classes. Trackers in a Nutshell ----------------------- +====================== Trackers have the following structure: -+-------------------+--------------------------------------------------------+ -|config.py |Holds the basic `tracker configuration`_ | -+-------------------+--------------------------------------------------------+ -|dbinit.py |Holds the `tracker schema`_ | -+-------------------+--------------------------------------------------------+ -|interfaces.py |Defines the Web and E-Mail interfaces for the tracker | -+-------------------+--------------------------------------------------------+ -|select_db.py |Selects the database back-end for the tracker | -+-------------------+--------------------------------------------------------+ -|db/ |Holds the tracker's database | -+-------------------+--------------------------------------------------------+ -|db/files/ |Holds the tracker's upload files and messages | -+-------------------+--------------------------------------------------------+ -|detectors/ |Auditors and reactors for this tracker | -+-------------------+--------------------------------------------------------+ -|html/ |Web interface templates, images and style sheets | -+-------------------+--------------------------------------------------------+ +=================== ======================================================== +Tracker File Description +=================== ======================================================== +config.py Holds the basic `tracker configuration`_ +dbinit.py Holds the `tracker schema`_ +interfaces.py Defines the Web and E-Mail interfaces for the tracker +select_db.py Selects the database back-end for the tracker +db/ Holds the tracker's database +db/files/ Holds the tracker's upload files and messages +detectors/ Auditors and reactors for this tracker +html/ Web interface templates, images and style sheets +=================== ======================================================== Tracker Configuration ---------------------- +===================== The config.py located in your tracker home contains the basic configuration for the web and e-mail components of roundup's interfaces. This @@ -183,7 +178,7 @@ tracker is attempted.:: #MAIL_DEFAULT_CLASS = '' # disable (or just comment the var out) Tracker Schema --------------- +============== Note: if you modify the schema, you'll most likely need to edit the `web interface`_ HTML template files and `detectors`_ to reflect @@ -241,7 +236,7 @@ tracker. The "classic" schema looks like this:: XXX security definitions Classes and Properties - creating a new information store -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------------------------------------------------------- In the tracker above, we've defined 7 classes of information: @@ -275,7 +270,7 @@ issue (which is stored as a single number) we reduce the chance that someone mis-types a priority or status - or simply makes a new one up. Class and Items -::::::::::::::: +~~~~~~~~~~~~~~~ A Class defines a particular class (or type) of data that will be stored in the database. A class comprises one or more properties, which given the information @@ -285,7 +280,7 @@ items. They have a special immutable property called id. We sometimes refer to this as the itemid. Properties -:::::::::: +~~~~~~~~~~ A Class is comprised of one or more properties of the following types: @@ -303,7 +298,7 @@ A Class is comprised of one or more properties of the following types: The value is a list of integers. FileClass -::::::::: +~~~~~~~~~ FileClasses save their "content" attribute off in a separate file from the rest of the database. This reduces the number of large entries in the database, @@ -312,7 +307,7 @@ command-line tools to operate on the files. They are stored in the files sub- directory of the db directory in your tracker. IssueClass -:::::::::: +~~~~~~~~~~ IssueClasses automatically include the "messages", "files", "nosy", and "superseder" properties. @@ -331,7 +326,7 @@ records in the item's journal). The "creator" property holds a link to the user that created the issue. setkey(property) -:::::::::::::::: +~~~~~~~~~~~~~~~~ Select a String property of the class to be the key property. The key property muse be unique, and allows references to the items in the class by the content @@ -349,20 +344,20 @@ or:: Note, the same thing can be done in the web and e-mail interfaces. create(information) -::::::::::::::::::: +~~~~~~~~~~~~~~~~~~~ Create an item in the database. This is generally used to create items in the "definitional" classes like "priority" and "status". Examples of adding to your schema -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------------------------------- TODO Detectors - adding behaviour to your tracker --------------------------------------------- +============================================ .. _detectors: The detectors in your tracker fire before (*auditors*) and after (*reactors*) @@ -399,7 +394,7 @@ XXX give the example here. Database Content ----------------- +================ Note: if you modify the content of definitional classes, you'll most likely need to edit the tracker `detectors`_ to reflect your changes. @@ -422,7 +417,7 @@ XXX example Web Interface -------------- +============= The web is provided by the roundup.cgi.client module and is used by roundup.cgi, roundup-server and ZRoundup. @@ -434,7 +429,7 @@ the access through its main() method. This means that you can do pretty much anything you want as a web interface to your tracker. Repurcussions of changing the tracker schema -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------------------------------------------- If you choose to change the `tracker schema`_ you will need to ensure the web interface knows about it: @@ -445,7 +440,7 @@ interface knows about it: page's content arguments. How requests are processed -~~~~~~~~~~~~~~~~~~~~~~~~~~ +-------------------------- The basic processing of a web request proceeds as follows: @@ -469,7 +464,7 @@ In some situations, exceptions occur: this exception percolates up to the CGI interface that called the client Determining web context -~~~~~~~~~~~~~~~~~~~~~~~ +----------------------- To determine the "context" of a request, we look at the URL and the special request variable ``:template``. The URL path after the tracker identifier @@ -516,7 +511,7 @@ which defaults to: Performing actions in web requests -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +---------------------------------- When a user requests a web page, they may optionally also request for an action to take place. As described in `how requests are processed`_, the @@ -570,7 +565,7 @@ Each of the actions is implemented by a corresponding *actionAction* (where "action" is the name of the action) method on the roundup.cgi.Client class, which also happens to be in your tracker as interfaces.Client. So if you need to define new actions, you may add them -there (see `definining new web actions`_). +there (see `defining new web actions`_). Each action also has a corresponding *actionPermission* (where "action" is the name of the action) method which determines @@ -605,7 +600,7 @@ search Default templates -~~~~~~~~~~~~~~~~~ +----------------- Most customisation of the web view can be done by modifying the templates in the tracker **html** directory. There are several types of files in there: @@ -634,12 +629,12 @@ style.css a static file that is served up as-is Overall Look - "page" template -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------------ XXX How the templates work -~~~~~~~~~~~~~~~~~~~~~~ +---------------------- Roundup's templates consist of special attributes on your template tags. These attributes form the Template Attribute Language, or TAL. The commands are: @@ -761,7 +756,7 @@ Python Expressions - eg. ``python: 1+1`` a method. Information available to templates -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +---------------------------------- The following variables are available to templates. @@ -791,7 +786,7 @@ The following variables are available to templates. XXX a special variable The context variable -:::::::::::::::::::: +~~~~~~~~~~~~~~~~~~~~ The *context* variable is one of three things based on the current context (see `determining web context`_ for how we figure this out): @@ -812,7 +807,7 @@ The only real difference between cases 2 and 3 above are: The request variable -:::::::::::::::::::: +~~~~~~~~~~~~~~~~~~~~ The request variable is packed with information about the current request. @@ -838,7 +833,7 @@ Variable Holds =========== ================================================================ columns dictionary of the columns to display in an index page show a convenience access to columns - request/show/colname will - be true if the columns should be displayed, false otherwise + be true if the columns should be displayed, false otherwise sort index sort column (direction, column name) group index grouping property (direction, column name) filter properties to filter the index on @@ -848,7 +843,7 @@ search_text text to perform a full-text search on for an index Displaying Properties -~~~~~~~~~~~~~~~~~~~~~ +--------------------- Properties appear in the user interface in three contexts: in indices, in editors, and as search arguments. @@ -859,13 +854,13 @@ displayed in an editable field. Index Views -~~~~~~~~~~~ +----------- This is one of the class context views. It is also the default view for classes. The template used is "*classname*.index". Index View Specifiers -::::::::::::::::::::: +~~~~~~~~~~~~~~~~~~~~~ An index view specifier (URL fragment) looks like this (whitespace has been added for clarity):: @@ -873,7 +868,7 @@ added for clarity):: /issue?status=unread,in-progress,resolved& topic=security,ui& :group=+priority& - :sort=-activity& + :sort==activity& :filters=status,topic& :columns=title,status,fixer @@ -899,12 +894,12 @@ the "status" and "topic" properties, and the table includes columns for the "title", "status", and "fixer" properties. Filtering of indexes -:::::::::::::::::::: +~~~~~~~~~~~~~~~~~~~~ TODO Searching Views -~~~~~~~~~~~~~~~ +--------------- This is one of the class context views. The template used is typically "*classname*.search". @@ -912,7 +907,7 @@ This is one of the class context views. The template used is typically TODO Item Views -~~~~~~~~~~ +---------- The basic view of a hyperdb item is provided by the "*classname*.item" template. It generally has three sections; an "editor", a "spool" and a @@ -921,7 +916,7 @@ template. It generally has three sections; an "editor", a "spool" and a Editor Section -:::::::::::::: +~~~~~~~~~~~~~~ The editor section is used to manipulate the item - it may be a static display if the user doesn't have permission to edit the item. @@ -994,7 +989,7 @@ template can use the ":note" and ":file" fields, which are added to the standard change note message generated by Roundup. Spool Section -::::::::::::: +~~~~~~~~~~~~~ The spool section lists related information like the messages and files of an issue. @@ -1003,7 +998,7 @@ TODO History Section -::::::::::::::: +~~~~~~~~~~~~~~~ The final section displayed is the history of the item - its database journal. This is generally generated with the template:: @@ -1021,9 +1016,14 @@ through the "journal" method of the item*:: *where each journal entry is an HTMLJournalEntry.* +Defining new web actions +------------------------ + +XXX + Access Controls ---------------- +=============== A set of Permissions are built in to the security module by default: @@ -1067,7 +1067,7 @@ You may use the ``roundup-admin`` "``security``" command to display the current Role and Permission configuration in your tracker. Adding a new Permission -~~~~~~~~~~~~~~~~~~~~~~~ +----------------------- When adding a new Permission, you will need to: @@ -1080,7 +1080,350 @@ When adding a new Permission, you will need to: ------------------ +An example of adding a new field to a roundup schema +==================================================== + +Introduction +------------ + +To make the classic schema of roundup useful as a todo tracking system +for a group of systems administrators, it needed an extra data field +per issue: a category. + +This would let sysads quickly list all todos in their particular +area of interest without having to do complex queries, and without +relying on the spelling capabilities of other sysads (a losing +proposition at best). + +Adding a field to the database +------------------------------ + +This is the easiest part of the change. The category would just be a plain +string, nothing fancy. To change what is in the database you need to add +some lines to the ``open()`` function in ``dbinit.py``:: + + category = Class(db, "category", name=String()) + category.setkey("name") + +Here we are setting up a chunk of the database which we are calling +"category". It contains a string, which we are refering to as "name" for +lack of a more imaginative title. Then we are setting the key of this chunk +of the database to be that "name". This is equivalent to an index for +database types. This also means that there can only be one category with a +given name. + +Adding the above lines allows us to create categories, but they're not tied +to the issues that we are going to be creating. It's just a list of categories +off on its own, which isn't much use. We need to link it in with the issues. +To do that, find the lines in the ``open()`` function in ``dbinit.py`` which +set up the "issue" class, and then add a link to the category:: + + issue = IssueClass(db, "issue", ... , category=Multilink("category"), ... ) + +The Multilink() means that each issue can have many categories. If you were +adding something with a more one to one relationship use Link() instead. + +That is all you need to do to change the schema. The rest of the effort is +fiddling around so you can actually use the new category. + +Setting up security on the new objects +-------------------------------------- + +By default only the admin user can look at and change objects. This doesn't +suit us, as we want any user to be able to create new categories as +required, and obviously everyone needs to be able to view the categories of +issues for it to be useful. + +We therefore need to change the security of the category objects. This is +also done in the ``open()`` function of ``dbinit.py``. + +There are currently two loops which set up permissions and then assign them +to various roles. Simply add the new "category" to both lists:: + + # new permissions for this schema + for cl in 'issue', 'file', 'msg', 'user', 'category': + db.security.addPermission(name="Edit", klass=cl, + description="User is allowed to edit "+cl) + db.security.addPermission(name="View", klass=cl, + description="User is allowed to access "+cl) + + # Assign the access and edit permissions for issue, file and message + # to regular users now + for cl in 'issue', 'file', 'msg', 'category': + p = db.security.getPermission('View', cl) + db.security.addPermissionToRole('User', p) + p = db.security.getPermission('Edit', cl) + db.security.addPermissionToRole('User', p) + +So you are in effect doing the following:: + + db.security.addPermission(name="Edit", klass='category', + description="User is allowed to edit "+'category') + db.security.addPermission(name="View", klass='category', + description="User is allowed to access "+'category') + +which is creating two permission types; that of editing and viewing +"category" objects respectively. Then the following lines assign those new +permissions to the "User" role, so that normal users can view and edit +"category" objects:: + + p = db.security.getPermission('View', 'category') + db.security.addPermissionToRole('User', p) + + p = db.security.getPermission('Edit', 'category') + db.security.addPermissionToRole('User', p) + +This is all the work that needs to be done for the database. It will store +categories, and let users view and edit them. Now on to the interface +stuff. + +Changing the web left hand frame +-------------------------------- + +We need to give the users the ability to create new categories, and the +place to put the link to this functionality is in the left hand function +bar, under the "Issues" area. The file that defines how this area looks is +``html/page``, which is what we are going to be editing next. + +If you look at this file you can see that it contains a lot of "classblock" +sections which are chunks of HTML that will be included or excluded in the +output depending on whether the condition in the classblock is met. Under +the end of the classblock for issue is where we are going to add the +category code:: + +

+ Categories
+ New Category
+

+ +The first two lines is the classblock definition, which sets up a condition +that only users who have "View" permission to the "category" object will +have this section included in their output. Next comes a plain "Categories" +header in bold. Everyone who can view categories will get that. + +Next comes the link to the editing area of categories. This link will only +appear if the condition is matched: that condition being that the user has +"Edit" permissions for the "category" objects. If they do have permission +then they will get a link to another page which will let the user add new +categories. + +Note that if you have permission to view but not edit categories then all +you will see is a "Categories" header with nothing underneath it. This is +obviously not very good interface design, but will do for now. I just claim +that it is so I can add more links in this section later on. However to fix +the problem you could change the condition in the classblock statement, so +that only users with "Edit" permission would see the "Categories" stuff. + +Setting up a page to edit categories +------------------------------------ + +We defined code in the previous section which let users with the +appropriate permissions see a link to a page which would let them edit +conditions. Now we have to write that page. + +The link was for the item template for the category object. This translates +into the system looking for a file called ``category.item`` in the ``html`` +tracker directory. This is the file that we are going to write now. + +First we add an id tag in a comment which doesn't affect the outcome +of the code at all but is essential for managing the changes to this +file. It is useful for debugging however, if you load a page in a +browser and look at the page source, you can see which sections come +from which files by looking for these comments:: + + + +Next we need to setup up a standard HTML form, which is the whole +purpose of this file. We link to some handy javascript which sends the form +through only once. This is to stop users hitting the send button +multiple times when they are impatient and thus having the form sent +multiple times:: + +
+ +Next we define some code which sets up the minimum list of fields that we +require the user to enter. There will be only one field, that of "name", so +they user better put something in it otherwise the whole form is pointless:: + + + +To get everything to line up properly we will put everything in a table, +and put a nice big header on it so the user has an idea what is happening:: + + + + +Next we need the actual field that the user is going to enter the new +category. The "context.name.field(size=60)" bit tells roundup to generate a +normal HTML field of size 60, and the contents of that field will be the +"name" variable of the current context (which is "category"). The upshot of +this is that when the user types something in to the form, a new category +will be created with that name:: + + + + + + +Finally a submit button so that the user can submit the new category:: + + + + + + +So putting it all together, and closing the table and form we get:: + + + + + + + +
Category
Namename
  + submit button will go here +
+ + + + + + + + + + + +
Category
Namename
  + submit button will go here +
+
+ +This is quite a lot to just ask the user one simple question, but +there is a lot of setup for basically one line (the form line) to do +its work. To add another field to "category" would involve one more line +(well maybe a few extra to get the formatting correct). + +Adding the category to the issue +-------------------------------- + +We now have the ability to create issues to our hearts content, but +that is pointless unless we can assign categories to issues. Just like +the ``html/category.item`` file was used to define how to add a new +category, the ``html/issue.item`` is used to define how a new issue is +created. + +Just like ``category.issue`` this file defines a form which has a table to lay +things out. It doesn't matter where in the table we add new stuff, +it is entirely up to your sense of aesthetics:: + + Category + + + + +First we define a nice header so that the user knows what the next section +is, then the middle line does what we are most interested in. This +``context/category/field`` gets replaced with a field which contains the +category in the current context (the current context being the new issue). + +The classhelp lines generate a link (labelled "list") to a popup window +which contains the list of currently known categories. + +Searching on categories +----------------------- + +We can add categories, and create issues with categories. The next obvious +thing that we would like to be would be to search issues based on their +category, so that any one working on the web server could look at all +issues in the category "Web" for example. + +If you look in the html/page file and look for the "Search Issues" you will +see that it looks something like ``Search +Issues`` which shows us that when you click on "Search Issues" it will +be looking for a ``issue.search`` file to display. So that is indeed the file +that we are going to change. + +If you look at this file it should be starting to seem familiar. It is a +simple HTML form using a table to define structure. You can add the new +category search code anywhere you like within that form:: + + + Category: + + + + + + + + +Most of this is straightforward to anyone who knows HTML. It is just +setting up a select list followed by a checkbox and a couple of radio +buttons. + +The ``tal:repeat`` part repeats the tag for every item in the "category" +table and setting "s" to be each category in turn. + +The ``tal:attributes`` part is setting up the ``value=`` part of the option tag +to be the name part of "s" which is the current category in the loop. + +The ``tal:content`` part is setting the contents of the option tag to be the +name part of "s" again. For objects more complex than category, obviously +you would put an id in the value, and the descriptive part in the content; +but for category they are the same. + +Adding category to the default view +----------------------------------- + +We can now add categories, add issues with categories, and search issues +based on categories. This is everything that we need to do, however there +is some more icing that we would like. I think the category of an issue is +important enough that it should be displayed by default when listing all +the issues. + +Unfortunately, this is a bit less obvious than the previous steps. The code +defining how the issues look is in ``html/issue.index``. This is a large table +with a form down the bottom for redisplaying and so forth. + +Firstly we need to add an appropriate header to the start of the table:: + + Category + +The condition part of this statement is so that if the user has selected +not to see the Category column then they won't. + +The rest of the table is a loop which will go through every issue that +matches the display criteria. The loop variable is "i" - which means that +every issue gets assigned to "i" in turn. + +The new part of code to display the category will look like this:: + + + +The condition is the same as above: only display the condition when the +user hasn't asked for it to be hidden. The next part is to set the content +of the cell to be the category part of "i" - the current issue. + +Finally we have to edit ``html/page`` again. This time to tell it that when the +user clicks on "Unnasigned Issues" or "All Issues" that the category should +be displayed. If you scroll down the page file, you can see the links with +lots of options. The option that we are interested in is the ``:columns=`` one +which tells roundup which fields of the issue to display. Simply add +"category" to that list and it all should work. + + +------------------- Back to `Table of Contents`_ diff --git a/doc/default.css b/doc/default.css index 167d9f9..815f104 100644 --- a/doc/default.css +++ b/doc/default.css @@ -1,22 +1,22 @@ /* :Author: David Goodger :Contact: goodger@users.sourceforge.net -:date: $Date: 2002-07-29 00:54:28 $ -:version: $Revision: 1.7 $ +:date: $Date: 2002-09-10 07:07:16 $ +:version: $Revision: 1.8 $ :copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. */ -a.footnote-reference { - font-size: smaller ; - vertical-align: super } - a.target { color: blue } -code { - background-color: #eeeeee } +a.toc-backref { + text-decoration: none ; + color: black } + +dd { + margin-bottom: 0.5em } div.abstract { margin: 2em 5em } @@ -43,15 +43,21 @@ div.note p.admonition-title, div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } -div.field-body { - margin-bottom: 1em } +div.dedication { + margin: 2em 5em ; + text-align: center ; + font-style: italic } -div.field-list { - margin-bottom: -1em } +div.dedication p.topic-title { + font-weight: bold ; + font-style: normal } div.figure { margin-left: 2em } +div.footer, div.header { + font-size: smaller } + div.system-messages { margin: 5em } @@ -78,6 +84,9 @@ h2.subtitle { hr { width: 75% } +ol.simple, ul.simple { + margin-bottom: 1em } + ol.arabic { list-style: decimal } @@ -100,13 +109,8 @@ p.credits { font-style: italic ; font-size: smaller } -p.docinfo-name { - font-weight: bold ; - text-align: right } - -p.field-name { - font-weight: bold ; - margin-bottom: 1em } +p.first { + margin-top: 0 } p.label { white-space: nowrap } @@ -114,17 +118,15 @@ p.label { p.topic-title { font-weight: bold } -dd p:first-child { - margin-top: 0px; -} - -dd ul:first-child { - margin-top: 0px; -} +pre.address { + margin-bottom: 0 ; + margin-top: 0 ; + font-family: serif ; + font-size: 100% } -li p:first-child { - margin-top: 0px; -} +pre.line-block { + font-family: serif ; + font-size: 100% } pre.literal-block, pre.doctest-block { margin-left: 2em ; @@ -148,11 +150,15 @@ span.interpreted { span.option-argument { font-style: italic } +span.pre { + white-space: pre } + span.problematic { color: red } table { - margin-top: 1em } + margin-top: 0.5em ; + margin-bottom: 0.5em } table.citation { border-left: solid thin gray ; @@ -165,10 +171,27 @@ table.footnote { border-left: solid thin black ; padding-left: 0.5ex } -@media print { - h1 {page-break-before: always; } - h1, h2, h3, h4, h5, h6 { page-break-after: avoid; page-break-inside: avoid; } - blockquote, pre { page-break-inside: avoid; } - ul, ol, dl { page-break-before: avoid; } -} +td, th { + padding-left: 0.5em ; + padding-right: 0.5em ; + vertical-align: baseline } + +td > p:first-child, th > p:first-child { + margin-top: 0em } + +th.docinfo-name { + font-weight: bold ; + text-align: right } + +th.field-name { + font-weight: bold ; + text-align: right } + +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + font-size: 100% } + +tt { + background-color: #eeeeee } +ul.auto-toc { + list-style-type: none } diff --git a/doc/user_guide.txt b/doc/user_guide.txt index ed41057..342fece 100644 --- a/doc/user_guide.txt +++ b/doc/user_guide.txt @@ -2,7 +2,7 @@ User Guide ========== -:Version: $Revision: 1.6 $ +:Version: $Revision: 1.7 $ .. contents:: @@ -15,22 +15,20 @@ Web Interface Index views may be modified by the following arguments: -+-----------+--------------------------------------------------------------+ -| :sort | sort by prop name, optionally preceeded with '-' | -| | to give descending or nothing for ascending sorting. | -+-----------+--------------------------------------------------------------+ -| :group | group by prop name, optionally preceeded with '-' or | -| | to sort in descending or nothing for ascending order. | -+-----------+--------------------------------------------------------------+ -| :filter | selects which props should be displayed in the filter | -| | section. Default is all. | -+-----------+--------------------------------------------------------------+ -| :columns | selects the columns that should be displayed. | -| | Default is all. | -+-----------+--------------------------------------------------------------+ -| propname | selects the values the item properties given by propname | -| | must have (very basic search/filter). | -+-----------+--------------------------------------------------------------+ +========== ============================================================= +Argument Description +========== ============================================================= +:sort sort by prop name, optionally preceeded with '-' + to give descending or nothing for ascending sorting. +:group group by prop name, optionally preceeded with '-' or + to sort in descending or nothing for ascending order. +:filter selects which props should be displayed in the filter + section. Default is all. +:columns selects the columns that should be displayed. + Default is all. +propname selects the values the item properties given by propname + must have (very basic search/filter). +========== ============================================================= Searching ~~~~~~~~~ @@ -192,130 +190,50 @@ to determine if they get a nosy list copy of the message too. Command Line Tool ----------------- -Usage: ``roundup-admin [-i tracker home] [-u login] [-c] `` - -Options: - --i tracker home specify the issue tracker "home directory" to administer --u the ``user[:password]`` to use for commands --c when outputting lists of data, comma-separate them - -+-----------------------------------------------------------------------------+ -| Command Help | -+=============+===============================================================+ -|commit |Usage: commit | -| |The changes made during an interactive session are not | -| |automatically written to the database - they must be committed | -| |using this command. | -| | | -| |One-off commands on the command-line are automatically | -| |committed if they are successful. | -+-------------+---------------------------------------------------------------+ -|create |Usage: create classname property=value ... | -| |This creates a new entry of the given class using the property | -| |name=value arguments provided on the command line after the | -| |"create" command. | -+-------------+---------------------------------------------------------------+ -|display |Usage: display designator | -| |This lists the properties and their associated values for the | -| |given item. | -+-------------+---------------------------------------------------------------+ -|export |Usage: export class[,class] destination dir | -| |This action exports the current data from the database into | -| |tab-separated-value files that are placed in the nominated | -| |destination | -| |directory. The journals are not exported. | -+-------------+---------------------------------------------------------------+ -|find |Usage: find classname propname=value ... | -| |Find the items of the given class with a given link property | -| |value. The | -| |value may be either the itemid of the linked item, or its key | -| |value. | -+-------------+---------------------------------------------------------------+ -|get |Usage: get property designator[,designator]* | -| |Retrieves the property value of the items specified by the | -| |designators. | -+-------------+---------------------------------------------------------------+ -|help |Usage: help topic | -| |commands -- list commands | -| |x -- help specific to a command | -| |initopts -- init command options | -| |all -- all available help | -+-------------+---------------------------------------------------------------+ -|history |Usage: history designator | -| |Lists the journal entries for the item identified by the | -| |designator. | -+-------------+---------------------------------------------------------------+ -|import |Usage: import class file | -| |The file must define the same properties as the class | -| |(including having | -| |a "header" line with those property names.) The new items are | -| |added to | -| |the existing database - if you want to create a new database | -| |using the | -| |imported data, then create a new database (or, tediously, | -| |retire all | -| |the old data.) | -+-------------+---------------------------------------------------------------+ -|initialise |Usage: initialise [template [backend [admin password]]] | -| |The command will prompt for the tracker home directory (if not | -| |supplied | -| |through INSTANCE HOME or the -i option. The template, backend | -| |and admin | -| |password may be specified on the command-line as arguments, in | -| |that | -| |order. | -| | | -| |See also initopts help. | -+-------------+---------------------------------------------------------------+ -|list |Usage: list classname [property] | -| |Lists all trackers of the given class. If the property is not | -| |specified, the "label" property is used. The label property is| -| |tried | -| |in order: the key, "name", "title" and then the first property,| -| |alphabetically. | -+-------------+---------------------------------------------------------------+ -|retire |Usage: retire designator[,designator]* | -| |This action indicates that a particular item is not to be | -| |retrieved by | -| |the list or find commands, and its key value may be re-used. | -+-------------+---------------------------------------------------------------+ -|rollback |Usage: rollback | -| |The changes made during an interactive session are not | -| |automatically written to the database - they must be committed | -| |manually. This command undoes all those changes, so a commit | -| |immediately after would make no changes to the database. | -+-------------+---------------------------------------------------------------+ -|set |Usage: set designator[,designator]* propname=value ... | -| |Sets the property to the value for all designators given. | -+-------------+---------------------------------------------------------------+ -|specification|Usage: specification classname | -| |This lists the properties for a given class. | -+-------------+---------------------------------------------------------------+ -|table |Usage: table classname [property[,property]*] | -| |Lists all trackers of the given class. If the properties are | -| |not | -| |specified, all properties are displayed. By default, the column| -| |widths | -| |are the width of the property names. The width may be | -| |explicitly defined | -| |by defining the property as "name:width". For example:: | -| | | -| | roundup> table priority id,name:10 | -| | Id Name | -| | 1 fatal-bug | -| | 2 bug | -| | 3 usability | -| | 4 feature | -+-------------+---------------------------------------------------------------+ - - -All commands (except help) require a tracker specifier. This is just the path to -the roundup tracker you're working with. A roundup tracker is where roundup -keeps the database and configuration file that defines an issue tracker. It may be -thought of as the issue tracker's "home directory". It may be specified in the -environment variable ``ROUNDUP_INSTANCE`` or on the command line as "``-i -tracker``". +The basic usage is:: + + Help: + roundup-admin -h + roundup-admin help -- this help + roundup-admin help -- command-specific help + roundup-admin help all -- all available help + + Options: + -i instance home -- specify the issue tracker "home directory" to administer + -u -- the user[:password] to use for commands + -c -- when outputting lists of data, just comma-separate them + + Commands: + commit + create classname property=value ... + display designator + export [class[,class]] export_dir + find classname propname=value ... + get property designator[,designator]* + help topic + history designator + import import_dir + initialise [adminpw] + install [template [backend [admin password]]] + list classname [property] + pack period | date + reindex + retire designator[,designator]* + rollback + security [Role name] + set designator[,designator]* propname=value ... + specification classname + table classname [property[,property]*] + +Commands may be abbreviated as long as the abbreviation matches only one +command, e.g. l == li == lis == list. + +All commands (except help) require a tracker specifier. This is just the +path to the roundup tracker you're working with. A roundup tracker is where +roundup keeps the database and configuration file that defines an issue +tracker. It may be thought of as the issue tracker's "home directory". +It may be specified in the environment variable ``TRACKER_HOME`` or on +the command line as "``-i tracker``". A designator is a classname and an itemid concatenated, eg. bug1, user10, ... Property values are represented as strings in command arguments and in the printed @@ -344,10 +262,11 @@ results: both accepted; an empty string, a single item, or a list of items joined by commas is accepted. -When multiple items are specified to the roundup get or roundup set commands, the -specified properties are retrieved or set on all the listed items. When multiple -results are returned by the roundup get or roundup find commands, they are printed -one per line (default) or joined by commas (with the "``-c``" option). +When multiple items are specified to the roundup get or roundup set +commands, the specified properties are retrieved or set on all the listed +items. When multiple results are returned by the roundup get or roundup +find commands, they are printed one per line (default) or joined by commas +(with the "``-c``" option). Where the command changes data, a login name/password is required. The login may be specified as either "``name``" or "``name:password``". diff --git a/roundup/admin.py b/roundup/admin.py index fd9d9fd..5171081 100644 --- a/roundup/admin.py +++ b/roundup/admin.py @@ -16,7 +16,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: admin.py,v 1.26 2002-09-10 03:01:18 richard Exp $ +# $Id: admin.py,v 1.27 2002-09-10 07:07:16 richard Exp $ import sys, os, getpass, getopt, re, UserDict, shlex, shutil try: @@ -61,7 +61,7 @@ class AdminTool: for k in AdminTool.__dict__.keys(): if k[:5] == 'help_': self.help[k[5:]] = getattr(self, k) - self.instance_home = '' + self.tracker_home = '' self.db = None def get_class(self, classname): @@ -87,17 +87,19 @@ class AdminTool: def usage(self, message=''): if message: message = _('Problem: %(message)s)\n\n')%locals() - print _('''%(message)sUsage: roundup-admin [-i instance home] [-u login] [-c] + print _('''%(message)sUsage: roundup-admin [options] + +Options: + -i instance home -- specify the issue tracker "home directory" to administer + -u -- the user[:password] to use for commands + -c -- when outputting lists of data, just comma-separate them Help: roundup-admin -h roundup-admin help -- this help roundup-admin help -- command-specific help roundup-admin help all -- all available help -Options: - -i instance home -- specify the issue tracker "home directory" to administer - -u -- the user[:password] to use for commands - -c -- when outputting lists of data, just comma-separate them''')%locals() +''')%locals() self.help_commands() def help_commands(self): @@ -136,12 +138,12 @@ Options: def help_all(self): print _(''' -All commands (except help) require an instance specifier. This is just the path -to the roundup instance you're working with. A roundup instance is where +All commands (except help) require a tracker specifier. This is just the path +to the roundup tracker you're working with. A roundup tracker is where roundup keeps the database and configuration file that defines an issue tracker. It may be thought of as the issue tracker's "home directory". It may be specified in the environment variable TRACKER_HOME or on the command -line as "-i instance". +line as "-i tracker". A designator is a classname and a nodeid concatenated, eg. bug1, user10, ... @@ -249,27 +251,27 @@ Command help: backends = roundup.backends.__all__ print _('Back ends:'), ', '.join(backends) - def do_install(self, instance_home, args): + def do_install(self, tracker_home, args): '''Usage: install [template [backend [admin password]]] - Install a new Roundup instance. + Install a new Roundup tracker. - The command will prompt for the instance home directory (if not supplied + The command will prompt for the tracker home directory (if not supplied through TRACKER_HOME or the -i option). The template, backend and admin password may be specified on the command-line as arguments, in that order. The initialise command must be called after this command in order - to initialise the instance's database. You may edit the instance's + to initialise the tracker's database. You may edit the tracker's initial database contents before running that command by editing - the instance's dbinit.py module init() function. + the tracker's dbinit.py module init() function. See also initopts help. ''' if len(args) < 1: raise UsageError, _('Not enough arguments supplied') - # make sure the instance home can be created - parent = os.path.split(instance_home)[0] + # make sure the tracker home can be created + parent = os.path.split(tracker_home)[0] if not os.path.exists(parent): raise UsageError, _('Instance home parent directory "%(parent)s"' ' does not exist')%locals() @@ -297,10 +299,10 @@ Command help: backend = 'anydbm' # install! - init.install(instance_home, template, backend) + init.install(tracker_home, template, backend) print _(''' - You should now edit the instance configuration file: + You should now edit the tracker configuration file: %(config_file)s ... at a minimum, you must set MAILHOST, MAIL_DOMAIN and ADMIN_EMAIL. @@ -309,19 +311,19 @@ Command help: %(database_config_file)s ... see the documentation on customizing for more information. ''')%{ - 'config_file': os.path.join(instance_home, 'config.py'), - 'database_config_file': os.path.join(instance_home, 'dbinit.py') + 'config_file': os.path.join(tracker_home, 'config.py'), + 'database_config_file': os.path.join(tracker_home, 'dbinit.py') } return 0 - def do_initialise(self, instance_home, args): + def do_initialise(self, tracker_home, args): '''Usage: initialise [adminpw] - Initialise a new Roundup instance. + Initialise a new Roundup tracker. The administrator details will be set at this step. - Execute the instance's initialisation function dbinit.init() + Execute the tracker's initialisation function dbinit.init() ''' # password if len(args) > 1: @@ -333,14 +335,14 @@ Command help: adminpw = getpass.getpass(_('Admin Password: ')) confirm = getpass.getpass(_(' Confirm: ')) - # make sure the instance home is installed - if not os.path.exists(instance_home): + # make sure the tracker home is installed + if not os.path.exists(tracker_home): raise UsageError, _('Instance home does not exist')%locals() - if not os.path.exists(os.path.join(instance_home, 'html')): + if not os.path.exists(os.path.join(tracker_home, 'html')): raise UsageError, _('Instance has not been installed')%locals() # is there already a database? - if os.path.exists(os.path.join(instance_home, 'db')): + if os.path.exists(os.path.join(tracker_home, 'db')): print _('WARNING: The database is already initialised!') print _('If you re-initialise it, you will lose all the data!') ok = raw_input(_('Erase it? Y/[N]: ')).strip() @@ -348,10 +350,10 @@ Command help: return 0 # nuke it - shutil.rmtree(os.path.join(instance_home, 'db')) + shutil.rmtree(os.path.join(tracker_home, 'db')) # GO - init.initialise(instance_home, adminpw) + init.initialise(tracker_home, adminpw) return 0 @@ -953,9 +955,9 @@ Date format is "YYYY-MM-DD" eg: def do_reindex(self, args): '''Usage: reindex - Re-generate an instance's search indexes. + Re-generate a tracker's search indexes. - This will re-generate the search indexes for an instance. This will + This will re-generate the search indexes for a tracker. This will typically happen automatically. ''' self.db.indexer.force_reindex() @@ -1030,35 +1032,35 @@ Date format is "YYYY-MM-DD" eg: return 1 command, function = functions[0] - # make sure we have an instance_home - while not self.instance_home: - self.instance_home = raw_input(_('Enter instance home: ')).strip() + # make sure we have a tracker_home + while not self.tracker_home: + self.tracker_home = raw_input(_('Enter tracker home: ')).strip() # before we open the db, we may be doing an install or init if command == 'initialise': try: - return self.do_initialise(self.instance_home, args) + return self.do_initialise(self.tracker_home, args) except UsageError, message: print _('Error: %(message)s')%locals() return 1 elif command == 'install': try: - return self.do_install(self.instance_home, args) + return self.do_install(self.tracker_home, args) except UsageError, message: print _('Error: %(message)s')%locals() return 1 - # get the instance + # get the tracker try: - instance = roundup.instance.open(self.instance_home) + tracker = roundup.instance.open(self.tracker_home) except ValueError, message: - self.instance_home = '' - print _("Error: Couldn't open instance: %(message)s")%locals() + self.tracker_home = '' + print _("Error: Couldn't open tracker: %(message)s")%locals() return 1 # only open the database once! if not self.db: - self.db = instance.open('admin') + self.db = tracker.open('admin') # do the command ret = 0 @@ -1112,7 +1114,7 @@ Date format is "YYYY-MM-DD" eg: return 1 # handle command-line args - self.instance_home = os.environ.get('TRACKER_HOME', '') + self.tracker_home = os.environ.get('TRACKER_HOME', '') # TODO: reinstate the user/password stuff (-u arg too) name = password = '' if os.environ.has_key('ROUNDUP_LOGIN'): @@ -1126,7 +1128,7 @@ Date format is "YYYY-MM-DD" eg: self.usage() return 0 if opt == '-i': - self.instance_home = arg + self.tracker_home = arg if opt == '-c': self.comma_sep = 1