From fde2aad35a35ef39a37514614a7b7154bcc79690 Mon Sep 17 00:00:00 2001 From: kelvingoodson Date: Tue, 2 Feb 2010 17:48:53 +0000 Subject: [PATCH] write plan after jira data refresh git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@905731 13f79535-47bb-0310-9956-ffa450edef68 --- .../jagg/src/main/java/services/PlanViewImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java index 9be9d967ef..fad6f68b63 100644 --- a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java +++ b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java @@ -50,7 +50,7 @@ public class PlanViewImpl implements PlanView { static String rssPrefix = "http://issues.apache.org/jira/si/jira.issueviews:issue-xml/"; @Property public String planFile = "src/main/resources/jiraSideBand.xml"; - + @Init public void init() { } @@ -60,6 +60,7 @@ public class PlanViewImpl implements PlanView { try { p = readPlan(); augmentPlan(p); + writePlan(p); } catch (Exception e) { e.printStackTrace(); } @@ -236,10 +237,15 @@ public class PlanViewImpl implements PlanView { Unmarshaller m = jaxbContext.createUnmarshaller(); File inputFile = new File(planFile).getAbsoluteFile(); + if(!inputFile.exists()){ // start afresh + Plan newPlan = new Plan(); + writePlan(newPlan); + inputFile = new File(planFile).getAbsoluteFile(); + } p = (Plan)m.unmarshal(inputFile); } catch(Exception e) { - // FIXME + throw new IllegalStateException("Failed to read plan file",e); } return p; }