Fixed, expanded category implementations. Started chart work.

Added FilteredCategory, filters by arbitrary CategoryFilters.
Started on Util class with code to create charts based on categories.
Fixed ITHelp ticket matching to swallow optional space after "ITHelp:"
Fixed TicketCategory to use it's own addEvent logic instead of inheriting the
  default Category implementation.
Updated startscript.groovy to reflect test data for recent changes.
This commit is contained in:
Jonathan Bernard
2011-01-11 08:21:41 -06:00
parent 6de924927a
commit ba04aae34e
20 changed files with 103 additions and 8 deletions

View File

@ -6,7 +6,7 @@ import com.jdbernard.timeanalyzer.Event
public class ITHelpCategory extends Category {
private def ithelpPattern = ~/^ITHelp:(.*)$/
private def ithelpPattern = ~/^ITHelp:\s*(.*)$/
private def ticketPattern = ~/^ITHelp:.*#(\d+).*/
public boolean matchesEvent(Event e) {

View File

@ -17,4 +17,9 @@ public class TicketCategory extends Category {
return (e.description ==~ /ITHelp:.*#${ticketId}.*/)
}
public TicketEntry addEvent(Event e) {
TicketEntry te = new TicketEntry(this, e)
entries << te
return te
}
}

View File

@ -7,10 +7,10 @@ public class TicketEntry extends Entry {
public int id
public TicketEntry(ITHelpCategory category, Event e) {
public TicketEntry(TicketCategory category, Event e) {
super(category, e)
def m = e.description =~ /^ITHelp:(.*#(\d+).*)$/
def m = e.description =~ /^ITHelp:\s*(.*#(\d+).*)$/
this.description = m[0][1]
this.id = m[0][2] as int
}