comparison doc/reference.txt @ 7868:6c219034bf31

doc: vale corrections and some rewriting.
author John Rouillard <rouilj@ieee.org>
date Sun, 07 Apr 2024 23:16:58 -0400
parents 1774fdf2010a
children d4f6ba8e3c1e
comparison
equal deleted inserted replaced
7867:1774fdf2010a 7868:6c219034bf31
3708 3708
3709 The utils variable 3709 The utils variable
3710 ~~~~~~~~~~~~~~~~~~ 3710 ~~~~~~~~~~~~~~~~~~
3711 3711
3712 This is implemented by the 3712 This is implemented by the
3713 ``roundup.cgi.templating.TemplatingUtils`` class, which may be extended 3713 ``roundup.cgi.templating.TemplatingUtils`` class. New methods can
3714 with additional methods by extensions_. 3714 be added to the variable by using extensions_.
3715 3715
3716 .. table:: 3716 .. table::
3717 :class: valign-top 3717 :class: valign-top
3718 3718
3719 =============== ======================================================== 3719 =============== ========================================================
3726 values from the supplied dictionary. 3726 values from the supplied dictionary.
3727 html_quote quote some text as safe in HTML (ie. <, >, ...) 3727 html_quote quote some text as safe in HTML (ie. <, >, ...)
3728 html_calendar renders an HTML calendar used by the 3728 html_calendar renders an HTML calendar used by the
3729 ``_generic.calendar.html`` template (itself invoked by 3729 ``_generic.calendar.html`` template (itself invoked by
3730 the popupCalendar DateHTMLProperty method 3730 the popupCalendar DateHTMLProperty method
3731 readfile read Javascript or other content in an external 3731 readfile read JavaScript or other content in an external
3732 file into the template. 3732 file into the template.
3733 url_quote quote some text as safe for a URL (ie. space, %, ...) 3733 url_quote quote some text as safe for a URL (ie. space, %, ...)
3734 =============== ======================================================== 3734 =============== ========================================================
3735 3735
3736 Additional info can be obtained by starting ``python`` with the 3736 Additional info can be obtained by starting ``python`` with the
3771 :class: valign-top 3771 :class: valign-top
3772 3772
3773 ========= ============================================================== 3773 ========= ==============================================================
3774 Parameter Usage 3774 Parameter Usage
3775 ========= ============================================================== 3775 ========= ==============================================================
3776 sequence a list of HTMLItems
3777 size how big to make the sequence.
3778 start where to start (0-indexed) in the sequence.
3779 end where to end (0-indexed) in the sequence. 3776 end where to end (0-indexed) in the sequence.
3780 orphan if the next batch would contain less items than this value, 3777 orphan if the next batch would contain less items than this value,
3781 then it is combined with this batch 3778 then it is combined with this batch
3782 overlap the number of items shared between adjacent batches 3779 overlap the number of items shared between adjacent batches
3780 sequence a list of HTMLItems
3781 size how big to make the sequence.
3782 start where to start (0-indexed) in the sequence.
3783 ========= ============================================================== 3783 ========= ==============================================================
3784 3784
3785 All of the parameters are assigned as attributes on the batch object. In 3785 All of the parameters are assigned as attributes on the batch object. In
3786 addition, it has several more attributes: 3786 addition, it has several more attributes:
3787 3787
3789 :class: valign-top 3789 :class: valign-top
3790 3790
3791 =============== ======================================================== 3791 =============== ========================================================
3792 Attribute Description 3792 Attribute Description
3793 =============== ======================================================== 3793 =============== ========================================================
3794 start indicates the start index of the batch. *Unlike
3795 the argument, is a 1-based index (I know, lame)*
3796 first indicates the start index of the batch *as a 0-based 3794 first indicates the start index of the batch *as a 0-based
3797 index* 3795 index*
3798 length the actual number of elements in the batch 3796 length the actual number of elements in the batch
3797 start indicates the start index of the batch. *Unlike
3798 the argument, is a 1-based index (I know, lame)*
3799 sequence_length the length of the original, unbatched, sequence. 3799 sequence_length the length of the original, unbatched, sequence.
3800 =============== ======================================================== 3800 =============== ========================================================
3801 3801
3802 And several methods: 3802 And several methods:
3803 3803
3823 tal:repeat="keyword batch" tal:content="keyword/name"> 3823 tal:repeat="keyword batch" tal:content="keyword/name">
3824 keyword here</td> 3824 keyword here</td>
3825 </tr> 3825 </tr>
3826 </table> 3826 </table>
3827 3827
3828 ... which will produce a table with four columns containing the items of 3828 will produce a table with four columns containing the items of
3829 the "keyword" class (well, their "name" anyway). 3829 the "keyword" class (well, their "name" anyway).
3830 3830
3831 3831
3832 Translations 3832 Translations
3833 ~~~~~~~~~~~~ 3833 ~~~~~~~~~~~~
3857 3857
3858 <tal:x tal:replace="python:request.client.setHeader( 3858 <tal:x tal:replace="python:request.client.setHeader(
3859 'Content-Type', 'application/atom+xml' 3859 'Content-Type', 'application/atom+xml'
3860 )"/> 3860 )"/>
3861 3861
3862 will set the Content-Type header. The header name is case sensitive, 3862 will set the ``Content-Type`` header. The header name is case sensitive,
3863 so use capital letters as shown. If you don't you end up with multiple 3863 so use capital letters as shown. If you don't you end up with multiple
3864 Content-Type definitions returned to the browser. 3864 Content-Type definitions returned to the browser.
3865 3865
3866 Displaying Properties 3866 Displaying Properties
3867 --------------------- 3867 ---------------------
3868 3868
3869 Properties appear in the user interface in three contexts: in indices, 3869 Properties appear in the user interface in three contexts: in indices,
3870 in editors, and as search arguments. For each type of property, there 3870 in editors, and as search arguments. For each type of property, there
3871 are several display possibilities. For example, in an index view, a 3871 are several display possibilities. For example, in an index view, a
3872 string property may just be printed as a plain string, but in an editor 3872 string property may just be printed as a plain string. In an editor
3873 view, that property may be displayed in an editable field. 3873 view, that property may be displayed in an editable field.
3874 3874
3875 3875
3876 Index Views 3876 Index Views
3877 ----------- 3877 -----------
3893 @filters=status,keyword& 3893 @filters=status,keyword&
3894 @columns=title,status,fixer 3894 @columns=title,status,fixer
3895 3895
3896 The index view is determined by two parts of the specifier: the layout 3896 The index view is determined by two parts of the specifier: the layout
3897 part and the filter part. The layout part consists of the query 3897 part and the filter part. The layout part consists of the query
3898 parameters that begin with colons, and it determines the way that the 3898 parameters that begin with the '@' character, and it determines
3899 properties of selected items are displayed. The filter part consists of 3899 the way that the properties of selected items are displayed. The
3900 all the other query parameters, and it determines the criteria by which 3900 filter part consists of all the other query parameters, and it
3901 items are selected for display. The filter part is interactively 3901 determines the criteria by which items are selected for
3902 manipulated with the form widgets displayed in the filter section. The 3902 display. The filter part is interactively manipulated with the
3903 layout part is interactively manipulated by clicking on the column 3903 form widgets displayed in the filter section. The layout part is
3904 headings in the table. 3904 interactively manipulated by clicking on the column headings in
3905 the table.
3905 3906
3906 The filter part selects the union of the sets of items with values 3907 The filter part selects the union of the sets of items with values
3907 matching any specified Link properties and the intersection of the sets 3908 matching any specified Link properties and the intersection of the sets
3908 of items with values matching any specified Multilink properties. 3909 of items with values matching any specified MultiLink properties.
3909 3910
3910 The example specifies an index of "issue" items. Only items with a 3911 The example specifies an index of "issue" items. Only items with a
3911 "status" of either "unread" or "in-progress" or "resolved" are 3912 "status" of either "unread", "in-progress" or "resolved" are
3912 displayed, and only items with "keyword" values including both "security" 3913 displayed, and only items with "keyword" values including both "security"
3913 and "ui" are displayed. The items are grouped by priority arranged in 3914 and "ui" are displayed. The items are grouped by priority arranged in
3914 ascending order and in descending order by status; and within 3915 ascending order and in descending order by status; and within
3915 groups, sorted by activity, arranged in descending order. The filter 3916 groups, sorted by activity, arranged in descending order. The filter
3916 section shows filters for the "status" and "keyword" properties, and the 3917 section shows filters for the "status" and "keyword" properties, and the
3961 ``@action`` variable. The "search" action: 3962 ``@action`` variable. The "search" action:
3962 3963
3963 - sets up additional filtering, as well as performing indexed text 3964 - sets up additional filtering, as well as performing indexed text
3964 searching 3965 searching
3965 - sets the ``@filter`` variable correctly 3966 - sets the ``@filter`` variable correctly
3966 - saves the query off if ``@query_name`` is set. 3967 - saves the query to the user's query list if ``@query_name`` is set.
3967 3968
3968 The search page should lay out any fields that you wish to allow the 3969 The search page should lay out any fields that you wish to allow the
3969 user to search on. If your schema contains a large number of properties, 3970 user to search on. If your schema contains a large number of properties,
3970 you should be wary of making all of those properties available for 3971 you should be wary of making all of those properties available for
3971 searching, as this can cause confusion. If the additional properties are 3972 searching, as this can cause confusion. If the additional properties are
3981 3982
3982 ============ ============================================================= 3983 ============ =============================================================
3983 Argument Description 3984 Argument Description
3984 ============ ============================================================= 3985 ============ =============================================================
3985 @query_name if supplied, the index parameters (including @search_text) 3986 @query_name if supplied, the index parameters (including @search_text)
3986 will be saved off as a the query item and registered against 3987 will be saved as a the query item and registered against
3987 the user's queries property. Note that the *classic* template 3988 the user's queries property. Note that the *classic* template
3988 schema has this ability, but the *minimal* template schema 3989 schema has this ability, but the *minimal* template schema
3989 does not. 3990 does not.
3990 ============ ============================================================= 3991 ============ =============================================================
3991 3992
4047 </tr> 4048 </tr>
4048 4049
4049 <tr> 4050 <tr>
4050 <th>Change Note</th> 4051 <th>Change Note</th>
4051 <td colspan="3"> 4052 <td colspan="3">
4052 <textarea name=":note" wrap="hard" rows="5" cols="60"></textarea> 4053 <textarea name="@note" wrap="hard" rows="5" cols="60"></textarea>
4053 </td> 4054 </td>
4054 </tr> 4055 </tr>
4055 4056
4056 <tr> 4057 <tr>
4057 <th>File</th> 4058 <th>File</th>
4058 <td colspan="3"><input type="file" name=":file" size="40"></td> 4059 <td colspan="3"><input type="file" name="@file" size="40"></td>
4059 </tr> 4060 </tr>
4060 4061
4061 <tr> 4062 <tr>
4062 <td>&nbsp;</td> 4063 <td>&nbsp;</td>
4063 <td colspan="3" tal:content="structure context/submit"> 4064 <td colspan="3" tal:content="structure context/submit">
4067 </table> 4068 </table>
4068 4069
4069 4070
4070 When a change is submitted, the system automatically generates a message 4071 When a change is submitted, the system automatically generates a message
4071 describing the changed properties. As shown in the example, the editor 4072 describing the changed properties. As shown in the example, the editor
4072 template can use the ":note" and ":file" fields, which are added to the 4073 template can use the "@note" and "@file" fields, which are added to the
4073 standard changenote message generated by Roundup. 4074 standard changenote message generated by Roundup.
4074 4075
4075 4076
4076 Form values 4077 Form values
4077 ::::::::::: 4078 :::::::::::
4078 4079
4079 We have a number of ways to pull properties out of the form in order to 4080 We have a number of ways to pull properties out of the form in order to
4080 meet the various needs of: 4081 meet the various needs of:
4081 4082
4082 1. editing the current item (perhaps an issue item) 4083 1. editing the current item (perhaps an issue item)
4083 2. editing information related to the current item (eg. messages or 4084 2. editing information related to the current item (e.g. messages or
4084 attached files) 4085 attached files)
4085 3. creating new information to be linked to the current item (eg. time 4086 3. creating new information to be linked to the current item (e.g. time
4086 spent on an issue) 4087 spent on an issue)
4087 4088
4088 In the following, ``<bracketed>`` values are variable, ":" may be one of 4089 In the following, ``<bracketed>`` values are variable, ":" may be one of
4089 ":" or "@", and other text ("required") is fixed. 4090 ":" or "@", and other text ("required") is fixed.
4090 4091
4098 4099
4099 ``<classname>-<N>:<propname>`` 4100 ``<classname>-<N>:<propname>``
4100 property on the Nth new item of classname (generally for creating new 4101 property on the Nth new item of classname (generally for creating new
4101 items to attach to the current item) 4102 items to attach to the current item)
4102 4103
4103 Once we have determined the "propname", we check to see if it is one of 4104 Once we have determined the "propname", check to see if it is one of
4104 the special form values: 4105 the special form values:
4105 4106
4106 ``@required`` 4107 ``@required``
4107 The named property values must be supplied or a ValueError will be 4108 The named property values must be supplied or a ValueError will be
4108 raised. 4109 raised.
4172 4173
4173 4174
4174 Defining new web actions 4175 Defining new web actions
4175 ------------------------ 4176 ------------------------
4176 4177
4177 You may define new actions to be triggered by the ``@action`` form variable. 4178 You may define new actions triggered by the ``@action`` form variable.
4178 These are added to the tracker ``extensions`` directory and registered 4179 These defined in the tracker's ``extensions`` directory and registered
4179 using ``instance.registerAction``. 4180 using ``instance.registerAction``.
4180 4181
4181 All the existing Actions are defined in ``roundup.cgi.actions``. 4182 All the pre-existing Actions are defined in ``roundup.cgi.actions``.
4182 4183
4183 Adding action classes takes three steps; first you `define the new 4184 Adding action classes takes three steps; first you `define the new
4184 action class`_, then you `register the action class`_ with the cgi 4185 action class`_, then you `register the action class`_ with the cgi
4185 interface so it may be triggered by the ``@action`` form variable. 4186 interface so it can be triggered by the ``@action`` form variable.
4186 Finally you `use the new action`_ in your HTML form. 4187 Finally you `use the new action`_ in your HTML form.
4187 4188
4188 See `setting up a "wizard" (or "druid") for controlled adding of 4189 See `setting up a "wizard" (or "druid") for controlled adding of
4189 issues 4190 issues
4190 <customizing.html#setting-up-a-wizard-or-druid-for-controlled-adding-of-issues>`_ for an example. 4191 <customizing.html#setting-up-a-wizard-or-druid-for-controlled-adding-of-issues>`_ for an example.
4251 override the content type indicated to the user by calling ``setHeader``:: 4252 override the content type indicated to the user by calling ``setHeader``::
4252 4253
4253 self.client.setHeader('Content-Type', 'text/csv') 4254 self.client.setHeader('Content-Type', 'text/csv')
4254 4255
4255 This example indicates that the value sent back to the user is actually 4256 This example indicates that the value sent back to the user is actually
4256 comma-separated value content (eg. something to be loaded into a 4257 comma-separated value content (i.e. something to load into a
4257 spreadsheet or database). 4258 spreadsheet or database).
4258 4259
4259 4260
4260 8-bit character set support in Web interface 4261 8-bit character set support in Web interface
4261 -------------------------------------------- 4262 --------------------------------------------
4262 4263
4263 The web interface uses UTF-8 default. It may be overridden in both forms 4264 The web interface uses UTF-8 default. It may be overridden in
4264 and a browser cookie. 4265 both forms and a browser cookie. In general, the UTF-8 standard
4266 should work with all modern browsers. You shouldn't have to
4267 make any modifications from this section.
4265 4268
4266 - In forms, use the ``@charset`` variable. 4269 - In forms, use the ``@charset`` variable.
4267 - To use the cookie override, have the ``roundup_charset`` cookie set. 4270 - To use the cookie override, have the ``roundup_charset`` cookie set.
4268 4271
4269 In both cases, the value is a valid charset name (eg. ``utf-8`` or 4272 In both cases, the value is a valid charset name (eg. ``utf-8`` or
4270 ``kio8-r``). 4273 ``kio8-r``).
4271 4274
4272 Inside Roundup, all strings are stored and processed in utf-8. 4275 Inside Roundup, all strings are stored and processed in utf-8.
4273 Unfortunately, some older browsers do not work properly with 4276 Unfortunately, some older browsers do not work properly with
4274 utf-8-encoded pages (e.g. Netscape Navigator 4 displays wrong 4277 utf-8-encoded pages (e.g. Netscape Navigator 4 displays wrong
4275 characters in form fields). This version allows one to change 4278 characters in form fields). Roundup allows one to change
4276 the character set for http transfers. To do so, you may add 4279 the character set for http transfers. To do so, you may add
4277 the following code to your ``page.html`` template:: 4280 the following code to your ``page.html`` template::
4278 4281
4279 <tal:block define="uri string:${request/base}${request/env/PATH_INFO}"> 4282 <tal:block define="uri string:${request/base}${request/env/PATH_INFO}">
4280 <a tal:attributes="href python:request.indexargs_url(uri, 4283 <a tal:attributes="href python:request.indexargs_url(uri,
4281 {'@charset':'utf-8'})">utf-8</a> 4284 {'@charset':'utf-8'})">utf-8</a>
4294 /> 4297 />
4295 4298
4296 The charset is also sent in the http header. 4299 The charset is also sent in the http header.
4297 4300
4298 4301
4299
4300
4301
4302 Debugging Trackers 4302 Debugging Trackers
4303 ================== 4303 ==================
4304 4304
4305 There are three switches in tracker configs that turn on debugging in 4305 There are three switches in tracker configs that turn on debugging in
4306 Roundup: 4306 Roundup:

Roundup Issue Tracker: http://roundup-tracker.org/