Author: kelvingoodson
Date: Wed Jan 27 14:42:03 2010
New Revision: 903661

URL: http://svn.apache.org/viewvc?rev=903661&view=rev
Log:
basic working application for contributors to organise work around jiras -- not 
yet retrieving jira info into work items -- thats coming

Added:
    tuscany/sandbox/kgoodson/jagg/src/main/resources/plan.composite
    tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/
    tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html   
(with props)
Removed:
    tuscany/sandbox/kgoodson/jagg/src/main/java/services/Item.java
    tuscany/sandbox/kgoodson/jagg/src/main/java/services/JiraQuery.java
    tuscany/sandbox/kgoodson/jagg/src/main/java/services/JiraQueryImpl.java
Modified:
    tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanView.java
    tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
    tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml
    tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd

Modified: tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanView.java
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanView.java?rev=903661&r1=903660&r2=903661&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanView.java 
(original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanView.java Wed Jan 
27 14:42:03 2010
@@ -21,14 +21,15 @@
 
 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

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=903661&r1=903660&r2=903661&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java 
(original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java Wed 
Jan 27 14:42:03 2010
@@ -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 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<String, MileStone> _milestoneMap = null;
-       private Map<String, WorkItem> _workItemMap = null;
+       private com.example.ipo.jaxb.Plan _p = null;
+
 
        @Init
        public void init() {
@@ -63,97 +53,21 @@
                        } catch (Exception e) {
                                e.printStackTrace();
                        } finally {
-                       }
 
-               }
-               return _p;
-       }
-       
-       private Map<String , MileStone> getMileStoneMap()
-       {
-               if(_milestoneMap == null) {
-                       _milestoneMap = new HashMap<String, MileStone>();
-                       
-                       Plan p = getPlan();
-                       List<MileStone> ms = p.getMilestones().getMilestone();
-                       for (Iterator<MileStone> iterator = ms.iterator(); 
iterator.hasNext();) {
-                               MileStone mileStone = iterator.next();
-                               _milestoneMap.put(mileStone.getID(), mileStone);
                        }
-               }
-               return _milestoneMap;
-       }
 
-       private Map<String, WorkItem> getWorkItemMap()
-       { 
-               if(_workItemMap == null) {
-                       _workItemMap = new HashMap<String, WorkItem>();
-                       
-                       Plan p = getPlan();
-                       List<WorkItem> ms = p.getWorkitems().getWorkitem();
-                       for (Iterator<WorkItem> iterator = ms.iterator(); 
iterator.hasNext();) {
-                               WorkItem workItem = iterator.next();
-                               _workItemMap.put(workItem.getID(), workItem);
-                       }
                }
-               return _workItemMap;
-       }
-
-
-
-       public MileStone[] getMilestones() {
-
-               List<MileStone> ms = null;
-               Plan p = getPlan();
-               ms = p.getMilestones().getMilestone();
-               MileStone[] ma = new MileStone[(ms.size())];
-               ms.toArray(ma);
-
-               return ma;
-       }
+               return _p;
 
