checkpoint - almost got example RSS feed of JIRA being consumed - some issues over Item
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@904500 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b8e7a0344f
commit
34ca7df798
6 changed files with 181 additions and 24 deletions
|
|
@ -1,5 +0,0 @@
|
|||
#Thu Jan 21 10:52:25 GMT 2010
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
|
|
@ -122,6 +122,7 @@
|
|||
<schemaIncludes>
|
||||
<!-- <include>ipo.xsd</include>-->
|
||||
<include>JiraSideband.xsd</include>
|
||||
<include>JiraRSS.xsd</include>
|
||||
</schemaIncludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ import org.oasisopen.sca.annotation.Init;
|
|||
|
||||
import com.example.ipo.jaxb.Milestone;
|
||||
import com.example.ipo.jaxb.Plan;
|
||||
import com.example.ipo.jaxb.RSS;
|
||||
import com.example.ipo.jaxb.WorkItem;
|
||||
import com.example.ipo.jaxb.JiraRSS;
|
||||
import com.sun.syndication.feed.synd.SyndEntry;
|
||||
import com.sun.syndication.feed.synd.SyndFeed;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
|
|
@ -82,25 +84,40 @@ public class PlanViewImpl implements PlanView {
|
|||
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
|
||||
// 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();
|
||||
// }
|
||||
|
||||
try {
|
||||
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();
|
||||
augment_plan(_p);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
92
sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd
Normal file
92
sandbox/kgoodson/jagg/src/main/resources/JiraRSS.xsd
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<xsd:include schemaLocation=""></xsd:include>
|
||||
<xsd:element name="rss" type="RSS"></xsd:element>
|
||||
|
||||
<xsd:complexType name="JiraRSS">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="channel" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="Channel">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="title" type="xsd:string"></xsd:element>
|
||||
<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="item" type="Item"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
|
||||
<xsd:complexType name="Item">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="title" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="link" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="description" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="environment" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="type" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="priority" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="status" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="resolution" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="assignee" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="reporter" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="key" type="Key"></xsd:element>
|
||||
<xsd:element name="summary" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="type" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="priority" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="status" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="resolution" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="assignee" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="reporter" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="created" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="updated" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="version" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="fixVersion" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="component" type="xsd:string"></xsd:element>
|
||||
<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>
|
||||
|
||||
|
||||
<xsd:complexType name="RSS">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="channel" type="Channel"></xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="version" type="xsd:string"></xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="Key">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:string">
|
||||
<xsd:attribute name="id" type="xsd:string"></xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="Comment">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:string">
|
||||
<xsd:attribute name="id" type="xsd:string"></xsd:attribute>
|
||||
<xsd:attribute name="author" type="xsd:string"></xsd:attribute>
|
||||
<xsd:attribute name="created" type="xsd:string"></xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="Comments">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="comment" type="Comment" maxOccurs="unbounded" minOccurs="0"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
</workItem>
|
||||
</milestone>
|
||||
<milestone ID="Dummy">
|
||||
<workItem ID='Activity 1'>
|
||||
<workItem ID='Activity1'>
|
||||
<title>Add support for ....</title>
|
||||
<responsible>FB</responsible>
|
||||
<dueDate>2001-01-01</dueDate>
|
||||
|
|
|
|||
52
sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml
Normal file
52
sandbox/kgoodson/jagg/src/main/resources/exampleJira.xml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue