Modify

Opened 10 years ago

Closed 10 years ago

Last modified 2 years ago

#11615 closed enhancement (fixed)

Extension point for event providers

Reported by: Peter Suter Owned by: lucid
Priority: normal Component: WeekPlanPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

This plugin could define a new extension point for event providers.

The existing DB stored notes would then be moved to a separate component, and additional components could be added for different kinds of events:

  • Milestone and ticket events (due dates)
  • External iCalendar feed events
  • ...

These providers should define a "plan prefix" and are used as data sources when that prefix is used. (E.g. [[WeekPlan(plan=milestone:iteration1|ical:myfeed)]])

They should also be informed if the event is moved / edited. (Or !mark events as readonly.)

Attachments (4)

T11615-extension-point.patch (5.5 KB) - added by lucid 10 years ago.
T11615-milestones.patch (2.6 KB) - added by lucid 10 years ago.
T11615-extension-point-2.diff (5.9 KB) - added by lucid 10 years ago.
T11615-milestones-2.patch (2.7 KB) - added by lucid 10 years ago.

Download all attachments as: .zip

Change History (13)

Changed 10 years ago by lucid

Changed 10 years ago by lucid

Attachment: T11615-milestones.patch added

comment:1 Changed 10 years ago by lucid

The attached patches:

  • Defines an extension point for event providers.
  • Moves the existing DB events into a provider implementation.
  • Partially implement an additional provider for milestones due and completion dates.
    • Example: [[WeekPlan(plan=milestone:milestone1)]]

Both need some refinement but the basic concept is working.

  • Extension point:
    • Should wait until plugin is stable? (Fix WeekPlanPlugin#KnownLimitations first?)
    • Better concept for which provider handles which events / plans / prefixes and only call responsible provider?
  • Milestones:
    • Either milestone events should be marked as readonly somehow.
    • Or milestone add, update and delete should be implemented somehow.

Changed 10 years ago by lucid

Changed 10 years ago by lucid

Attachment: T11615-milestones-2.patch added

comment:2 Changed 10 years ago by lucid

Updated patches (works with event sources, see changeset:14089).

Now only calls responsible providers.

comment:3 Changed 10 years ago by lucid

Resolution: fixed
Status: newclosed

In 14175:

WeekPlanPlugin: Define IWeekPlanEventProvider extension point. (fix #11615)
Bump version to 1.1.

Parse as UTC so localtimezone is ignored.
Update drop / resize event arguments.
Only hook up the enter key to submit dialogs of this plugin.
Tweak default colors.

comment:4 Changed 7 years ago by pleumann

I managed to include a list of regex-filtered milestone due dates into our week calendar by means of a modified version of the T11615-milestones-2.patch. I see the following possible improvements:

  • Display in the legend could be nicer (currently says "milestone:*") Ok, that was actually a no-brainer. I didn't notice the title element. But the color is wrong. It seems it always uses the first color, not the matching one.
  • As you already said, either the milestones should be r/o somehow (and not be selectable in the plan list) or the changes should be "fed back" into the milestone table. I'd currently be happy with the former.
  • It would be very useful to make the milestone events clickable so they open the corresponding milestone details page. Maybe this can be generalized to each event being able to provide a clickable URL.

I could try to hack something that suits my needs, but wonder if you might already be working on a clean solution to any of these or a general update of the plugin.

Last edited 7 years ago by pleumann (previous) (diff)

comment:5 in reply to:  4 ; Changed 7 years ago by lucid

Replying to pleumann:

  • But the color is wrong. It seems it always uses the first color, not the matching one.

Please create a new ticket with more information (e.g. your modified patch) if this is a defect in WeekPlanPlugin, thanks.

  • As you already said, either the milestones should be r/o somehow (and not be selectable in the plan list) or the changes should be "fed back" into the milestone table. I'd currently be happy with the former.

I can't check at the moment, but wasn't this (read-only events) already implemented? I think you just have to remove the add_event etc. methods, but I might remember this wrong. If it doesn't work well please open a new ticket for that as well, thanks.

  • It would be very useful to make the milestone events clickable so they open the corresponding milestone details page. Maybe this can be generalized to each event being able to provide a clickable URL.

Nice idea. But this is actually also already possible I think: The event's title supports wiki formatting, so just put a milestone:name Trac-link in there in get_events(). Actually that was already there, the milestone:* you mentioned, no? Sorry, maybe I'm misunderstanding.

I could try to hack something that suits my needs, but wonder if you might already be working on a clean solution to any of these or a general update of the plugin.

There is currently no work in-progress or planned. Please feel free to send create new tickets and attach patches. (Also note that you can put the milestone provider in a separate (single-file) plugin. You don't actually have to patch the WeekPlanPlugin itself. That was the point of this ticket. T11615-milestones-2.patch was just there as a test / demo.)

comment:6 in reply to:  5 Changed 7 years ago by pleumann

Replying to lucid:

Replying to pleumann:

  • But the color is wrong. It seems it always uses the first color, not the matching one.

Please create a new ticket with more information (e.g. your modified patch) if this is a defect in WeekPlanPlugin, thanks.

It's possible that the color doesn't match because in my case the actual name of the milestone differs from "plan" specification (where it's a regex). I'll have another look on Monday. If I cannot solved it I will upload my stuff and create a ticket.

  • As you already said, either the milestones should be r/o somehow (and not be selectable in the plan list) or the changes should be "fed back" into the milestone table. I'd currently be happy with the former.

I can't check at the moment, but wasn't this (read-only events) already implemented? I think you just have to remove the add_event etc. methods, but I might remember this wrong. If it doesn't work well please open a new ticket for that as well, thanks.

Yes, that what I found out, too, by reading the source. Removing the methods did the trick.

  • It would be very useful to make the milestone events clickable so they open the corresponding milestone details page. Maybe this can be generalized to each event being able to provide a clickable URL.

Nice idea. But this is actually also already possible I think: The event's title supports wiki formatting, so just put a milestone:name Trac-link in there in get_events(). Actually that was already there, the milestone:* you mentioned, no? Sorry, maybe I'm misunderstanding.

Yup, works! Very cool. :)

I could try to hack something that suits my needs, but wonder if you might already be working on a clean solution to any of these or a general update of the plugin.

There is currently no work in-progress or planned. Please feel free to send create new tickets and attach patches. (Also note that you can put the milestone provider in a separate (single-file) plugin. You don't actually have to patch the WeekPlanPlugin itself. That was the point of this ticket. T11615-milestones-2.patch was just there as a test / demo.)

Will do. The single-file solution is actually what I did. I started with the .py file from the patch and modified it as needed.

Thanks!

comment:7 Changed 7 years ago by pleumann

I was able to solve the final bit, too. Had to return the "original" plan name in a place where my code used the "actual" milestone name. Now the colors are right, and I am quite happy with the result. Thanks again & a good weekend!

comment:8 Changed 7 years ago by lucid

Glad it worked for you. Could you attach your version of the file also to this ticket? Maybe it helps anyone else. Have a nice weekend.

comment:9 Changed 7 years ago by pleumann

Sure. Let me do a bit of cleanup next week, then I will attach it to the ticket.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain lucid.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.