Code

*** empty log message ***
[roundup.git] / doc / customizing.txt
1 ===================
2 Customising Roundup
3 ===================
5 :Version: $Revision: 1.15 $
7 .. contents::
10 What You Can Do
11 ---------------
13 Customisation of Roundup can take one of five forms:
15 1. `instance configuration`_ file changes
16 2. database, or `instance schema`_ changes
17 3. "definition" class `database content`_ changes
18 4. behavioural changes, through detectors_
19 5. `access controls`_
21 The third case is special because it takes two distinctly different forms
22 depending upon whether the instance has been initialised or not. The other two
23 may be done at any time, before or after instance initialisation. Yes, this
24 includes adding or removing properties from classes.
27 Instances in a Nutshell
28 -----------------------
30 Instances have the following structure:
32 +-------------------+--------------------------------------------------------+
33 |instance_config.py |Holds the basic instance_configuration                  |
34 +-------------------+--------------------------------------------------------+
35 |dbinit.py          |Holds the instance_schema                               |
36 +-------------------+--------------------------------------------------------+
37 |interfaces.py      |Defines the Web and E-Mail interfaces for the instance  |
38 +-------------------+--------------------------------------------------------+
39 |select_db.py       |Selects the database back-end for the instance          |
40 +-------------------+--------------------------------------------------------+
41 |db/                |Holds the instance's database                           |
42 +-------------------+--------------------------------------------------------+
43 |db/files/          |Holds the instance's upload files and messages          |
44 +-------------------+--------------------------------------------------------+
45 |detectors/         |Auditors and reactors for this instance                 |
46 +-------------------+--------------------------------------------------------+
47 |html/              |Web interface templates, images and style sheets        |
48 +-------------------+--------------------------------------------------------+
50 Instance Configuration
51 ----------------------
53 The instance_config.py located in your instance home contains the basic
54 configuration for the web and e-mail components of roundup's interfaces. This
55 file is a Python module. The configuration variables available are:
57 **INSTANCE_HOME** - ``os.path.split(__file__)[0]``
58  The instance home directory. The above default code will automatically
59  determine the instance home for you.
61 **MAILHOST** - ``'localhost'``
62  The SMTP mail host that roundup will use to send e-mail.
64 **MAIL_DOMAIN** - ``'your.tracker.email.domain.example'``
65  The domain name used for email addresses.
67 **DATABASE** - ``os.path.join(INSTANCE_HOME, 'db')``
68  This is the directory that the database is going to be stored in. By default
69  it is in the instance home.
71 **TEMPLATES** - ``os.path.join(INSTANCE_HOME, 'html')``
72  This is the directory that the HTML templates reside in. By default they are
73  in the instance home.
75 **INSTANCE_NAME** - ``'Roundup issue tracker'``
76  A descriptive name for your roundup instance. This is sent out in e-mails and
77  appears in the heading of CGI pages.
79 **ISSUE_TRACKER_EMAIL** - ``'issue_tracker@%s'%MAIL_DOMAIN``
80  The email address that e-mail sent to roundup should go to. Think of it as the
81  instance's personal e-mail address.
83 **ISSUE_TRACKER_WEB** - ``'http://your.tracker.url.example/'``
84  The web address that the instance is viewable at. This will be included in
85  information sent to users of the tracker.
87 **ADMIN_EMAIL** - ``'roundup-admin@%s'%MAIL_DOMAIN``
88  The email address that roundup will complain to if it runs into trouble.
90 **FILTER_POSITION** - ``'top'``, ``'bottom'`` or ``'top and bottom'``
91  Where to place the web filtering HTML on the index page.
93 **ANONYMOUS_ACCESS** - ``'deny'`` or ``'allow'``
94  Deny or allow anonymous access to the web interface.
96 **ANONYMOUS_REGISTER** - ``'deny'`` or ``'allow'``
97  Deny or allow anonymous users to register through the web interface.
99 **ANONYMOUS_REGISTER_MAIL** - ``'deny'`` or ``'allow'``
100  Deny or allow anonymous users to register through the mail interface.
102 **MESSAGES_TO_AUTHOR** - ``'yes'`` or``'no'``
103  Send nosy messages to the author of the message.
105 **ADD_AUTHOR_TO_NOSY** - ``'new'``, ``'yes'`` or ``'no'``
106  Does the author of a message get placed on the nosy list automatically?
107  If ``'new'`` is used, then the author will only be added when a message
108  creates a new issue. If ``'yes'``, then the author will be added on followups
109  too. If ``'no'``, they're never added to the nosy.
111 **ADD_RECIPIENTS_TO_NOSY** - ``'new'``, ``'yes'`` or ``'no'``
112  Do the recipients (To:, Cc:) of a message get placed on the nosy list?
113  If ``'new'`` is used, then the recipients will only be added when a message
114  creates a new issue. If ``'yes'``, then the recipients will be added on
115  followups too. If ``'no'``, they're never added to the nosy.
117 **EMAIL_SIGNATURE_POSITION** - ``'top'``, ``'bottom'`` or ``'none'``
118  Where to place the email signature in messages that Roundup generates.
120 **EMAIL_KEEP_QUOTED_TEXT** - ``'yes'`` or ``'no'``
121  Keep email citations. Citations are the part of e-mail which the sender has
122  quoted in their reply to previous e-mail.
124 **EMAIL_LEAVE_BODY_UNCHANGED** - ``'no'``
125  Preserve the email body as is. Enabiling this will cause the entire message
126  body to be stored, including all citations and signatures. It should be
127  either ``'yes'`` or ``'no'``.
129 **MAIL_DEFAULT_CLASS** - ``'issue'`` or ``''``
130  Default class to use in the mailgw if one isn't supplied in email
131  subjects. To disable, comment out the variable below or leave it blank.
133 **HEADER_INDEX_LINKS** - ``['DEFAULT', 'UNASSIGNED', 'USER']``
134  Define what index links are available in the header, and what their
135  labels are. Each key is used to look up one of the index specifications
136  below - so ``'DEFAULT'`` will use ``'DEFAULT_INDEX'``.
138  Example ``DEFAULT_INDEX``::
140   {
141    'LABEL': 'All Issues',
142    'CLASS': 'issue',
143    'SORT': ['-activity'],
144    'GROUP': ['priority'],
145    'FILTER': ['status'],
146    'COLUMNS': ['id','activity','title','creator','assignedto'],
147    'FILTERSPEC': {
148      'status': ['-1', '1', '2', '3', '4', '5', '6', '7'],
149    },
150   }
152  This defines one of the index links that appears in the
153  ``HEADER_INDEX_LINKS`` list.
155  **LABEL** - ``'All Issues'``
156   The text that appears as the link label.
157  **CLASS** - ``'issue'``
158   The class to display the index for.
159  **SORT** - ``['-activity']``
160   Sort by prop name, optionally preceeded with '-' to give descending or
161   nothing for ascending sorting.
162  **GROUP** - ``['priority']``
163   Group by prop name, optionally preceeded with '-' or to sort in descending
164   or nothing for ascending order.
165  **FILTER** - ``['status']``
166   Selects which props should be displayed in the filter section.
167   Default is all. 
168  **COLUMNS** - ``['id','activity','title','creator','assignedto']``
169   Selects the columns that should be displayed. Default is all.
170  **FILTERSPEC** - *a dictionary giving the filter specification*
171   The ``FILTERSPEC`` gives the filtering arguments. This selects the values
172   the node properties given by propname must have.
174   Where the ``FILTERSPEC`` value is ``'CURRENT USER'``, it will be replaced
175   by the id of the logged-in user. For example::
177    'FILTERSPEC': {
178      'status': ['-1', '1', '2', '3', '4', '5', '6', '7'],
179      'assignedto': 'CURRENT USER',
180    },
182 **HEADER_ADD_LINKS** - ``['issue']``
183  List the classes that users are able to add nodes to.
185 **HEADER_SEARCH_LINKS** - ``['issue']``
186  List the classes that users can search.
188 **SEARCH_FILTERS** - ``['ISSUE_FILTER', 'SUPPORT_FILTER']``
189  List search filters per class. Like the INDEX entries above, each key is
190  used to look up one of the filter specifications below - so ``'ISSUE'``
191  will use ``'ISSUE_FILTER'``.
193  Example ``ISSUE_FILTER``::
195   ISSUE_FILTER = {
196     'CLASS': 'issue',
197     'FILTER': ['status', 'priority', 'assignedto', 'creator']
198   }
200   **CLASS** - ``'issue'``
201    The class that the search page is for.
202   **FILTER** - ``['status', 'priority', 'assignedto', 'creator']``
203    Selects which props should be displayed on the filter page. Default is
204    all.
206 The default instance_config.py is given below - as you
207 can see, the MAIL_DOMAIN must be edited before any interaction with the
208 instance is attempted.::
210     # roundup home is this package's directory
211     INSTANCE_HOME=os.path.split(__file__)[0]
213     # The SMTP mail host that roundup will use to send mail
214     MAILHOST = 'localhost'
216     # The domain name used for email addresses.
217     MAIL_DOMAIN = 'your.tracker.email.domain.example'
219     # the next two are only used for the standalone HTTP server.
220     HTTP_HOST = ''
221     HTTP_PORT = 9080
223     # This is the directory that the database is going to be stored in
224     DATABASE = os.path.join(INSTANCE_HOME, 'db')
226     # This is the directory that the HTML templates reside in
227     TEMPLATES = os.path.join(INSTANCE_HOME, 'html')
229     # A descriptive name for your roundup instance
230     INSTANCE_NAME = 'Roundup issue tracker'
232     # The email address that mail to roundup should go to
233     ISSUE_TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN
235     # The web address that the instance is viewable at
236     ISSUE_TRACKER_WEB = 'http://your.tracker.url.example/'
238     # The email address that roundup will complain to if it runs into trouble
239     ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN
241     # Somewhere for roundup to log stuff internally sent to stdout or stderr
242     LOG = os.path.join(INSTANCE_HOME, 'roundup.log')
244     # Where to place the web filtering HTML on the index page
245     FILTER_POSITION = 'bottom'          # one of 'top', 'bottom', 'top and bottom'
247     # Deny or allow anonymous access to the web interface
248     ANONYMOUS_ACCESS = 'deny'           # either 'deny' or 'allow'
250     # Deny or allow anonymous users to register through the web interface
251     ANONYMOUS_REGISTER = 'deny'         # either 'deny' or 'allow'
253     # Deny or allow anonymous users to register through the mail interface
254     ANONYMOUS_REGISTER_MAIL = 'deny'    # either 'deny' or 'allow'
256     # Send nosy messages to the author of the message
257     MESSAGES_TO_AUTHOR = 'no'           # either 'yes' or 'no'
259     # Does the author of a message get placed on the nosy list automatically?
260     # If 'new' is used, then the author will only be added when a message
261     # creates a new issue. If 'yes', then the author will be added on followups
262     # too. If 'no', they're never added to the nosy.
263     ADD_AUTHOR_TO_NOSY = 'new'          # one of 'yes', 'no', 'new'
265     # Do the recipients (To:, Cc:) of a message get placed on the nosy list?
266     # If 'new' is used, then the recipients will only be added when a message
267     # creates a new issue. If 'yes', then the recipients will be added on followups
268     # too. If 'no', they're never added to the nosy.
269     ADD_RECIPIENTS_TO_NOSY = 'new'      # either 'yes', 'no', 'new'
271     # Where to place the email signature
272     EMAIL_SIGNATURE_POSITION = 'bottom' # one of 'top', 'bottom', 'none'
274     # Keep email citations
275     EMAIL_KEEP_QUOTED_TEXT = 'no'       # either 'yes' or 'no'
277     # Preserve the email body as is
278     EMAIL_LEAVE_BODY_UNCHANGED = 'no'   # either 'yes' or 'no'
280     # Default class to use in the mailgw if one isn't supplied in email
281     # subjects. To disable, comment out the variable below or leave it blank.
282     # Examples:
283     MAIL_DEFAULT_CLASS = 'issue'   # use "issue" class by default
284     #MAIL_DEFAULT_CLASS = ''        # disable (or just comment the var out)
286     # Define what index links are available in the header, and what their
287     # labels are. Each key is used to look up one of the index specifications
288     # below - so 'DEFAULT' will use 'DEFAULT_INDEX'.
289     # Where the FILTERSPEC has 'assignedto' with a value of None, it will be
290     # replaced by the id of the logged-in user.
291     HEADER_INDEX_LINKS = ['DEFAULT', 'UNASSIGNED', 'USER']
293     # list the classes that users are able to add nodes to
294     HEADER_ADD_LINKS = ['issue']
296     # list the classes that users can search
297     HEADER_SEARCH_LINKS = ['issue']
299     # list search filters per class
300     SEARCH_FILTERS = ['ISSUE_FILTER', 'SUPPORT_FILTER']
302     # Now the DEFAULT display specification. TODO: describe format
303     DEFAULT_INDEX = {
304       'LABEL': 'All Issues',
305       'CLASS': 'issue',
306       'SORT': ['-activity'],
307       'GROUP': ['priority'],
308       'FILTER': ['status'],
309       'COLUMNS': ['id','activity','title','creator','assignedto'],
310       'FILTERSPEC': {
311         'status': ['-1', '1', '2', '3', '4', '5', '6', '7'],
312       },
313     }
315     # The "unsassigned issues" index
316     UNASSIGNED_INDEX = {
317       'LABEL': 'Unassigned Issues',
318       'CLASS': 'issue',
319       'SORT': ['-activity'],
320       'GROUP': ['priority'],
321       'FILTER': ['status', 'assignedto'],
322       'COLUMNS': ['id','activity','title','creator','status'],
323       'FILTERSPEC': {
324         'status': ['-1', '1', '2', '3', '4', '5', '6', '7'],
325         'assignedto': ['-1'],
326       },
327     }
329     # The "my issues" index -- note that the user's id will replace the
330     # 'CURRENT USER' value of the "assignedto" filterspec
331     USER_INDEX = {
332       'LABEL': 'My Issues',
333       'CLASS': 'issue',
334       'SORT': ['-activity'],
335       'GROUP': ['priority'],
336       'FILTER': ['status', 'assignedto'],
337       'COLUMNS': ['id','activity','title','creator','status'],
338       'FILTERSPEC': {
339         'status': ['-1', '1', '2', '3', '4', '5', '6', '7'],
340         'assignedto': 'CURRENT USER',
341       },
342     }
344     ISSUE_FILTER = {
345       'CLASS': 'issue',
346       'FILTER': ['status', 'priority', 'assignedto', 'creator']
347     }
349     SUPPORT_FILTER = {
350       'CLASS': 'issue',
351       'FILTER': ['status', 'priority', 'assignedto', 'creator']
352     }
355 Instance Schema
356 ---------------
358 Note: if you modify the schema, you'll most likely need to edit the
359       `web interface`_ HTML template files and `detectors`_ to reflect
360       your changes.
362 An instance schema defines what data is stored in the instance's database. The
363 two schemas shipped with Roundup turn it into a typical software bug tracker
364 (the extended schema allowing for support issues as well as bugs). Schemas are
365 defined using Python code. The "classic" schema looks like this::
367     pri = Class(db, "priority", name=String(), order=String())
368     pri.setkey("name")
369     pri.create(name="critical", order="1")
370     pri.create(name="urgent", order="2")
371     pri.create(name="bug", order="3")
372     pri.create(name="feature", order="4")
373     pri.create(name="wish", order="5")
375     stat = Class(db, "status", name=String(), order=String())
376     stat.setkey("name")
377     stat.create(name="unread", order="1")
378     stat.create(name="deferred", order="2")
379     stat.create(name="chatting", order="3")
380     stat.create(name="need-eg", order="4")
381     stat.create(name="in-progress", order="5")
382     stat.create(name="testing", order="6")
383     stat.create(name="done-cbb", order="7")
384     stat.create(name="resolved", order="8")
386     keyword = Class(db, "keyword", name=String())
387     keyword.setkey("name")
389     user = Class(db, "user", username=String(), password=String(),
390         address=String(), realname=String(), phone=String(),
391         organisation=String())
392     user.setkey("username")
393     user.create(username="admin", password=adminpw,
394         address=instance_config.ADMIN_EMAIL)
396     msg = FileClass(db, "msg", author=Link("user"), recipients=Multilink
397         ("user"), date=Date(), summary=String(), files=Multilink("file"))
399     file = FileClass(db, "file", name=String(), type=String())
401     issue = IssueClass(db, "issue", assignedto=Link("user"),
402         topic=Multilink("keyword"), priority=Link("priority"), status=Link
403         ("status"))
404     issue.setkey('title')
406 Classes and Properties - creating a new information store
407 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
409 In the instance above, we've defined 7 classes of information:
411   priority
412       Defines the possible levels of urgency for issues.
414   status
415       Defines the possible states of processing the issue may be in.
417   keyword
418       Initially empty, will hold keywords useful for searching issues.
420   user
421       Initially holding the "admin" user, will eventually have an entry for all
422       users using roundup.
424   msg
425       Initially empty, will all e-mail messages sent to or generated by
426       roundup.
428   file
429       Initially empty, will all files attached to issues.
431   issue
432       Initially emtyp, this is where the issue information is stored.
434 We define the "priority" and "status" classes to allow two things: reduction in
435 the amount of information stored on the issue and more powerful, accurate
436 searching of issues by priority and status. By only requiring a link on the
437 issue (which is stored as a single number) we reduce the chance that someone
438 mis-types a priority or status - or simply makes a new one up.
440 Class and Nodes
441 :::::::::::::::
443 A Class defines a particular class (or type) of data that will be stored in the
444 database. A class comprises one or more properties, which given the information
445 about the class nodes.
446 The actual data entered into the database, using class.create() are called
447 nodes. They have a special immutable property called id. We sometimes refer to
448 this as the nodeid.
450 Properties
451 ::::::::::
453 A Class is comprised of one or more properties of the following types:
454     * String properties are for storing arbitrary-length strings.
455     * Password properties are for storing encoded arbitrary-length strings. The
456       default encoding is defined on the roundup.password.Password class.
457     * Date properties store date-and-time stamps. Their values are Timestamp
458       objects.
459     * A Link property refers to a single other node selected from a specified
460       class. The class is part of the property; the value is an integer, the id
461       of the chosen node.
462     * A Multilink property refers to possibly many nodes in a specified class.
463       The value is a list of integers.
465 FileClass
466 :::::::::
468 FileClasses save their "content" attribute off in a separate file from the rest
469 of the database. This reduces the number of large entries in the database,
470 which generally makes databases more efficient, and also allows us to use
471 command-line tools to operate on the files. They are stored in the files sub-
472 directory of the db directory in your instance.
474 IssueClass
475 ::::::::::
477 IssueClasses automatically include the "messages", "files", "nosy", and
478 "superseder" properties.
479 The messages and files properties list the links to the messages and files
480 related to the issue. The nosy property is a list of links to users who wish to
481 be informed of changes to the issue - they get "CC'ed" e-mails when messages
482 are sent to or generated by the issue. The nosy reactor (in the detectors
483 directory) handles this action. The superceder link indicates an issue which
484 has superceded this one.
485 They also have the dynamically generated "creation", "activity" and "creator"
486 properties.
487 The value of the "creation" property is the date when a node was created, and
488 the value of the "activity" property is the date when any property on the node
489 was last edited (equivalently, these are the dates on the first and last
490 records in the node's journal). The "creator" property holds a link to the user
491 that created the issue.
493 setkey(property)
494 ::::::::::::::::
496 Select a String property of the class to be the key property. The key property
497 muse be unique, and allows references to the nodes in the class by the content
498 of the key property. That is, we can refer to users by their username, e.g.
499 let's say that there's an issue in roundup, issue 23. There's also a user,
500 richard who happens to be user 2. To assign an issue to him, we could do either
501 of::
503      roundup-admin set issue assignedto=2
505 or::
507      roundup-admin set issue assignedto=richard
509 Note, the same thing can be done in the web and e-mail interfaces.
511 create(information)
512 :::::::::::::::::::
514 Create a node in the database. This is generally used to create nodes in the
515 "definitional" classes like "priority" and "status".
518 Detectors - adding behaviour to your tracker
519 --------------------------------------------
520 .. _detectors:
522 The detectors in your instance fire before (*auditors*) and after (*reactors*)
523 changes to the contents of your database. They are Python modules that sit in
524 your instance's ``detectors`` directory. You will have some installed by
525 default - have a look. You can write new detectors or modify the existing
526 ones. The existing detectors installed for you are:
528 **nosyreaction.py**
529   This provides the automatic nosy list maintenance and email sending. The nosy
530   reactor (``nosyreaction``) fires when new messages are added to issues.
531   The nosy auditor (``updatenosy``) fires when issues are changed and figures
532   what changes need to be made to the nosy list (like adding new authors etc)
533 **statusauditor.py**
534   This provides the ``chatty`` auditor which changes the issue status from
535   ``unread`` or ``closed`` to ``chatting`` if new messages appear. It also
536   provides the ``presetunread`` auditor which pre-sets the status to
537   ``unread`` on new nodes if the status isn't explicitly defined.
539 See the detectors section in the `design document`__ for details of the
540 interface for detectors.
542 __ design.html
544 Sample additional detectors that have been found useful will appear in the
545 ``detectors`` directory of the Roundup distribution:
547 **newissuecopy.py**
548   This detector sends an email to a team address whenever a new issue is
549   created. The address is hard-coded into the detector, so edit it before you
550   use it (look for the text 'team@team.host') or you'll get email errors!
553 Database Content
554 ----------------
556 Note: if you modify the content of definitional classes, you'll most likely
557        need to edit the instance `detectors`_ to reflect your changes.
559 Customisation of the special "definitional" classes (eg. status, priority,
560 resolution, ...) may be done either before or after the instance is
561 initialised. The actual method of doing so is completely different in each
562 case though, so be careful to use the right one.
564 **Changing content before instance initialisation**
565     Edit the dbinit module in your instance to alter the nodes created in using
566     the create() methods.
569 **Changing content after instance initialisation**
570     Use the roundup-admin interface's create, set and retire methods to add,
571     alter or remove nodes from the classes in question.
575 Web Interface
576 -------------
578 The web interface works behind the cgi-bin/roundup.cgi or roundup-server
579 scripts. In both cases, the scripts determine which instance is being accessed
580 (the first part of the URL path inside the scope of the CGI handler) and pass
581 control on to the instance interfaces.Client class which handles the rest of
582 the access through its main() method. This means that you can do pretty much
583 anything you want as a web interface to your instance.
584 Most customisation of the web view can be done by modifying the templates in
585 the instance html directory. These are divided into index, item and newitem
586 views. The newitem view is optional - the item view will be used if the newitem
587 view doesn't exist. The header and footer that wrap the various views give the
588 pages an overall look.
590 Repurcussions of changing the instance schema
591 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
593 If you choose to change the `instance schema`_ you will need to ensure the web
594 interface knows about it:
596 1. Index, item and filter pages for the relevant classes may need to have
597    properties added or removed,
598 2. The default page header relies on the existence of, and some values of
599    the priority, status, assignedto and activity classes. If you change any
600    of these (specifically if you remove any of the classes or their default
601    values) you will need to implement your own pagehead() method in your
602    instance's interfaces.py module.
604 Overall Look - the Header and Footer
605 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
607 The header and footer are generated by Python code. The default code is in
608 roundup.cgi_client.Class. This class is mixed-in to your instance through the
609 instance's interfaces module. This means you can override the header and
610 footer with your own code. This allows you to use a sidebar navigation scheme,
611 for example.
614 Displaying Properties
615 ~~~~~~~~~~~~~~~~~~~~~
617 Properties appear in the user interface in three contexts: in indices, in
618 editors, and as filters. For each type of property, there are several display
619 possibilities. For example, in an index view, a string property may just be
620 printed as a plain string, but in an editor view, that property should be
621 displayed in an editable field.
623 The display of a property is handled by functions in the htmltemplate module.
624 Displayer functions are triggered by <display> tags in templates. The call
625 attribute of the tag provides a Python expression for calling the displayer
626 function. The three standard arguments are inserted in front of the arguments
627 given. For example, the occurrence of::
629          <display call="plain('status')">
631 in a template triggers a call the "plain" function. The displayer functions can
632 accept extra arguments to further specify details about the widgets that should
633 be generated. By defining new displayer functions, the user interface can be
634 highly customized.
636 +-----------------------------------------------------------------------------+
637 |The displayer functions are                                                  |
638 +---------+-------------------------------------------------------------------+
639 |plain    |Display a String property directly.                                |
640 |         |Display a Date property in a specified time zone with an option to |
641 |         |omit the time from the date stamp.                                 |
642 |         |For a Link or Multilink property, display the key strings of the   |
643 |         |linked nodes (or the ids if the linked class has no key property). |
644 |         |Options:                                                           |
645 |         |escape (boolean) - HTML-escape the resulting text.                 |
646 +---------+-------------------------------------------------------------------+
647 |field    |Display a property like the plain displayer above, but in a form   |
648 |         |field to be edited. Strings, Dates and Intervals use TEXT fields,  |
649 |         |Links use SELECT fields and Multilinks use SELECT MULTIPLE fields. |
650 |         |Options:                                                           |
651 |         |size (number) - width of TEXT fields.                              |
652 |         |height (number) - number of nows in SELECT MULTIPLE tags.          |
653 |         |showid (boolean) - true includes the id of linked nodes in the     |
654 |         |SELECT MULTIPLE fields.                                            |
655 +---------+-------------------------------------------------------------------+
656 |menu     |For a Links and Multilinks, display the same field as would be     |
657 |         |generated using field.                                             |
658 +---------+-------------------------------------------------------------------+
659 |link     |For a Link or Multilink property, display the names of the linked  |
660 |         |nodes, hyperlinked to the item views on those nodes.               |
661 |         |For other properties, link to this node with the property as the   |
662 |         |text.                                                              |
663 |         |Options:                                                           |
664 |         |property (property name) - the property to use in the second case. |
665 |         |showid - use the linked node id as the link text (linked node      |
666 |         |"value" will be set as a tooltip)                                  |
667 +---------+-------------------------------------------------------------------+
668 |count    |For a Multilink property, display a count of the number of links in|
669 |         |the list.                                                          |
670 |         |Arguments:                                                         |
671 |         |property (property name) - the property to use.                    |
672 +---------+-------------------------------------------------------------------+
673 |reldate  |Display a Date property in terms of an interval relative to the    |
674 |         |current date (e.g. "+ 3w", "- 2d").                                |
675 |         |Arguments:                                                         |
676 |         |property (property name) - the property to use.                    |
677 |         |Options:                                                           |
678 |         |pretty (boolean) - display the relative date in an English form.   |
679 +---------+-------------------------------------------------------------------+
680 |download |For a Link or Multilink property, display the names of the linked  |
681 |         |nodes, hyperlinked to the item views on those nodes.               |
682 |         |For other properties, link to this node with the property as the   |
683 |         |text.                                                              |
684 |         |In all cases, append the name (key property) of the item to the    |
685 |         |path so it is the name of the file being downloaded.               |
686 |         |Arguments:                                                         |
687 |         |property (property name) - the property to use.                    |
688 +---------+-------------------------------------------------------------------+
689 |checklist|For a Link or Multilink property, display checkboxes for the       |
690 |         |available choices to permit filtering.                             |
691 |         |Arguments:                                                         |
692 |         |property (property name) - the property to use.                    |
693 +---------+-------------------------------------------------------------------+
694 |note     |Display the special notes field, which is a text area for entering |
695 |         |a note to go along with a change.                                  |
696 +---------+-------------------------------------------------------------------+
697 |list     |List the nodes specified by property using the standard index for  |
698 |         |the class.                                                         |
699 |         |Arguments:                                                         |
700 |         |property (property name) - the property to use.                    |
701 +---------+-------------------------------------------------------------------+
702 |history  |List the history of the item.                                      |
703 +---------+-------------------------------------------------------------------+
704 |submit   |Add a submit button for the item.                                  |
705 +---------+-------------------------------------------------------------------+
708 Index Views
709 ~~~~~~~~~~~
711 An index view contains two sections: a filter section and an index section. The
712 filter section provides some widgets for selecting which items appear in the
713 index. The index section is a table of items.
715 Index View Specifiers
716 :::::::::::::::::::::
718 An index view specifier (URL fragment) looks like this (whitespace has been
719 added for clarity)::
721      /issue?status=unread,in-progress,resolved&
722              topic=security,ui&
723              :group=+priority&
724              :sort=-activity&
725              :filters=status,topic&
726              :columns=title,status,fixer
728 The index view is determined by two parts of the specifier: the layout part and
729 the filter part. The layout part consists of the query parameters that begin
730 with colons, and it determines the way that the properties of selected nodes
731 are displayed. The filter part consists of all the other query parameters, and
732 it determines the criteria by which nodes are selected for display.
733 The filter part is interactively manipulated with the form widgets displayed in
734 the filter section. The layout part is interactively manipulated by clicking on
735 the column headings in the table.
737 The filter part selects the union of the sets of items with values matching any
738 specified Link properties and the intersection of the sets of items with values
739 matching any specified Multilink properties.
741 The example specifies an index of "issue" nodes. Only items with a "status" of
742 either "unread" or "in-progres" or "resolved" are displayed, and only items
743 with "topic" values including both "security" and "ui" are displayed. The items
744 are grouped by priority, arranged in ascending order; and within groups, sorted
745 by activity, arranged in descending order. The filter section shows filters for
746 the "status" and "topic" properties, and the table includes columns for the
747 "title", "status", and "fixer" properties.
749 Associated with each item class is a default layout specifier. The layout
750 specifier in the above example is the default layout to be provided with the
751 default bug-tracker schema described above in section 4.4.
753 Filter Section
754 ::::::::::::::
756 The template for a filter section provides the filtering widgets at the top of
757 the index view. Fragments enclosed in <property>...</property> tags are
758 included or omitted depending on whether the view specifier requests a filter
759 for a particular property.
761 A property must appear in the filter template for it to be available as a
762 filter.
764 Here's a simple example of a filter template.::
766      <property name=status>
767          <display call="checklist('status')">
768      </property>
769      <br>
770      <property name=priority>
771          <display call="checklist('priority')">
772      </property>
773      <br>
774      <property name=fixer>
775          <display call="menu('fixer')">
776      </property>
778 The standard index generation code appends a section to the index pages which
779 allows selection of the filters - from those which are defined in the filter
780 template.
782 Index Section
783 :::::::::::::
785 The template for an index section describes one row of the index table.
786 Fragments enclosed in <property>...</property> tags are included or omitted
787 depending on whether the view specifier requests a column for a particular
788 property. The table cells should contain <display> tags to display the values
789 of the item's properties.
791 Here's a simple example of an index template.::
793      <tr>
794          <property name=title>
795              <td><display call="plain('title', max=50)"></td>
796          </property>
797          <property name=status>
798              <td><display call="plain('status')"></td>
799          </property>
800          <property name=fixer>
801              <td><display call="plain('fixer')"></td>
802          </property>
803      </tr>
805 Sorting
806 :::::::
808 String and Date values are sorted in the natural way. Link properties are
809 sorted according to the value of the "order" property on the linked nodes if it
810 is present; or otherwise on the key string of the linked nodes; or finally on
811 the node ids. Multilink properties are sorted according to how many links are
812 present.
814 Item Views
815 ~~~~~~~~~~
817 An item view contains an editor section and a spool section. At the top of an
818 item view, links to superseding and superseded items are always displayed.
820 Editor Section
821 ::::::::::::::
823 The editor section is generated from a template containing <display> tags to
824 insert the appropriate widgets for editing properties.
826 Here's an example of a basic editor template.::
828      <table>
829      <tr>
830          <td colspan=2>
831              <display call="field('title', size=60)">
832          </td>
833      </tr>
834      <tr>
835          <td>
836              <display call="field('fixer', size=30)">
837          </td>
838          <td>
839              <display call="menu('status')>
840          </td>
841      </tr>
842      <tr>
843          <td>
844              <display call="field('nosy', size=30)">
845          </td>
846          <td>
847              <display call="menu('priority')>
848          </td>
849      </tr>
850      <tr>
851          <td colspan=2>
852              <display call="note()">
853          </td>
854      </tr>
855      </table>
857 As shown in the example, the editor template can also request the display of a
858 "note" field, which is a text area for entering a note to go along with a
859 change.
861 The <property> tag used in the index may also be used here - it checks to see
862 if the nominated Multilink property has any entries. This can be used to
863 eliminate sections of the editor section if the property has no entries::
865   <td class="form-text">
866     <display call="field('superseder', size=40, showid=1)">
867     <display call="classhelp('issue', 'id,title', label='list', width=500)">
868     <property name="superseder">
869       <br>View: <display call="link('superseder', showid=1)">
870     </property>
871   </td>
873 The "View: " part with the links will only display if the superseder property
874 has values.
876 When a change is submitted, the system automatically generates a message
877 describing the changed properties.
879 If a note is given in the "note" field, the note is appended to the
880 description. The message is then added to the item's message spool (thus
881 triggering the standard detector to react by sending out this message to the
882 nosy list).
884 The message also displays all of the property values on the item and indicates
885 which ones have changed. An example of such a message might be this::
887      Polly's taken a turn for the worse - this is now really important!
888      -----
889      title: Polly Parrot is dead
890      priority: critical
891      status: unread -> in-progress
892      fixer: terry
893      keywords: parrot,plumage,perch,nailed,dead
895 Spool Section
896 :::::::::::::
898 The spool section lists messages in the item's "messages" property. The index
899 of messages displays the "date", "author", and "summary" properties on the
900 message nodes, and selecting a message takes you to its content.
902 The <property> tag used in the index may also be used here - it checks to see
903 if the nominated Multilink property has any entries. This can be used to
904 eliminate sections of the spool section if the property has no entries::
906      <property name="files">
907       <tr class="strong-header">
908        <td><b>Files</b></td>
909       </tr>
911       <tr>
912        <td><display call="list('files')"></td>
913       </tr>
914      </property>
917 Access Controls
918 ---------------
920 A set of Permissions are built in to the security module by default:
922 - Edit (everything)
923 - View (everything)
925 The default interfaces define:
927 - Web Registration
928 - Web Access
929 - Email Registration
930 - Email Access
932 These are hooked into the default Roles:
934 - Admin (Edit everything, View everything)
935 - User (Web Access, Email Access)
936 - Anonymous (Web Registration, Email Registration)
938 And finally, the "admin" user gets the "Admin" Role, and the "anonymous" user
939 gets the "Anonymous" assigned when the database is initialised on installation.
940 The two default schemas then define:
942 - Edit issue, View issue (both)
943 - Edit file, View file (both)
944 - Edit msg, View msg (both)
945 - Edit support, View support (extended only)
947 and assign those Permissions to the "User" Role. New users are assigned the
948 Roles defined in the config file as:
950 - NEW_WEB_USER_ROLES
951 - NEW_EMAIL_USER_ROLES
953 You may alter the configuration variables to change the Role that new web or
954 email users get, for example to not give them access to the web interface if
955 they register through email.
957 You may use the ``roundup-admin`` "``security``" command to display the
958 current Role and Permission configuration in your instance.
961 -----------------
963 Back to `Table of Contents`_
965 .. _`Table of Contents`: index.html