summaryrefslogtreecommitdiffstats
path: root/sandbox/kgoodson/jagg/src
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/kgoodson/jagg/src')
-rw-r--r--sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java83
-rw-r--r--sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html28
2 files changed, 64 insertions, 47 deletions
diff --git a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
index 4bef994b3f..5c4f115a6c 100644
--- a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
+++ b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
@@ -89,53 +89,54 @@ public class PlanViewImpl implements PlanView {
for(Milestone m : plan.getMilestone()) {
for (WorkItem wi: m.getWorkItem()) {
String jira = wi.getJira();
- String feed = rssPrefix += jira + "/" + jira + ".xml";
- JiraData jd = new JiraData();
- wi.setJiraData(jd);
- jd.setID(jira);
-
- try {
- JAXBContext jaxbContext = JAXBContext
- .newInstance("com.example.ipo.jaxb");
- Unmarshaller m2 = jaxbContext.createUnmarshaller();
-
-// File inputFile = new File("src/main/resources/exampleJira.xml")
-// .getAbsoluteFile();
-//
-// RSS j = ((JAXBElement<RSS>) m2.unmarshal(inputFile)).getValue();
- InputStream is = null;
- RSS j;
- try{
- URL url = new URL("http://issues.apache.org/jira/si/jira.issueviews:issue-xml/"+jira+"/"+jira+".xml");
- is = url.openStream();
- j = ((JAXBElement<RSS>) m2.unmarshal(is)).getValue();
- }
- finally {
- if(is != null) is.close();
- }
+ if(jira != null) {
+ String feed = rssPrefix += jira + "/" + jira + ".xml";
+ JiraData jd = new JiraData();
+ wi.setJiraData(jd);
+ jd.setID(jira);
- Item i = j.getChannel().getItem();
- System.out.println(i.toString());
- List<JAXBElement<?>> c = i.getContent();
- for (JAXBElement<?> element : c) {
- if("title".equals(element.getName().getLocalPart())) {
- String jtitle = (String)element.getValue();
- jd.setTitle(jtitle.substring(jtitle.indexOf(']')+1, jtitle.length()));
+ try {
+ JAXBContext jaxbContext = JAXBContext
+ .newInstance("com.example.ipo.jaxb");
+ Unmarshaller m2 = jaxbContext.createUnmarshaller();
+
+ // File inputFile = new File("src/main/resources/exampleJira.xml")
+ // .getAbsoluteFile();
+ //
+ // RSS j = ((JAXBElement<RSS>) m2.unmarshal(inputFile)).getValue();
+ InputStream is = null;
+ RSS j;
+ try{
+ URL url = new URL("http://issues.apache.org/jira/si/jira.issueviews:issue-xml/"+jira+"/"+jira+".xml");
+ is = url.openStream();
+ j = ((JAXBElement<RSS>) m2.unmarshal(is)).getValue();
}
- else if("status".equals(element.getName().getLocalPart())){
- jd.setStatus((String)element.getValue());
+ finally {
+ if(is != null) is.close();
}
- else if("assignee".equals(element.getName().getLocalPart())) {
- jd.setAssignedTo((String)element.getValue());
- }
+
+ Item i = j.getChannel().getItem();
+ System.out.println(i.toString());
+ List<JAXBElement<?>> c = i.getContent();
+ for (JAXBElement<?> element : c) {
+ if("title".equals(element.getName().getLocalPart())) {
+ String jtitle = (String)element.getValue();
+ jd.setTitle(jtitle.substring(jtitle.indexOf(']')+1, jtitle.length()));
+ }
+ else if("status".equals(element.getName().getLocalPart())){
+ jd.setStatus((String)element.getValue());
+ }
+ else if("assignee".equals(element.getName().getLocalPart())) {
+ jd.setAssignedTo((String)element.getValue());
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+
}
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
-
}
-
}
}
}
diff --git a/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html b/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html
index 90e34be917..ddb018ed74 100644
--- a/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html
+++ b/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html
@@ -26,7 +26,7 @@
<script language="JavaScript">
//@Reference
- var plan = new tuscany.sca.Reference("plan");
+ var planView = new tuscany.sca.Reference("plan");
var ms;
function plan_getResponse(plan,exception) {
@@ -36,8 +36,10 @@
}
ms = plan.milestone.list;
var mscontent = "<table border=\"1\" align=\"left\">";
+ var mschoice = '<select name="mschoice">';
for(var i=0; i<ms.length; i++) {
mscontent += "<tr><th colspan=\"6\" align=\"left\">Milestone " + ms[i].ID + "</th></tr>";
+ mschoice+='<option>'+ms[i].ID+'</option>';
var mswi = ms[i].workItem.list;
mscontent +="<tr>"+
@@ -67,9 +69,18 @@
}
}
+ mschoice += '<option>New Milestone..</option></select>';
+ mscontent += "</table>";
- mscontent += "</table>";
+ mscontent += '<form name="newWorkItemForm">'+
+ '<div id="addWorkItem">'+
+ '<h4>New Work Item</h4>'+
+ 'JIRA: <input type="text" name="JIRA" value="TUSCANY-"><br/>'+
+ 'MileStone: '+mschoice+
+ '<input type="button" onClick="addWorkItem()" value="Add Work Item">'+
+ '</div>'+
+ '</form>';
document.getElementById('milestones').innerHTML='<h2>' + mscontent;
return;
@@ -77,10 +88,13 @@
}
-function init()
-{
- plan.get().addCallback(plan_getResponse);
-}
+ function init()
+ {
+ planView.get().addCallback(plan_getResponse);
+ }
+
+ function addWorkItem() {
+ }
</script>
@@ -89,6 +103,8 @@ function init()
<body onload="init()">
<h1>Plan</h1>
+
+
<div id="milestones"></div>
</body>
</html> \ No newline at end of file