Author: kelvingoodson
Date: Fri Jan 29 15:53:44 2010
New Revision: 904531

URL: http://svn.apache.org/viewvc?rev=904531&view=rev
Log:
jaxb digestion of dummy jira xml file working, needs now to go off and download 
jira xml instead

Modified:
    tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
    tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd
    tuscany/sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml

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=904531&r1=904530&r2=904531&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 15:53:44 2010
@@ -31,6 +31,8 @@
 
 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 @@
                        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<SyndEntry> 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 @@
                                                        .getAbsoluteFile();
 
                                        RSS j = ((JAXBElement<RSS>) 
m2.unmarshal(inputFile)).getValue();
-                                       augment_plan(_p);
+                                       System.out.println(j.toString());
+                                       Item i = j.getChannel().getItem();
+                                       System.out.println(i.toString());
+                                       List<JAXBElement<?>> 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 {

Modified: tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd?rev=904531&r1=904530&r2=904531&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd (original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd Fri Jan 29 
15:53:44 2010
@@ -16,8 +16,7 @@
                <xsd:element name="link" type="xsd:string"></xsd:element>
                <xsd:element name="description" type="xsd:string"></xsd:element>
                <xsd:element name="language" type="xsd:string"></xsd:element>
-
-               <xsd:any processContents="lax"></xsd:any>
+               <xsd:element name="build-info" type="BuildInfo"></xsd:element>
                <xsd:element name="item" type="Item"></xsd:element>
        </xsd:sequence>
     </xsd:complexType>
@@ -52,8 +51,7 @@
                <xsd:element name="due" type="xsd:string"></xsd:element>
                <xsd:element name="votes" type="xsd:string"></xsd:element>
                <xsd:element name="comments" type="Comments"></xsd:element>
-               <xsd:sequence maxOccurs="unbounded" 
minOccurs="0"></xsd:sequence>
-               <xsd:any></xsd:any>
+
        </xsd:sequence>
     </xsd:complexType>
 
@@ -89,4 +87,13 @@
                <xsd:element name="comment" type="Comment" 
maxOccurs="unbounded" minOccurs="0"></xsd:element>
        </xsd:sequence>
     </xsd:complexType>
-</xsd:schema>
\ No newline at end of file
+    
+    <xsd:complexType name="BuildInfo">
+       <xsd:sequence>
+               <xsd:element name="version" type="xsd:string"></xsd:element>
+               <xsd:element name="build-number" 
type="xsd:string"></xsd:element>
+               <xsd:element name="build-date" type="xsd:string"></xsd:element>
+               <xsd:element name="edition" type="xsd:string"></xsd:element>
+       </xsd:sequence>
+    </xsd:complexType>
+</xsd:schema>

Modified: tuscany/sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml?rev=904531&r1=904530&r2=904531&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml (original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml Fri Jan 29 
15:53:44 2010
@@ -1,52 +1,67 @@
-<rss version="0.92" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="JiraRSS.xsd ">
-<channel>
-  <title>ASF JIRA</title> 
-  <link>https://issues.apache.org:443/jira</link> 
-  <description>This file is an XML representation of an issue</description> 
-  <language>en-uk</language> 
- <build-info>
-  <version>3.13.5</version> 
-  <build-number>360</build-number> 
-  <build-date>07-07-2009</build-date> 
-  <edition>Enterprise</edition> 
-  </build-info>
-<item>
-  <title>[TUSCANY-3397] Add support for identifying the SCA Spec Version for 
contribution metadata</title> 
-  <link>https://issues.apache.org:443/jira/browse/TUSCANY-3397</link> 
-  <description>Provide the same support we have for Composites, for 
Contribution Metadata</description> 
-  <environment /> 
-  <key id="12443784">TUSCANY-3397</key> 
-  <summary>Add support for identifying the SCA Spec Version for contribution 
metadata</summary> 
-  <type id="1" 
iconUrl="https://issues.apache.org:443/jira/images/icons/bug.gif";>Bug</type> 
-  <priority id="3" 
iconUrl="https://issues.apache.org:443/jira/images/icons/priority_major.gif";>Major</priority>
 
-  <status id="5" 
iconUrl="https://issues.apache.org:443/jira/images/icons/status_resolved.gif";>Resolved</status>
 
-  <resolution id="1">Fixed</resolution> 
-  <assignee username="luciano resende">Luciano Resende</assignee> 
-  <reporter username="luciano resende">Luciano Resende</reporter> 
-  <created>Fri, 18 Dec 2009 17:31:07 +0000 (UTC)</created> 
-  <updated>Fri, 18 Dec 2009 17:58:58 +0000 (UTC)</updated> 
-  <version>Java-SCA-2.0</version> 
-  <fixVersion>Java-SCA-2.0</fixVersion> 
-  <component>Java SCA Core Runtime</component> 
-  <due /> 
-  <votes>0</votes> 
-<comments>
-  <comment id="12792548" author="luciano resende" created="Fri, 18 Dec 2009 
17:58:58 +0000 (UTC)">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 <a 
href="http://docs.oasis-open.org/ns/opencsa/sca/200912";>http://docs.oasis-open.org/ns/opencsa/sca/200912</a></comment>
 
-  </comments>
-  <attachments /> 
-  <subtasks /> 
-<customfields>
-<customfield id="customfield_12310222" 
key="com.atlassian.jira.ext.charting:timeinstatus">
-  <customfieldname>Time in Status</customfieldname> 
-  <customfieldvalues /> 
-  </customfield>
-<customfield id="customfield_12310221" 
key="com.atlassian.jira.ext.charting:resolutiondate">
-  <customfieldname>Resolution Date</customfieldname> 
-<customfieldvalues>
-  <customfieldvalue>Fri, 18 Dec 2009 17:58:58 +0000 (UTC)</customfieldvalue> 
-  </customfieldvalues>
-  </customfield>
-  </customfields>
-  </item>
-  </channel>
-  </rss>
+<rss version="0.92" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="JiraRSS.xsd ">
+       <channel>
+               <title>ASF JIRA</title>
+               <link>https://issues.apache.org:443/jira</link>
+               <description>This file is an XML representation of an 
issue</description>
+               <language>en-uk</language>
+               <build-info>
+                       <version>3.13.5</version>
+                       <build-number>360</build-number>
+                       <build-date>07-07-2009</build-date>
+                       <edition>Enterprise</edition>
+               </build-info>
+               <item>
+                       <title>[TUSCANY-3397] Add support for identifying the
+                               SCA Spec Version for contribution 
metadata</title>
+                       
<link>https://issues.apache.org:443/jira/browse/TUSCANY-3397</link>
+                       <description>Provide the same support we have for 
Composites,
+                               for Contribution Metadata</description>
+                       <environment />
+                       <key id="12443784">TUSCANY-3397</key>
+                       <summary>Add support for identifying the SCA Spec 
Version for
+                               contribution metadata</summary>
+                       <type id="1"
+                               
iconUrl="https://issues.apache.org:443/jira/images/icons/bug.gif";>Bug</type>
+                       <priority id="3"
+                               
iconUrl="https://issues.apache.org:443/jira/images/icons/priority_major.gif";>Major</priority>
+                       <status id="5"
+                               
iconUrl="https://issues.apache.org:443/jira/images/icons/status_resolved.gif";>Resolved</status>
+                       <resolution id="1">Fixed</resolution>
+                       <assignee username="luciano resende">Luciano 
Resende</assignee>
+                       <reporter username="luciano resende">Luciano 
Resende</reporter>
+                       <created>Fri, 18 Dec 2009 17:31:07 +0000 (UTC)</created>
+                       <updated>Fri, 18 Dec 2009 17:58:58 +0000 (UTC)</updated>
+                       <version>Java-SCA-2.0</version>
+                       <fixVersion>Java-SCA-2.0</fixVersion>
+                       <component>Java SCA Core Runtime</component>
+                       <due />
+                       <votes>0</votes>
+                       <comments>
+                               <comment id="12792548" author="luciano resende"
+                                       created="Fri, 18 Dec 2009 17:58:58 
+0000 (UTC)">
+                                       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
+                                       <a 
href="http://docs.oasis-open.org/ns/opencsa/sca/200912";>http://docs.oasis-open.org/ns/opencsa/sca/200912</a>
+                               </comment>
+                       </comments>
+                       <attachments />
+                       <subtasks />
+                       <customfields>
+                               <customfield id="customfield_12310222"
+                                       
key="com.atlassian.jira.ext.charting:timeinstatus">
+                                       <customfieldname>Time in 
Status</customfieldname>
+                                       <customfieldvalues />
+                               </customfield>
+                               <customfield id="customfield_12310221"
+                                       
key="com.atlassian.jira.ext.charting:resolutiondate">
+                                       <customfieldname>Resolution 
Date</customfieldname>
+                                       <customfieldvalues>
+                                               <customfieldvalue>Fri, 18 Dec 
2009 17:58:58 +0000 (UTC)</customfieldvalue>
+                                       </customfieldvalues>
+                               </customfield>
+                       </customfields>
+               </item>
+       </channel>
+</rss>


Reply via email to