From e95b8dab55698aa2b43b8b525c9922f0ca0be121 Mon Sep 17 00:00:00 2001 From: kelvingoodson Date: Fri, 29 Jan 2010 15:53:44 +0000 Subject: jaxb digestion of dummy jira xml file working, needs now to go off and download jira xml instead git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@904531 13f79535-47bb-0310-9956-ffa450edef68 --- .../jagg/src/main/java/services/PlanViewImpl.java | 39 +++---- .../kgoodson/jagg/src/main/resources/JiraRSS.xsd | 17 ++- .../jagg/src/main/resources/exampleJira.xml | 119 ++++++++++++--------- 3 files changed, 96 insertions(+), 79 deletions(-) diff --git a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java index 13edacaaea..b4c5840154 100644 --- a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java +++ b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java @@ -31,6 +31,8 @@ import javax.xml.bind.Unmarshaller; import org.oasisopen.sca.annotation.Init; +import com.example.ipo.jaxb.Item; +import com.example.ipo.jaxb.JiraData; import com.example.ipo.jaxb.Milestone; import com.example.ipo.jaxb.Plan; import com.example.ipo.jaxb.RSS; @@ -83,27 +85,9 @@ public class PlanViewImpl implements PlanView { for (WorkItem wi: m.getWorkItem()) { String jira = wi.getJira(); String feed = rssPrefix += jira + "/" + jira + ".xml"; - -// SyndFeedInput input = new SyndFeedInput(); -// try { -// SyndFeed sfeed = input.build(new XmlReader(new URL(feed))); -// List entries = sfeed.getEntries(); -// SyndEntry jiraEntry = (SyndEntry)entries.toArray()[0]; -// String title = jiraEntry.getTitle(); -// System.out.println(sfeed.toString()); -// } catch (IllegalArgumentException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } catch (MalformedURLException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } catch (FeedException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } + JiraData jd = new JiraData(); + wi.setJiraData(jd); + jd.setID(jira); try { JAXBContext jaxbContext = JAXBContext @@ -113,7 +97,18 @@ public class PlanViewImpl implements PlanView { .getAbsoluteFile(); RSS j = ((JAXBElement) m2.unmarshal(inputFile)).getValue(); - augment_plan(_p); + System.out.println(j.toString()); + Item i = j.getChannel().getItem(); + System.out.println(i.toString()); + List> c = i.getContent(); + for (JAXBElement element : c) { + if("status".equals(element.getName().getLocalPart())){ + jd.setStatus((String)element.getValue()); + } + if("responsible".equals(element.getName().getLocalPart())) { + jd.setAssignedTo((String)element.getValue()); + } + } } catch (Exception e) { e.printStackTrace(); } finally { diff --git a/sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd b/sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd index 8cd89b6c2c..4a2b066267 100644 --- a/sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd +++ b/sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd @@ -16,8 +16,7 @@ - - + @@ -52,8 +51,7 @@ - - + @@ -89,4 +87,13 @@ - \ No newline at end of file + + + + + + + + + + diff --git a/sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml b/sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml index 16b4f82451..08dae93262 100644 --- a/sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml +++ b/sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml @@ -1,52 +1,67 @@ - - - ASF JIRA - https://issues.apache.org:443/jira - This file is an XML representation of an issue - en-uk - - 3.13.5 - 360 - 07-07-2009 - Enterprise - - - [TUSCANY-3397] Add support for identifying the SCA Spec Version for contribution metadata - https://issues.apache.org:443/jira/browse/TUSCANY-3397 - Provide the same support we have for Composites, for Contribution Metadata - - TUSCANY-3397 - Add support for identifying the SCA Spec Version for contribution metadata - Bug - Major - Resolved - Fixed - Luciano Resende - Luciano Resende - Fri, 18 Dec 2009 17:31:07 +0000 (UTC) - Fri, 18 Dec 2009 17:58:58 +0000 (UTC) - Java-SCA-2.0 - Java-SCA-2.0 - Java SCA Core Runtime - - 0 - - Fixed, you can now identify the spec version of the contribution metadata based on the SCA Namespace being used, this means that, for SCA 1.1, specVersion will return http://docs.oasis-open.org/ns/opencsa/sca/200912 - - - - - - Time in Status - - - - Resolution Date - - Fri, 18 Dec 2009 17:58:58 +0000 (UTC) - - - - - - + + + ASF JIRA + https://issues.apache.org:443/jira + This file is an XML representation of an issue + en-uk + + 3.13.5 + 360 + 07-07-2009 + Enterprise + + + [TUSCANY-3397] Add support for identifying the + SCA Spec Version for contribution metadata + https://issues.apache.org:443/jira/browse/TUSCANY-3397 + Provide the same support we have for Composites, + for Contribution Metadata + + TUSCANY-3397 + Add support for identifying the SCA Spec Version for + contribution metadata + Bug + Major + Resolved + Fixed + Luciano Resende + Luciano Resende + Fri, 18 Dec 2009 17:31:07 +0000 (UTC) + Fri, 18 Dec 2009 17:58:58 +0000 (UTC) + Java-SCA-2.0 + Java-SCA-2.0 + Java SCA Core Runtime + + 0 + + + Fixed, you can now identify the spec version of the contribution + metadata based on the SCA Namespace being used, this means that, + for SCA 1.1, specVersion will return + http://docs.oasis-open.org/ns/opencsa/sca/200912 + + + + + + + Time in Status + + + + Resolution Date + + Fri, 18 Dec 2009 17:58:58 +0000 (UTC) + + + + + + -- cgit v1.2.3