You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ke...@apache.org on 2010/01/29 17:43:12 UTC

svn commit: r904553 - /tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java

Author: kelvingoodson
Date: Fri Jan 29 16:43:11 2010
New Revision: 904553

URL: http://svn.apache.org/viewvc?rev=904553&view=rev
Log:
real jira data mashed in from apache site appears in dom in browser

Modified:
    tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java

Modified: tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java?rev=904553&r1=904552&r2=904553&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java (original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java Fri Jan 29 16:43:11 2010
@@ -21,6 +21,7 @@
 
 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.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 @@
 				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 @@
 					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();