From 8286c4263ebaed641316a76e72341428a94bb29e Mon Sep 17 00:00:00 2001 From: kelvingoodson Date: Wed, 27 Jan 2010 14:42:03 +0000 Subject: basic working application for contributors to organise work around jiras -- not yet retrieving jira info into work items -- thats coming git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@903661 13f79535-47bb-0310-9956-ffa450edef68 --- .../kgoodson/jagg/src/main/java/services/Item.java | 54 ----------- .../jagg/src/main/java/services/JiraQuery.java | 8 -- .../jagg/src/main/java/services/JiraQueryImpl.java | 74 --------------- .../jagg/src/main/java/services/PlanView.java | 13 +-- .../jagg/src/main/java/services/PlanViewImpl.java | 104 ++------------------- .../jagg/src/main/resources/JiraSideband.xml | 30 +++--- .../jagg/src/main/resources/JiraSideband.xsd | 73 ++++++++------- .../jagg/src/main/resources/plan.composite | 42 +++++++++ .../jagg/src/main/resources/uiservices/plan.html | 91 ++++++++++++++++++ 9 files changed, 201 insertions(+), 288 deletions(-) delete mode 100644 sandbox/kgoodson/jagg/src/main/java/services/Item.java delete mode 100644 sandbox/kgoodson/jagg/src/main/java/services/JiraQuery.java delete mode 100644 sandbox/kgoodson/jagg/src/main/java/services/JiraQueryImpl.java create mode 100644 sandbox/kgoodson/jagg/src/main/resources/plan.composite create mode 100644 sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html (limited to 'sandbox/kgoodson') diff --git a/sandbox/kgoodson/jagg/src/main/java/services/Item.java b/sandbox/kgoodson/jagg/src/main/java/services/Item.java deleted file mode 100644 index d89712a791..0000000000 --- a/sandbox/kgoodson/jagg/src/main/java/services/Item.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public Item(String name) { - this(name,"0.00"); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/sandbox/kgoodson/jagg/src/main/java/services/JiraQuery.java b/sandbox/kgoodson/jagg/src/main/java/services/JiraQuery.java deleted file mode 100644 index 1b3d79f119..0000000000 --- a/sandbox/kgoodson/jagg/src/main/java/services/JiraQuery.java +++ /dev/null @@ -1,8 +0,0 @@ -package services; - -import java.util.Collection; - -public interface JiraQuery { - public Collection getJiraIDs(); - public String getTitle(String ID); -} diff --git a/sandbox/kgoodson/jagg/src/main/java/services/JiraQueryImpl.java b/sandbox/kgoodson/jagg/src/main/java/services/JiraQueryImpl.java deleted file mode 100644 index 14931a1989..0000000000 --- a/sandbox/kgoodson/jagg/src/main/java/services/JiraQueryImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -package services; -import java.io.IOException; -import java.lang.String; -import java.lang.reflect.Array; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; - -import com.sun.syndication.feed.synd.SyndEntry; -import com.sun.syndication.feed.synd.SyndFeed; -import com.sun.syndication.io.FeedException; -import com.sun.syndication.io.SyndFeedInput; -import com.sun.syndication.io.XmlReader; - - -public class JiraQueryImpl implements JiraQuery { - - private String rssfeed = null; - private HashMap entries = null; - - public JiraQueryImpl() { - - } - - public JiraQueryImpl(String rssfeed) throws Exception { - this.rssfeed = rssfeed; - - } - public Collection getJiraIDs() { - try { - refreshFeedData(); - } 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(); - } - return entries.keySet(); - } - public String getTitle(String ID) { - return ((SyndEntry)entries.get(ID)).getTitle(); - } - private void refreshFeedData() throws IllegalArgumentException, MalformedURLException, FeedException, IOException { - - - SyndFeedInput input = new SyndFeedInput(); - SyndFeed feed = input.build(new XmlReader(new URL(rssfeed))); - - entries = new HashMap(); - - for(Object entry: feed.getEntries()){ - SyndEntry syndEntry = (SyndEntry)entry; - String id = jiraNumber(syndEntry.getTitle()); - entries.put(id, syndEntry); - } - - } - - private String jiraNumber(String title) { - String[] id = title.split("[\\[\\]]"); - return id[1]; - } - -} diff --git a/sandbox/kgoodson/jagg/src/main/java/services/PlanView.java b/sandbox/kgoodson/jagg/src/main/java/services/PlanView.java index 2387da0519..e3d9080246 100644 --- a/sandbox/kgoodson/jagg/src/main/java/services/PlanView.java +++ b/sandbox/kgoodson/jagg/src/main/java/services/PlanView.java @@ -21,14 +21,15 @@ package services; import org.oasisopen.sca.annotation.Remotable; -import com.example.ipo.jaxb.MileStone; -import com.example.ipo.jaxb.PlanDTO; -import com.example.ipo.jaxb.WorkItem; +import com.example.ipo.jaxb.Plan; + + + + @Remotable public interface PlanView { - MileStone[] get(); - MileStone[] getMilestones(); - WorkItem[] getMilestoneWorkitems(String msid); + Plan get(); + } \ No newline at end of file diff --git a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java index 478b72dc07..c8ebf5afdd 100644 --- a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java +++ b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java @@ -20,10 +20,6 @@ package services; import java.io.File; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; @@ -31,18 +27,12 @@ import javax.xml.bind.Unmarshaller; import org.oasisopen.sca.annotation.Init; -import com.example.ipo.jaxb.MileStone; -import com.example.ipo.jaxb.Milestones; import com.example.ipo.jaxb.Plan; -import com.example.ipo.jaxb.PlanDTO; -import com.example.ipo.jaxb.WorkItem; -import com.example.ipo.jaxb.WorkItems; public class PlanViewImpl implements PlanView { - private Plan _p = null; - private Map _milestoneMap = null; - private Map _workItemMap = null; + private com.example.ipo.jaxb.Plan _p = null; + @Init public void init() { @@ -63,97 +53,21 @@ public class PlanViewImpl implements PlanView { } catch (Exception e) { e.printStackTrace(); } finally { - } - } - return _p; - } - - private Map getMileStoneMap() - { - if(_milestoneMap == null) { - _milestoneMap = new HashMap(); - - Plan p = getPlan(); - List ms = p.getMilestones().getMilestone(); - for (Iterator iterator = ms.iterator(); iterator.hasNext();) { - MileStone mileStone = iterator.next(); - _milestoneMap.put(mileStone.getID(), mileStone); } - } - return _milestoneMap; - } - private Map getWorkItemMap() - { - if(_workItemMap == null) { - _workItemMap = new HashMap(); - - Plan p = getPlan(); - List ms = p.getWorkitems().getWorkitem(); - for (Iterator iterator = ms.iterator(); iterator.hasNext();) { - WorkItem workItem = iterator.next(); - _workItemMap.put(workItem.getID(), workItem); - } } - return _workItemMap; - } - - - - public MileStone[] getMilestones() { - - List ms = null; - Plan p = getPlan(); - ms = p.getMilestones().getMilestone(); - MileStone[] ma = new MileStone[(ms.size())]; - ms.toArray(ma); + return _p; - return ma; } + - public WorkItem[] getMilestoneWorkitems(String msid) { - Map msmap = getMileStoneMap(); - Map wimap = getWorkItemMap(); - MileStone ms = msmap.get(msid); - List wirefs = ms.getWorkItem(); - - WorkItem[] retval = new WorkItem[wirefs.size()]; - int i=0; - for (Iterator iterator = wirefs.iterator(); iterator.hasNext();) { - String wiref = iterator.next(); - retval[i] = wimap.get(wiref); - i++; - } - - return retval; - } - public MileStone[] get() { - Plan p = getPlan(); - - - Milestones ms = p.getMilestones(); - WorkItems ws = p.getWorkitems(); - - MileStone[] plan = new MileStone[ms.getMilestone().size()]; - - - int i=0; - List lm = ms.getMilestone(); - - for (MileStone mileStone : lm) { - plan[i++] = mileStone; - } - -// List lw = ws.getWorkitem(); -// -// for (WorkItem workItem : lw) { -// plan[i++] = workItem; -// } - - - return plan; + public Plan get() { + com.example.ipo.jaxb.Plan modelplan = getPlan(); + + // dto.Plan dtoplan = new dto.Plan(modelplan); + return modelplan; } } \ No newline at end of file diff --git a/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml b/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml index 0d534adce6..2ebfecb232 100644 --- a/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml +++ b/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml @@ -1,42 +1,38 @@ - + 2001-01-01 deliveredby note - ENHANCE_ART_PROC_PERF - CONTRIBS_IDENT_SPEC_VERS - SUPPORT_REFS_ON_OTHERS - + - - ENHANCE_ART_PROC_PERF + LR 2001-01-01 - TUSCANY-3395 - status + TUSCANY-2850 + in progress repository_vid note - - CONTRIBS_IDENT_SPEC_VERS + LR 2001-01-01 - TUSCANY-3397 - status + TUSCANY-3395 + in progress repository_vid note - - SUPPORT_REFS_ON_OTHERS + LR 2001-01-01 - TUSCANY-2850 - status + TUSCANY-3397 + in progress repository_vid note + diff --git a/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd b/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd index 06bab086d3..b00bbae874 100644 --- a/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd +++ b/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd @@ -32,30 +32,42 @@ - - The milestone or deliverable name that we require this function for - - - - - - - - + + + The milestone or deliverable name that we require this + function for + + + + + + + + + + - - - - + + + + + + + - - - - - + + + + + @@ -67,15 +79,16 @@ - - + - + + + - + - + @@ -85,18 +98,10 @@ - - - - - - - - - + diff --git a/sandbox/kgoodson/jagg/src/main/resources/plan.composite b/sandbox/kgoodson/jagg/src/main/resources/plan.composite new file mode 100644 index 0000000000..dfc71c6e33 --- /dev/null +++ b/sandbox/kgoodson/jagg/src/main/resources/plan.composite @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html b/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html new file mode 100644 index 0000000000..48b4f49d53 --- /dev/null +++ b/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html @@ -0,0 +1,91 @@ + + + +Plan + + + + + + + + + +

Plan

+
+ + \ No newline at end of file -- cgit v1.2.3