summaryrefslogtreecommitdiffstats
path: root/sandbox/kgoodson/jagg
diff options
context:
space:
mode:
authorkelvingoodson <kelvingoodson@13f79535-47bb-0310-9956-ffa450edef68>2010-01-29 16:43:11 +0000
committerkelvingoodson <kelvingoodson@13f79535-47bb-0310-9956-ffa450edef68>2010-01-29 16:43:11 +0000
commitf975c1096be5e21538ed0db775ac76e176fc48e5 (patch)
tree92543f870b4a96021e3526a9127ef569c8f2fef9 /sandbox/kgoodson/jagg
parente95b8dab55698aa2b43b8b525c9922f0ca0be121 (diff)
real jira data mashed in from apache site appears in dom in browser
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@904553 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/kgoodson/jagg')
-rw-r--r--sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java24
1 files changed, 20 insertions, 4 deletions
diff --git a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
index b4c5840154..cca29fe7ae 100644
--- a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
+++ b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
@@ -21,6 +21,7 @@ package services;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
@@ -30,6 +31,8 @@ import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
import org.oasisopen.sca.annotation.Init;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
import com.example.ipo.jaxb.Item;
import com.example.ipo.jaxb.JiraData;
@@ -65,6 +68,8 @@ public class PlanViewImpl implements PlanView {
File inputFile = new File("src/main/resources/jiraSideBand.xml")
.getAbsoluteFile();
+// Reader r = new XMLReader()
+// InputSource s = new InputSource(r);
_p = ((JAXBElement<Plan>) m.unmarshal(inputFile)).getValue();
augment_plan(_p);
} catch (Exception e) {
@@ -93,11 +98,22 @@ public class PlanViewImpl implements PlanView {
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();
- System.out.println(j.toString());
+// 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();
+ }
+
Item i = j.getChannel().getItem();
System.out.println(i.toString());
List<JAXBElement<?>> c = i.getContent();