Menu

Commit [r6055]  Maximize  Restore  History

TracDev/ContextRefactoring: initial approach to the refactoring

The main idea here is to remove from the `Context` class all the aspects related to resource identification and description, and to keep only what is needed for doing the rendering.

In effect, the main focus of that `Context` class is now to be exclusively a "rendering context", which aims at providing all the necessary information for the rendering layer, ultimately allowing us to get rid on the dependency on the `req` in this part of the code.

The resource identification part is now the responsibility of a new `Resource` class, which is quite simple (no subclassing) and mainly offers a convenient access to the `.realm`, `.id` and `.version` information.

A `Resource` also provides a convenient way to call the `IResourceManager` methods of the component in charge of the realm of that resource. Those `IResourceManager` methods are:
- `get_resource_url` for retrieving the canonical URL associated to the resource
- `get_resource_description` for retrieving a representation of the resource in a generic way, according to some format

Finally, a `Resource` offers some facilities for creating other related resources, mostly useful for creating a resource for another version than the current one or for creating `child` resources.

The fine grained permissions are now operating exclusively on the `Resource` objects, not on `Context` objects anymore.

The current changeset is pretty large, but most of the changes are happening in a few places, like the trac/context.py file which is nearly entirely rewritten and in 3 modules: the attachment, the wiki/web_ui.py and the ticket/web_ui.py.

The state of this branch is quite stable, all the unit tests are passing and the features are mostly all working, with the exception of Ticket diff views.

So I think this is a good basis for further experiments.

cboos 2007-10-15

1 2 3 > >> (Page 1 of 3)
changed /sandbox/context-refactoring/trac/attachment.py
changed /sandbox/context-refactoring/trac/context.py
changed /sandbox/context-refactoring/trac/mimeview/tests/patch.py
changed /sandbox/context-refactoring/trac/notification.py
changed /sandbox/context-refactoring/trac/perm.py
changed /sandbox/context-refactoring/trac/search/web_ui.py
changed /sandbox/context-refactoring/trac/templates/attachment.html
changed /sandbox/context-refactoring/trac/templates/diff_view.html
changed /sandbox/context-refactoring/trac/templates/error.html
changed /sandbox/context-refactoring/trac/templates/header.cs
changed /sandbox/context-refactoring/trac/templates/history_view.html
changed /sandbox/context-refactoring/trac/templates/layout.html
changed /sandbox/context-refactoring/trac/templates/macros.html
changed /sandbox/context-refactoring/trac/tests/wikisyntax.py
changed /sandbox/context-refactoring/trac/ticket/api.py
changed /sandbox/context-refactoring/trac/ticket/model.py
changed /sandbox/context-refactoring/trac/ticket/query.py
changed /sandbox/context-refactoring/trac/ticket/report.py
changed /sandbox/context-refactoring/trac/ticket/roadmap.py
changed /sandbox/context-refactoring/trac/ticket/templates/milestone_view.html
changed /sandbox/context-refactoring/trac/ticket/templates/query.html
changed /sandbox/context-refactoring/trac/ticket/templates/query.rss
changed /sandbox/context-refactoring/trac/ticket/templates/query_results.html
changed /sandbox/context-refactoring/trac/ticket/templates/report.rss
changed /sandbox/context-refactoring/trac/ticket/templates/report_view.html
/sandbox/context-refactoring/trac/attachment.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/context.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/mimeview/tests/patch.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/notification.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/perm.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/search/web_ui.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/templates/attachment.html Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/templates/diff_view.html Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/templates/error.html Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/templates/header.cs Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/templates/history_view.html Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/templates/layout.html Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/templates/macros.html Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/tests/wikisyntax.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/api.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/model.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/query.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/report.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/roadmap.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/templates/milestone_view.html Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/templates/query.html Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/templates/query.rss Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/templates/query_results.html Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/templates/report.rss Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/ticket/templates/report_view.html Diff Switch to side-by-side view
Loading...
1 2 3 > >> (Page 1 of 3)