-       public WorkItem[] getMilestoneWorkitems(String msid) {
-               Map<String,MileStone> msmap = getMileStoneMap();
-               Map<String,WorkItem> wimap = getWorkItemMap();
-               MileStone ms = msmap.get(msid);
-               List<String> wirefs = ms.getWorkItem();
-
-               WorkItem[] retval = new WorkItem[wirefs.size()];
-               int i=0;
-               for (Iterator<String> 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<MileStone> lm = ms.getMilestone();
 
-               for (MileStone mileStone : lm) {
-                       plan[i++] = mileStone;
-               }
-               
-//             List<WorkItem> 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

Modified: tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml?rev=903661&r1=903660&r2=903661&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml (original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml Wed Jan 
27 14:42:03 2010
@@ -1,42 +1,38 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <jagg:plan xmlns:jagg="http://www.example.com/tracking"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://www.example.com/tracking JiraSideband.xsd ">
   <milestones>
-       <milestone ID="V8_M5I14a">
+       <milestone ID="V8_M5I14a" workItems=
+       'SUPPORT_REFS_ON_OTHERS  ENHANCE_ART_PROC_PERF'>
                <dueDate>2001-01-01</dueDate>
                <deliveredby>deliveredby</deliveredby>
                <note>note</note>
-               <workItem>ENHANCE_ART_PROC_PERF</workItem>
-               <workItem>CONTRIBS_IDENT_SPEC_VERS</workItem>
-               <workItem>SUPPORT_REFS_ON_OTHERS</workItem>
        </milestone>
-   </milestones>
+  </milestones>
   <workitems>
-       <workitem>
-               <ID>ENHANCE_ART_PROC_PERF</ID>
+       <workitem ID='SUPPORT_REFS_ON_OTHERS'>
                <responsible>LR</responsible>
                <dueDate>2001-01-01</dueDate>
-               <jira>TUSCANY-3395</jira>
-               <status>status</status>
+               <jira>TUSCANY-2850</jira>
+               <status>in progress</status>
                <repository_vid>repository_vid</repository_vid>
                <note>note</note>
        </workitem>
-       <workitem>
-               <ID>CONTRIBS_IDENT_SPEC_VERS</ID>
+       <workitem ID='ENHANCE_ART_PROC_PERF'>
                <responsible>LR</responsible>
                <dueDate>2001-01-01</dueDate>
-               <jira>TUSCANY-3397</jira>
-               <status>status</status>
+               <jira>TUSCANY-3395</jira>
+               <status>in progress</status>
                <repository_vid>repository_vid</repository_vid>
                <note>note</note>
        </workitem>
-       <workitem>
-               <ID>SUPPORT_REFS_ON_OTHERS</ID>
+       <workitem ID='CONTRIBS_IDENT_SPEC_VERS'>
                <responsible>LR</responsible>
                <dueDate>2001-01-01</dueDate>
-               <jira>TUSCANY-2850</jira>
-               <status>status</status>
+               <jira>TUSCANY-3397</jira>
+               <status>in progress</status>
                <repository_vid>repository_vid</repository_vid>
                <note>note</note>
        </workitem>
+
   </workitems>
 </jagg:plan>

Modified: tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd?rev=903661&r1=903660&r2=903661&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd (original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd Wed Jan 
27 14:42:03 2010
@@ -32,30 +32,42 @@
 
 
     <xsd:complexType name="WorkItem">
-        <xsd:annotation>
-               <xsd:documentation>The milestone or deliverable name that we 
require this function for</xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence>
-               <xsd:element name="ID" type="xsd:ID"></xsd:element>
-               <xsd:element name="responsible" type="xsd:string" maxOccurs="1" 
minOccurs="0"></xsd:element>
-               <xsd:element name="dueDate" type="xsd:date"
-                       nillable="true" maxOccurs="1" minOccurs="0">
-               </xsd:element>
-               <xsd:element name="jira" type="xsd:string" maxOccurs="1" 
minOccurs="0"></xsd:element>
-               <xsd:element name="status" type="xsd:string" maxOccurs="1" 
minOccurs="0"></xsd:element>

-
-               <xsd:element name="repository_vid" type="xsd:string" 
maxOccurs="1" minOccurs="0"></xsd:element>
-            <xsd:element name="note" type="xsd:string" maxOccurs="1" 
minOccurs="0">
-               </xsd:element>
-        </xsd:sequence>
+       <xsd:annotation>
+               <xsd:documentation>
+                       The milestone or deliverable name that we require this
+                       function for
+               </xsd:documentation>
+       </xsd:annotation>
+       <xsd:sequence>

+               <xsd:element name="responsible" type="xsd:string"
+                       maxOccurs="1" minOccurs="0">
+               </xsd:element>
+               <xsd:element name="dueDate" type="xsd:string" maxOccurs="1"
+                       minOccurs="0" />
+               <xsd:element name="jira" type="xsd:string" maxOccurs="1"
+                       minOccurs="0">
+               </xsd:element>
+               <xsd:element name="status" type="xsd:string" maxOccurs="1"
+                       minOccurs="0">
+               </xsd:element>
+
+
+               <xsd:element name="repository_vid" type="xsd:string"
+                       maxOccurs="1" minOccurs="0">
+               </xsd:element>
+               <xsd:element name="note" type="xsd:string" maxOccurs="1"
+                       minOccurs="0">
+               </xsd:element>
+       </xsd:sequence>
+       <xsd:attribute name="ID" type="xsd:ID"></xsd:attribute>
     </xsd:complexType>
-    
-
-    <xsd:complexType name="MileStone">
 
-       <xsd:sequence>
-               <xsd:element name="dueDate" type="xsd:date"></xsd:element>
 
+    <xsd:complexType name="Milestone">
+
+       <xsd:sequence>
+               <xsd:element name="dueDate" type="xsd:string"></xsd:element>
+
                <xsd:element name="deliveredby" type="xsd:string"
                        maxOccurs="1" minOccurs="0">
                        <xsd:annotation>
@@ -67,15 +79,16 @@
                </xsd:element>
                <xsd:element name="note" type="xsd:string" maxOccurs="1"
                        minOccurs="0">
-               </xsd:element>
-               <xsd:element name="workItem" type="xsd:string" 
maxOccurs="unbounded" minOccurs="0"></xsd:element>
+               </xsd:element>

        </xsd:sequence>
-       <xsd:attribute name="ID" type="xsd:ID"></xsd:attribute>

+       <xsd:attribute name="ID" type="xsd:ID"></xsd:attribute>
+
+       <xsd:attribute name="workItems" type="xsd:IDREFS"></xsd:attribute>
     </xsd:complexType>
-
+
     <xsd:complexType name="Milestones">
        <xsd:sequence>
-               <xsd:element name="milestone" type="jagg:MileStone" 
maxOccurs="unbounded" minOccurs="0"></xsd:element>
+               <xsd:element name="milestone" type="jagg:Milestone" 
maxOccurs="unbounded" minOccurs="0"></xsd:element>
        </xsd:sequence>
     </xsd:complexType>
 
@@ -85,18 +98,10 @@
        </xsd:sequence>
     </xsd:complexType>
 
-    <xsd:complexType name="foo">
-       <xsd:sequence>
-               <xsd:element name="bar" type="xsd:string"></xsd:element>
-               <xsd:element name="fred" type="xsd:string"></xsd:element>
-       </xsd:sequence>
-       <xsd:attribute name="a" type="xsd:string"></xsd:attribute>
-       <xsd:attribute name="b" type="xsd:string"></xsd:attribute>
-    </xsd:complexType>
 
     <xsd:complexType name="PlanDTO">
        <xsd:sequence>
-               <xsd:element name="milestones" type="jagg:MileStone" 
maxOccurs="unbounded" minOccurs="0"></xsd:element>
+               <xsd:element name="milestones" type="jagg:Milestone" 
maxOccurs="unbounded" minOccurs="0"></xsd:element>
                <xsd:element name="workitems" type="jagg:WorkItem" 
maxOccurs="unbounded" minOccurs="0"></xsd:element>
        </xsd:sequence>
     </xsd:complexType>

Added: tuscany/sandbox/kgoodson/jagg/src/main/resources/plan.composite
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/resources/plan.composite?rev=903661&view=auto
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/resources/plan.composite (added)
+++ tuscany/sandbox/kgoodson/jagg/src/main/resources/plan.composite Wed Jan 27 
14:42:03 2010
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<composite     xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903";
+               xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1";
+               targetNamespace="http://jagg";
+               name="jagg">
+               
+    <component name="planApp">
+        <tuscany:implementation.widget location="uiservices/plan.html"/>
+        <service name="Widget">
+               <tuscany:binding.http uri="/plan"/>
+        </service>
+               <reference name="plan" target="Plan"/>
+    </component>
+    
+       <component name="Plan">
+               <implementation.java class="services.PlanViewImpl"/> 
+               <service name="PlanView">
+                       <tuscany:binding.jsonrpc/>
+               </service>      
+       </component> 
+       
+    
+
+</composite>

Added: tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html?rev=903661&view=auto
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html 
(added)
+++ tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html Wed 
Jan 27 14:42:03 2010
@@ -0,0 +1,91 @@
+<!--
+    * 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.    
+-->
+<html>
+<head>
+<title>Plan</title>
+
+<script type="text/javascript" src="/dojo/dojo.js"></script>
+<script type="text/javascript" src="plan.js"></script>
+
+<script language="JavaScript">
+
+       //@Reference
+       var plan = new tuscany.sca.Reference("plan");
+       var ms;
+       
+       function plan_getResponse(plan,exception) {
+               if(exception){
+                       alert(exception.message);
+                       return;
+               }
+               var mscontent = "<h2>Milestones</h2>\n<table border=\"1\">";
+               ms = plan.milestones.milestone.list;
+               for(var i=0; i<ms.length; i++) {
+                       mscontent += "<tr><th colspan=\"4\">" + ms[i].ID + 
"</th></tr>";
+                       var mswi = ms[i].workItems.list;
+                       mscontent 
+="<tr><th>ID</th><td>JIRA</th><td>Responsible</th><th>Status</th></tr>";
+                       for (var j=0; j<mswi.length; j++) {
+                               mscontent +=
+                                       "<tr>"
+                                       +"<td>"+mswi[j].ID+"</td>" + 
"<td>"+mswi[j].jira
+                                               +"</td>"+ 
"<td>"+mswi[j].responsible+"</td>"+ "<td>"+mswi[j].status+"</td>"+ "<td></td>"
+                                       +"</tr>";
+                       }
+
+               }
+
+               mscontent += "</table>"
+                       +"<h2> Work Items to be Scheduled</h2>";
+               mscontent += "<table 
border=\"1\"><tr><th>ID</th><th>JIRA</th><th>Responsible</th><th>Status</th></tr>";
+
+                       // unassigned work items (in terms of milestones)
+                       var uawi = plan.workitems.workitem.list;
+                       for(var j=0; j<uawi.length; j++) {
+                               if(uawi[j]) {
+                                       mscontent +=
+                                               "<tr>"
+                                               +"<td>"+uawi[j].ID+"</td>" + 
"<td>"+uawi[j].jira
+                                                       +"</td>"+ 
"<td>"+uawi[j].responsible+"</td>"+ "<td>"+uawi[j].status+"</td>"+ "<td></td>"
+                                               +"</tr>";
+                               }
+                       }
+
+                       mscontent += "</table>";                
+       
+               document.getElementById('milestones').innerHTML='<h2>' + 
mscontent;
+               return;
+               
+       }
+
+       
+function init()
+{
+       plan.get().addCallback(plan_getResponse);
+}
+
+       
+</script>
+
+</head>
+
+<body onload="init()">
+<h1>Plan</h1>
+  <div id="milestones"></div>
+</body>
+</html>
\ No newline at end of file

Propchange: 
tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date


Reply via email to