write plan after jira data refresh
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@905731 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
10b54a07c2
commit
fde2aad35a
1 changed files with 8 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue