Edgewall Software

Changes between Version 32 and Version 33 of TracDev/ApiChanges/0.11


Ignore:
Timestamp:
Mar 13, 2008, 2:24:53 PM (16 years ago)
Author:
Christian Boos
Comment:

Add some more source links, verified and update all of them to point to tags/trac-0.11b2 instead of trunk

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/ApiChanges/0.11

    v32 v33  
    2626
    2727Since r3935, Trac uses `datetime` objects internally, instead of timestamps.
    28 More precisely, the database layer still uses `int` timestamps, but manipulation of time values is now done on `datetime` objects as soon as possible, see e.g. the [source:trunk/trac/Timeline.py Timeline] module.
     28More precisely, the database layer still uses `int` timestamps, but manipulation of time values is now done on `datetime` objects as soon as possible, see e.g. the [source:tags/trac-0.11b2/trac/Timeline.py Timeline] module.
    2929
    30 Those `datetime` values are directly added by the controllers to the data model, and it's the responsibility of the ''templates'' to pick up the appropriate time representation, using one of the built-in date formatting utilities: `format_date`, `format_datetime`, `http_date`, `pretty_timedelta` (see [source:trunk/trac/chrome.py chrome.py]), or even the `$dateinfo()` macro.
     30Those `datetime` values are directly added by the controllers to the data model, and it's the responsibility of the ''templates'' to pick up the appropriate time representation, using one of the built-in date formatting utilities: `format_date`, `format_datetime`, `http_date`, `pretty_timedelta` (see [source:tags/trac-0.11b2/trac/chrome.py chrome.py]), or even the `$dateinfo()` macro.
    3131
    3232Those utilities automatically take into account the ''timezone'' information set by the user, so that the dates are presented in a meaningful way to him.
     
    3636The Trac macros will need to be adapted:
    3737 - the old-style wiki-macros are not supported anymore (due to the drop of ClearSilver and the HDF); they need to be converted to the new-style macros
    38  - new-style macros are [#IWikiMacroProvider] plugins. They can be written as full plugins or simple one file drop-in plugins, see source:trunk/sample-plugins for some examples (TODO: source:tags/trac-0.11/sample-plugins/macros)
     38 - new-style macros are [#IWikiMacroProvider] plugins. They can be written as full plugins or simple one file drop-in plugins, see source:tags/trac-0.11b2/sample-plugins for some examples (TODO: source:tags/trac-0.11/sample-plugins/macros)
    3939
    4040=== Modified Interfaces ===
    41 ==== `ITimelineEventProvider` ^[source:trunk/trac/timeline/api.py@head#L87 (0.11)] [source:tags/trac-0.10/trac/Timeline.py@head#L32 (0.10)]^ ==== #ITimelineEventProvider
     41==== `ITimelineEventProvider` ^[source:tags/trac-0.11b2/trac/timeline/api.py@#L28 (0.11)] [source:tags/trac-0.10/trac/Timeline.py@#L32 (0.10)]^ ==== #ITimelineEventProvider
    4242
    4343First thing, the timeline module has now its own package (`trac.timeline`), and the ITimelineEventProvider interface itself should now be imported from `trac.timeline`. However, note that the case has changed here, as you would previously have imported `trac.Timeline`. If you want to support both versions, try something like this:
     
    7575}}}
    7676
    77 ==== `ISearchSource` ^[source:trunk/trac/search/api.py@head#L17 (0.11)] [source:tags/trac-0.10/trac/search.py@head#L30 (0.10)]^ ==== #ISearchSource
     77==== `ISearchSource` ^[source:tags/trac-0.11b2/trac/search/api.py@#L17 (0.11)] [source:tags/trac-0.10/trac/Search.py@#L30 (0.10)]^ ==== #ISearchSource
    7878
    7979Similar to the timeline package, the search module has also been migrated to a package (`trac.search`), with the same case change. Again, if you want to support both versions, try something like this:
     
    8787}}}
    8888
    89 ==== `IWikiMacroProvider` ^[source:trunk/trac/wiki/api.py@head#L73 (0.11)] [source:tags/trac-0.10/trac/wiki/api.py@head#L70 (0.10)]^ ==== #IWikiMacroProvider
     89==== `IWikiMacroProvider` ^[source:tags/trac-0.11b2/trac/wiki/api.py@#L77 (0.11)] [source:tags/trac-0.10/trac/wiki/api.py@#L70 (0.10)]^ ==== #IWikiMacroProvider
    9090
    9191 - `render_macro(req, name, content)` has been deprecated (see r4621)
     
    102102`render_macro(req, name, content)` will likely be removed in [milestone:0.12].
    103103
    104 ==== `IHTMLPreviewRenderer` ^[source:trunk/trac/wiki/api.py@head#L213 (0.11)] [source:tags/trac-0.10/trac/wiki/api.py@head#L209 (0.10)]^ ==== #IHTMLPreviewRenderer
     104==== `IHTMLPreviewRenderer` ^[source:tags/trac-0.11b2/trac/mimeview/api.py@#L367 (0.11)] [source:tags/trac-0.10/trac/mimeview/api.py@#L209 (0.10)]^ ==== #IHTMLPreviewRenderer
    105105
    106106Similar to the above change, `render(req, mimetype ...)` is now `render(context, mimetype ...)`, `context` being a rendering `Context` (see below).
    107107It doesn't matter that much however, as it looks like that this interface is going to be integrated in `IContentConverter` anyway (see #3332 - 0.12 topic unfortunately).
    108108
    109 ==== `IRequestFilter`  ^[source:tags/trac-0.11b2/trac/web/api.py@head#L539 (0.11)] [source:tags/trac-0.10/trac/web/api.py@head#L467 (0.10)]^ ==== #IRequestFilter
     109==== `IRequestFilter`  ^[source:tags/trac-0.11b2/trac/web/api.py@#L539 (0.11)] [source:tags/trac-0.10/trac/web/api.py@#L467 (0.10)]^ ==== #IRequestFilter
    110110
    111111The `post_process_request` method has now the following arguments `(req, template, data, content_type)` instead of `(req, template, content_type)`. `data` is the data dictionary used while generating the template.
     
    123123
    124124=== New Classes ===
    125 ==== `trac.resource.Resource` ==== #Resource
     125==== `trac.resource.Resource` ^[source:tags/trac-0.11b2/trac/resource.py@#L75 (0.11)]^ ==== #Resource
    126126
    127127The '''resource identifier''' class `Resource` is used to specify in a convenient way which Trac ''resources'' is being manipulated.
     
    132132Finally, a resource can be parented in another resource. This relationship usually means that a removal of the parent resource implies a removal of the children resources.
    133133
    134 ==== `trac.mimeview.api.Context` ==== #Context
     134==== `trac.mimeview.api.Context` ^[source:tags/trac-0.11b2/trac/mimeview/api.py@#L78 (0.11)]^ ==== #Context
    135135
    136136The '''rendering context''' class is used to specify ''how'' the content should be rendered.
     
    143143
    144144=== New Interfaces ===
    145 ==== `trac.resource.IResourceManager` ==== #IResourceManager
     145==== `trac.resource.IResourceManager` ^[source:tags/trac-0.11b2/trac/resource.py@#L28 (0.11)]^ ==== #IResourceManager
    146146
    147147The `IResourceManager` let components claim ownership of some realms.
     
    149149Various utility functions exist in the `trac.resource` module in order to manipulate the `Resource` identifier objects in a generic way.
    150150
    151 ==== `trac.perm.IPermissionPolicy` ^[source:trunk/trac/perm.py@6242#L107 (0.11)]^ ==== #IPermissionPolicy
     151==== `trac.perm.IPermissionPolicy` ^[source:tags/trac-0.11b2/trac/perm.py@#L107 (0.11)]^ ==== #IPermissionPolicy
    152152
    153153The `IPermissionPolicy` components can be used to grant or reject any kind of permissions, based on the identity of the user and the targeted resource, subject of the action. The API is conceptually simple, as the permission policies are chained (using the sequence defined in the `[trac] permission_policies` configuration entry), and the first policy in the chain which makes a decision about the given (action, user, resource) triple wins. Making a decision consist in returning `True` for allowing the action, `False` for rejecting the action. `None` can also be returned to let the next policy in the chain decide. If no decision has been made in the end, the action is not allowed.
     
    155155Look at the API documentation for a few more details (what to return when no resource or a "realm" resource is specified, usage of the permission cache).
    156156
    157 ==== `trac.attachment.ILegacyAttachmentDelegate` ^[source:trunk/trac/attachment.py@6242#L82 (0.11)]^ ==== #ILegacyAttachmentDelegate
     157==== `trac.attachment.ILegacyAttachmentDelegate` ^[source:tags/trac-0.11b2/trac/attachment.py@#L82 (0.11)]^ ==== #ILegacyAttachmentDelegate
    158158This interface is mostly like the above [#IPermissionPolicy IPermissionPolicy] one, except that it enables attachment providers to hook automatically into the default legacy attachment policy, which is already enabled by default.
    159159
    160 ==== `trac.ticket.api.ITicketActionController` ==== #ITicketActionController
     160==== `trac.ticket.api.ITicketActionController` ^[source:tags/trac-0.11b2/trac/ticket/api.py@#L33 (0.11)]^ ==== #ITicketActionController
    161161
    162162TBD. See TracWorkflow.
    163163
    164 ==== `trac.ticket.roadmap.ITicketGroupStatsProvider` ==== #ITicketGroupStatsProvider
     164==== `trac.ticket.roadmap.ITicketGroupStatsProvider` ^[source:tags/trac-0.11b2/trac/ticket/roadmap.py@#L45 (0.11)]^ ==== #ITicketGroupStatsProvider
    165165 
    166166TBD.
    167167 
    168 ==== `trac.web.ITemplateStreamFilter` ==== #ITemplateStreamFilter
     168==== `trac.web.ITemplateStreamFilter` ^[source:tags/trac-0.11b2/trac/web/api.py@#L576 (0.11)]^ ==== #ITemplateStreamFilter
    169169
    170170In Trac 0.11, while it's still possible to customize the Genshi templates like it was for the Clearsilver ones in previous versions, this is no longer the only way, neither the preferred. What makes the use of the Genshi templating system fairly unique is that you can manipulate the generated output at run-time, in order to filter out some content, modify it or even inject new content.
     
    172172
    173173Some useful references:
    174  - [http://trac.edgewall.org/browser/trunk/sample-plugins/ticket_clone.py sample-plugins/ticket_clone.py], an example of such a plugin, which adds a "Clone" button in the ticket description box:
     174 - [http://trac.edgewall.org/browser/tags/trac-0.11b2/sample-plugins/ticket_clone.py sample-plugins/ticket_clone.py], an example of such a plugin, which adds a "Clone" button in the ticket description box:
    175175 - [genshi:wiki:ApiDocs/genshi.filters.transform genshi.filters.transform], the API documentation for genshi transform filters which makes such manipulations a breeze
    176176
    177177
    178 ==== `trac.prefs.api.IPreferencePanelProvider` ==== #IPreferencePanelProvider
     178==== `trac.prefs.api.IPreferencePanelProvider` ^[source:tags/trac-0.11b2/trac/prefs/api.py (0.11)]^ ==== #IPreferencePanelProvider
    179179
    180180TBD.
    181181
    182 ==== `trac.versioncontrol.web_ui.browser.IPropertyRenderer` ^[source:trunk/trac/versioncontrol/web_ui/browser.py@head#L46 (0.11)] ==== #IPropertyRenderer
     182==== `trac.versioncontrol.web_ui.browser.IPropertyRenderer` ^[source:tags/trac-0.11b2/trac/versioncontrol/web_ui/browser.py@#L48 (0.11)]^ ==== #IPropertyRenderer
    183183
    184184The presentation of version control properties for files and directories can be customized to a great extent.
    185185The revision properties can be customized in a similar way.
    186186
    187 ==== `trac.versioncontrol.web_ui.changeset.IPropertyDiffRenderer` ^[source:trunk/trac/versioncontrol/web_ui/changeset.py@head#L51 (0.11)] ==== #IPropertyDiffRenderer
     187==== `trac.versioncontrol.web_ui.changeset.IPropertyDiffRenderer` ^[source:tags/trac-0.11b2/trac/versioncontrol/web_ui/changeset.py@#L52 (0.11)]^ ==== #IPropertyDiffRenderer
    188188
    189189Likewise, the presentation of changes for version control properties can be customized.
    190190
    191 ==== `trac.admin.api.IAdminPanelProvider` ==== #IAdminPanelProvider
     191==== `trac.admin.api.IAdminPanelProvider` ^[source:tags/trac-0.11b2/trac/admin/api.py (0.11)]^ ==== #IAdminPanelProvider
     192
    192193!WebAdmin is now part of the core.
    193194The previously external interface `webadmin.web_ui.IAdminPageProvider` is now a core interface: `trac.admin.api.IAdminPanelProvider`.