diff --git a/build.xml b/build.xml index 6496f52..47c2c25 100644 --- a/build.xml +++ b/build.xml @@ -1,5 +1,6 @@ + diff --git a/lib/runtime/servlet.jar b/lib/runtime/servlet.jar deleted file mode 100644 index d368d0f..0000000 Binary files a/lib/runtime/servlet.jar and /dev/null differ diff --git a/project.properties b/project.properties index 7d2cd2f..a8da4ee 100644 --- a/project.properties +++ b/project.properties @@ -1,3 +1,4 @@ -#Fri, 14 Jan 2011 22:05:22 -0600 - -build.number=1 +#Sat, 22 Jan 2011 19:30:42 -0600 +name=time-analyzer +version=0.1 +build.number=4 diff --git a/src/main/com/jdbernard/timeanalyzer/DescriptionBasedCategorizationPlan.groovy b/src/main/com/jdbernard/timeanalyzer/DescriptionBasedCategorizationPlan.groovy index d1e35ad..e43fa32 100644 --- a/src/main/com/jdbernard/timeanalyzer/DescriptionBasedCategorizationPlan.groovy +++ b/src/main/com/jdbernard/timeanalyzer/DescriptionBasedCategorizationPlan.groovy @@ -3,7 +3,9 @@ package com.jdbernard.timeanalyzer public class DescriptionBasedCategorizationPlan implements CategorizationPlan { public boolean deservesNewCategory(Event event, List existingEvents) { - return existingEvents.any { it.description == event.description } + def desc = event.description.replaceAll(/\p{Punct}/, '').toLowerCase() + return existingEvents.any { + it.description.replaceAll(/\p{Punct}/, '').toLowerCase() == desc } } public Category newCategory(Event event, @@ -13,7 +15,9 @@ public class DescriptionBasedCategorizationPlan implements CategorizationPlan { public List findEventsToRecategorize(Event event, List existingEvents) { - return existingEvents.findAll { it.description == event.description } + def desc = event.description.replaceAll(/\p{Punct}/, '').toLowerCase() + return existingEvents.findAll { + it.description.replaceAll(/\p{Punct}/, '').toLowerCase() == desc } } } diff --git a/src/main/com/jdbernard/timeanalyzer/DescriptionBasedCategory.groovy b/src/main/com/jdbernard/timeanalyzer/DescriptionBasedCategory.groovy index 8512909..d161ee9 100644 --- a/src/main/com/jdbernard/timeanalyzer/DescriptionBasedCategory.groovy +++ b/src/main/com/jdbernard/timeanalyzer/DescriptionBasedCategory.groovy @@ -10,7 +10,8 @@ public class DescriptionBasedCategory extends Category { } public boolean matchesEvent(Event e) { - return e.description.replaceAll(/\p{Punct}/, '') == description + return e.description.replaceAll(/\p{Punct}/, '').toLowerCase() == + description.toLowerCase() } } diff --git a/src/main/com/quantumdigital/ithelp/timeanalyzer/TicketCategory.groovy b/src/main/com/quantumdigital/ithelp/timeanalyzer/TicketCategory.groovy index 6d75a40..8f464d6 100644 --- a/src/main/com/quantumdigital/ithelp/timeanalyzer/TicketCategory.groovy +++ b/src/main/com/quantumdigital/ithelp/timeanalyzer/TicketCategory.groovy @@ -20,5 +20,6 @@ public class TicketCategory extends Category { public Event addEvent(Event e) { TicketEvent te = new TicketEvent(e) events << te + return te } } diff --git a/startscript.groovy b/startscript.groovy index 6fe73cd..7b758bb 100644 --- a/startscript.groovy +++ b/startscript.groovy @@ -33,24 +33,24 @@ ithelpcat.categorizationPlans << descriptionBasedCatPlan topcat.categories << ithelpcat -//events.each { if (topcat.matchesEvent(it)) topcat.addEvent(it) } +events.each { if (topcat.matchesEvent(it)) topcat.addEvent(it) } makePieDataset = { category -> DefaultPieDataset dpds = new DefaultPieDataset() category.categories.each { cat -> dpds.setValue(cat.description, cat.duration.standardSeconds) } - category.entries.each { entry -> + category.events.each { entry -> dpds.setValue(entry.description, entry.duration.standardSeconds) } dpds.sortByValues(SortOrder.DESCENDING) return dpds } -//topcatDataset = makePieDataset(topcat) -//ithelpDataset = makePieDataset(ithelpcat) +topcatDataset = makePieDataset(topcat) +ithelpDataset = makePieDataset(ithelpcat) -//topcatFrame = new ChartFrame("Top Category", - //ChartFactory.createPieChart("Time Spent", topcatDataset, true, true, false)) -//ithelpFrame = new ChartFrame("ITHelp", - //ChartFactory.createPieChart("Time Spent", ithelpDataset, true, true, false)) +topcatFrame = new ChartFrame("Top Category", + ChartFactory.createPieChart("Time Spent", topcatDataset, true, true, false)) +ithelpFrame = new ChartFrame("ITHelp", + ChartFactory.createPieChart("Time Spent", ithelpDataset, true, true, false))