From f975c1096be5e21538ed0db775ac76e176fc48e5 Mon Sep 17 00:00:00 2001 From: kelvingoodson Date: Fri, 29 Jan 2010 16:43:11 +0000 Subject: 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 --- .../jagg/src/main/java/services/PlanViewImpl.java | 24 ++++++++++++++++++---- 1 file 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) 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) m2.unmarshal(inputFile)).getValue(); - System.out.println(j.toString()); +// File inputFile = new File("src/main/resources/exampleJira.xml") +// .getAbsoluteFile(); +// +// RSS j = ((JAXBElement) 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) m2.unmarshal(is)).getValue(); + } + finally { + if(is != null) is.close(); + } + Item i = j.getChannel().getItem(); System.out.println(i.toString()); List> c = i.getContent(); -- cgit v1.2.3