You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2007/06/02 00:28:06 UTC

svn commit: r543647 - in /incubator/tuscany/sandbox/slaws/feed-aggregator: ./ src/main/java/org/apache/tuscany/sca/samples/aggregator/ src/main/resources/ src/main/webapp/ src/test/java/org/apache/tuscany/sca/samples/aggregator/

Author: slaws
Date: Fri Jun  1 15:28:04 2007
New Revision: 543647

URL: http://svn.apache.org/viewvc?view=rev&rev=543647
Log:
Add in Sebatien's feed binding

Added:
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsFeedServiceImpl.java   (with props)
Modified:
    incubator/tuscany/sandbox/slaws/feed-aggregator/aggregator.png
    incubator/tuscany/sandbox/slaws/feed-aggregator/aggregator.svg
    incubator/tuscany/sandbox/slaws/feed-aggregator/pom.xml
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsServiceImpl.java
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsSourcesServiceImpl.java
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/RSSCheckerServiceImpl.java
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/SourceTypeNonSDOImpl.java
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/Alerts.xsd
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/alerts.composite
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/sources.xml
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/webapp/FeedAggregator.html
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/webapp/style.css
    incubator/tuscany/sandbox/slaws/feed-aggregator/src/test/java/org/apache/tuscany/sca/samples/aggregator/AlertsTestCase.java

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/aggregator.png
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/aggregator.png?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
Binary files - no diff available.

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/aggregator.svg
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/aggregator.svg?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/aggregator.svg (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/aggregator.svg Fri Jun  1 15:28:04 2007
@@ -38,8 +38,8 @@
      inkscape:current-layer="layer1"
      inkscape:window-width="1231"
      inkscape:window-height="883"
-     inkscape:window-x="68"
-     inkscape:window-y="15" />
+     inkscape:window-x="24"
+     inkscape:window-y="13" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -57,7 +57,7 @@
      id="layer1">
     <g
        id="g2997"
-       transform="matrix(0.493398,0,0,0.905393,32.49726,0.213099)">
+       transform="matrix(0.493398,0,0,0.868873,32.49726,7.184761)">
       <rect
          rx="15.307091"
          ry="11.608842"
@@ -66,7 +66,7 @@
          height="274.39081"
          width="495.71429"
          id="rect2067"
-         style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.99235177;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+         style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:3.05459166;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
       <flowRoot
          id="flowRoot2954"
          xml:space="preserve"
@@ -97,16 +97,7 @@
            height="61.42857"
            x="281.42856"
            y="212.66591" /></flowRegion><flowPara
-         id="flowPara2972">Display</flowPara></flowRoot>    <rect
-       style="opacity:1;fill:#fff62c;fill-opacity:1;stroke:#060000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect3006"
-       width="21.718224"
-       height="20.708065"
-       x="270.87827"
-       y="225.08167"
-       rx="10.859112"
-       ry="0" />
-    <path
+         id="flowPara2972">Display</flowPara></flowRoot>    <path
        style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        d="M 207.76582,260.46421 L 241.10086,260.46421 L 247.16177,273.59619 L 240.09071,285.71803 L 207.76582,285.71803 L 215.34197,273.59619 L 207.76582,260.46421 z "
        id="path3017" />
@@ -124,7 +115,7 @@
        id="path1885" />
     <g
        id="g1887"
-       transform="matrix(0.493398,0,0,0.905393,374.2831,0.162271)">
+       transform="matrix(0.493398,0,0,1.065504,374.2831,-30.40982)">
       <rect
          rx="27.634869"
          ry="18.594875"
@@ -133,7 +124,7 @@
          height="439.5152"
          width="894.9447"
          id="rect1889"
-         style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.99235058;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+         style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.75837588;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
       <flowRoot
          id="flowRoot1891"
          xml:space="preserve"
@@ -146,14 +137,14 @@
              id="rect1895" /></flowRegion><flowPara
            id="flowPara1897">AlerterComposite - Java</flowPara></flowRoot>    </g>
     <rect
-       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000119;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000095;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
        id="rect1899"
        width="115.66247"
-       height="237.38606"
+       height="190.91896"
        x="566.70215"
-       y="313.41953"
+       y="313.4194"
        rx="6.9961648"
-       ry="19.693087" />
+       ry="15.838266" />
     <flowRoot
        xml:space="preserve"
        id="flowRoot1901"
@@ -176,7 +167,7 @@
        ry="0" />
     <path
        style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 549.55163,364.53523 L 582.88667,364.53523 L 588.94758,377.66721 L 581.87652,389.78905 L 549.55163,389.78905 L 557.12778,377.66721 L 549.55163,364.53523 z "
+       d="M 548.54148,397.87026 L 581.87652,397.87026 L 587.93743,411.00224 L 580.86637,423.12408 L 548.54148,423.12408 L 556.11763,411.00224 L 548.54148,397.87026 z "
        id="path1911" />
     <path
        style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -218,14 +209,6 @@
        style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        d="M 432.14286,376.80877 L 482.85715,376.09448"
        id="path1945" />
-    <path
-       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 525,376.09448 L 557.14286,376.09448"
-       id="path1947" />
-    <path
-       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 524.65209,283.3802 L 727.14307,282.66591"
-       id="path1949" />
     <flowRoot
        xml:space="preserve"
        id="flowRoot1921"
@@ -238,21 +221,21 @@
            y="212.66591" /></flowRegion><flowPara
          id="flowPara1927">soap</flowPara></flowRoot>    <path
        style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 668.2159,379.93449 L 701.55094,379.93449 L 707.61185,393.06647 L 700.54079,405.18831 L 668.2159,405.18831 L 675.79205,393.06647 L 668.2159,379.93449 z "
+       d="M 663.16514,379.93449 L 696.50018,379.93449 L 702.56109,393.06647 L 695.49003,405.18831 L 663.16514,405.18831 L 670.74129,393.06647 L 663.16514,379.93449 z "
        id="path1929" />
     <rect
        style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.99999976;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
        id="rect1932"
        width="115.66247"
        height="79.802025"
-       x="740.18158"
+       x="746.18158"
        y="348.62225"
        rx="6.9961648"
        ry="6.6202211" />
     <flowRoot
        xml:space="preserve"
        id="flowRoot1934"
-       transform="translate(472.5909,142.6837)"><flowRegion
+       transform="translate(478.5909,142.6837)"><flowRegion
          id="flowRegion1936"><rect
            id="rect1938"
            width="170"
@@ -264,22 +247,22 @@
        d="M 723.03101,380.46928 L 756.36605,380.46928 L 762.42696,393.60126 L 755.3559,405.7231 L 723.03101,405.7231 L 730.60716,393.60126 L 723.03101,380.46928 z "
        id="path1944" />
     <rect
-       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000048;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000119;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
        id="rect1950"
        width="115.66247"
-       height="80.812263"
-       x="738.16901"
-       y="239.01831"
+       height="132.33011"
+       x="745.13855"
+       y="195.58192"
        rx="6.9961648"
-       ry="6.7040281" />
+       ry="10.977848" />
     <path
        style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 720.74384,268.81771 L 754.07888,268.81771 L 760.13979,281.94969 L 753.06873,294.07153 L 720.74384,294.07153 L 728.31999,281.94969 L 720.74384,268.81771 z "
+       d="M 720.74384,253.66542 L 754.07888,253.66542 L 760.13979,266.7974 L 753.06873,278.91924 L 720.74384,278.91924 L 728.31999,266.7974 L 720.74384,253.66542 z "
        id="path1952" />
     <flowRoot
        xml:space="preserve"
        id="flowRoot1954"
-       transform="translate(474.8795,36.50008)"><flowRegion
+       transform="translate(486.8998,-9.966938)"><flowRegion
          id="flowRegion1956"><rect
            id="rect1958"
            width="170"
@@ -287,31 +270,9 @@
            x="281.42856"
            y="212.66591" /></flowRegion><flowPara
          id="flowPara1960">AlertsSources</flowPara><flowPara
-         id="flowPara2055">Service</flowPara></flowRoot>    <path
-       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 208.57544,335.05504 L 241.91048,335.05504 L 247.97139,348.18702 L 240.90033,360.30886 L 208.57544,360.30886 L 216.15159,348.18702 L 208.57544,335.05504 z "
-       id="path1938" />
-    <path
-       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 133.2545,326.7938 L 176.86426,326.7938 L 184.7933,346.6115 L 175.54276,364.90477 L 133.2545,364.90477 L 143.16581,346.6115 L 133.2545,326.7938 z "
-       id="path1940" />
-    <flowRoot
-       xml:space="preserve"
-       id="flowRoot1942"
-       transform="translate(-135.2942,127.0157)"><flowRegion
-         id="flowRegion1944"><rect
-           id="rect1946"
-           width="170"
-           height="61.42857"
-           x="281.42856"
-           y="212.66591" /></flowRegion><flowPara
-         id="flowPara1948">jsonrpc</flowPara></flowRoot>    <path
-       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 183.66677,345.8492 L 215.80962,345.8492"
-       id="path1950" />
-    <g
+         id="flowPara2055">Service</flowPara></flowRoot>    <g
        id="g1962"
-       transform="translate(-161.8716,-15.3322)">
+       transform="translate(-176.0137,-37.3322)">
       <rect
          ry="6.2971425"
          rx="7.4499478"
@@ -331,17 +292,13 @@
          style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
     </g>
     <path
-       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 548.29258,444.51843 L 581.62762,444.51843 L 587.68853,457.65041 L 580.61747,469.77225 L 548.29258,469.77225 L 555.86873,457.65041 L 548.29258,444.51843 z "
-       id="path1971" />
-    <path
        style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 472.97164,436.25719 L 516.5814,436.25719 L 524.51044,456.07489 L 515.2599,474.36816 L 472.97164,474.36816 L 482.88295,456.07489 L 472.97164,436.25719 z "
+       d="M 472.97164,431.20643 L 516.5814,431.20643 L 524.51044,451.02413 L 515.2599,469.3174 L 472.97164,469.3174 L 482.88295,451.02413 L 472.97164,431.20643 z "
        id="path1973" />
     <flowRoot
        xml:space="preserve"
        id="flowRoot1977"
-       transform="translate(205.067,236.4266)"><flowRegion
+       transform="translate(201.067,231.3759)"><flowRegion
          id="flowRegion1979"><rect
            id="rect1981"
            width="170"
@@ -349,28 +306,12 @@
            x="281.42856"
            y="212.66591" /></flowRegion><flowPara
          id="flowPara1983">jsonrpc</flowPara></flowRoot>    <path
-       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1.00000036px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 102.72894,420.84571 L 102.02544,349.12487 L 141.42142,349.12487"
-       id="path1985" />
-    <path
-       style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 663.16515,478.92943 L 696.50019,478.92943 L 702.5611,492.06141 L 695.49004,504.18325 L 663.16515,504.18325 L 670.7413,492.06141 L 663.16515,478.92943 z "
-       id="path2009" />
-    <path
-       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 706.09663,392.5614 C 729.33014,392.5614 730.34029,392.5614 730.34029,392.5614"
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:0.99999988px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 703.12601,392.5614 C 729.14865,392.5614 730.28007,392.5614 730.28007,392.5614"
        id="path2011" />
     <path
-       style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999988px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 915.89241,466.61326 L 965.54614,466.61326 L 974.57414,489.40238 L 964.04144,510.43851 L 915.89241,510.43851 L 927.17734,489.40238 L 915.89241,466.61326 z "
-       id="path2017" />
-    <path
-       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 700.03492,487.94714 C 922.71649,487.94714 922.71649,487.94714 922.71649,487.94714"
-       id="path2019" />
-    <path
-       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 114.14724,455.31268 C 480.83261,455.31268 480.83261,455.31268 480.83261,455.31268"
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 103.05071,450.26192 C 480.81768,450.26192 480.81768,450.26192 480.81768,450.26192"
        id="path2021" />
     <path
        style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -413,62 +354,256 @@
            x="281.42856"
            y="212.66591" /></flowRegion><flowPara
          id="flowPara2049">soap</flowPara></flowRoot>    <path
-       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 703.06617,349.12484 L 710.13724,349.12484 L 711.14739,290.53599 L 723.26922,290.53599"
-       id="path2051" />
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 472.23581,584.46535 L 515.84557,584.46535 L 523.77461,604.28305 L 514.52407,622.57632 L 472.23581,622.57632 L 482.14712,604.28305 L 472.23581,584.46535 z "
+       id="path2077" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot2079"
+       transform="translate(201.2595,384.6873)"><flowRegion
+         id="flowRegion2081"><rect
+           id="rect2083"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara2085">atom</flowPara></flowRoot>    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 474.05184,212.89166 L 517.6616,212.89166 L 525.59064,232.70936 L 516.3401,251.00263 L 474.05184,251.00263 L 483.96315,232.70936 L 474.05184,212.89166 z "
+       id="path1995" />
     <flowRoot
        xml:space="preserve"
-       id="flowRoot2057"
-       transform="translate(-175.6716,172.7177)"><flowRegion
-         id="flowRegion2059"><rect
-           id="rect2061"
+       id="flowRoot1997"
+       transform="translate(202.1472,13.06115)"><flowRegion
+         id="flowRegion1999"><rect
+           id="rect2001"
            width="170"
            height="61.42857"
            x="281.42856"
            y="212.66591" /></flowRegion><flowPara
-         id="flowPara2063">TBD</flowPara></flowRoot>    <flowRoot
+         id="flowPara2003">jsonrpc</flowPara></flowRoot>    <g
+       id="g2019"
+       transform="translate(-178.034,112.9369)">
+      <rect
+         ry="6.2971425"
+         rx="7.4499478"
+         y="442.66592"
+         x="221.42857"
+         height="44.285713"
+         width="48.57143"
+         id="rect2021"
+         style="opacity:1;fill:none;fill-opacity:1;stroke:#060000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 1;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         id="path2023"
+         d="M 215,436.23734 L 276.42857,436.95163 L 276.42857,491.23734 L 213.57143,491.23734 L 215,436.23734 z "
+         style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         id="path2026"
+         d="M 275.71429,491.23734 L 287.85714,504.80877 L 203.57143,504.09448 L 214.28571,491.95163"
+         style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+    </g>
+    <path
+       style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 663.04526,423.36857 L 696.3803,423.36857 L 702.44121,436.50055 L 695.37015,448.62239 L 663.04526,448.62239 L 670.62141,436.50055 L 663.04526,423.36857 z "
+       id="path2030" />
+    <rect
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.99999976;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:5.99999928, 1.99999976;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect2032"
+       width="115.66247"
+       height="79.802025"
+       x="747.07184"
+       y="437.51321"
+       rx="6.9961648"
+       ry="6.6202211" />
+    <flowRoot
        xml:space="preserve"
-       id="flowRoot2065"
-       transform="translate(648.7571,270.7025)"><flowRegion
-         id="flowRegion2067"><rect
-           id="rect2069"
+       id="flowRoot2034"
+       transform="translate(482.5116,231.5747)"><flowRegion
+         id="flowRegion2036"><rect
+           id="rect2038"
            width="170"
            height="61.42857"
            x="281.42856"
            y="212.66591" /></flowRegion><flowPara
-         id="flowPara2071">feed</flowPara></flowRoot>    <path
+         id="flowPara2040">POP - Not done</flowPara></flowRoot>    <path
        style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 549.01791,511.37615 L 582.35295,511.37615 L 588.41386,524.50813 L 581.3428,536.62997 L 549.01791,536.62997 L 556.59406,524.50813 L 549.01791,511.37615 z "
-       id="path2073" />
+       d="M 726.95174,469.36022 L 760.28678,469.36022 L 766.34769,482.4922 L 759.27663,494.61404 L 726.95174,494.61404 L 734.52789,482.4922 L 726.95174,469.36022 z "
+       id="path2042" />
+    <g
+       id="g2046"
+       transform="translate(-173.9935,-197.1597)">
+      <rect
+         ry="6.2971425"
+         rx="7.4499478"
+         y="442.66592"
+         x="221.42857"
+         height="44.285713"
+         width="48.57143"
+         id="rect2048"
+         style="opacity:1;fill:none;fill-opacity:1;stroke:#060000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 1;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         id="path2050"
+         d="M 215,436.23734 L 276.42857,436.95163 L 276.42857,491.23734 L 213.57143,491.23734 L 215,436.23734 z "
+         style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         id="path2052"
+         d="M 275.71429,491.23734 L 287.85714,504.80877 L 203.57143,504.09448 L 214.28571,491.95163"
+         style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+    </g>
     <path
-       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1.0000006px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 71.450234,421.856 L 70.205581,271.34321 L 139.90614,271.34321"
-       id="path2075" />
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 103.03556,270.33294 C 140.4112,270.33294 140.4112,270.33294 140.4112,270.33294"
+       id="path2054" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 102.02541,434.9878 L 449.51788,432.9675 L 450.52804,231.94714 L 482.85292,231.94714"
+       id="path2056" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 97.984797,603.52083 L 480.83262,601.50053"
+       id="path2058" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot2060"
+       transform="translate(-226.8143,99.79398)"><flowRegion
+         id="flowRegion2062"><rect
+           id="rect2064"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara2066">HTML</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot2068"
+       transform="translate(-232.7737,258.6113)"><flowRegion
+         id="flowRegion2070"><rect
+           id="rect2072"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara2074">Web2.0</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot2076"
+       transform="translate(-248.6574,410.2362)"><flowRegion
+         id="flowRegion2078"><rect
+           id="rect2080"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara2082">Thunderbird</flowPara></flowRoot>    <path
+       style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 663.10519,467.81527 L 696.44023,467.81527 L 702.50114,480.94725 L 695.43008,493.06909 L 663.10519,493.06909 L 670.68134,480.94725 L 663.10519,467.81527 z "
+       id="path2088" />
+    <rect
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.99999976;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:5.99999928, 1.99999976;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect2090"
+       width="115.66247"
+       height="79.802025"
+       x="746.12164"
+       y="533.47766"
+       rx="6.9961648"
+       ry="6.6202211" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot2092"
+       transform="translate(481.5614,327.5392)"><flowRegion
+         id="flowRegion2094"><rect
+           id="rect2096"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara2098">NNTP - Not done</flowPara></flowRoot>    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 726.00152,565.3247 L 759.33656,565.3247 L 765.39747,578.45668 L 758.32641,590.57852 L 726.00152,590.57852 L 733.57767,578.45668 L 726.00152,565.3247 z "
+       id="path2100" />
     <path
        style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 474.25611,504.82574 L 517.86587,504.82574 L 525.79491,524.64344 L 516.54437,542.93671 L 474.25611,542.93671 L 484.16742,524.64344 L 474.25611,504.82574 z "
-       id="path2077" />
+       d="M 472.48834,533.95773 L 516.0981,533.95773 L 524.02714,553.77543 L 514.7766,572.0687 L 472.48834,572.0687 L 482.39965,553.77543 L 472.48834,533.95773 z "
+       id="path2106" />
     <flowRoot
        xml:space="preserve"
-       id="flowRoot2079"
-       transform="translate(203.2798,305.0477)"><flowRegion
-         id="flowRegion2081"><rect
-           id="rect2083"
+       id="flowRoot2108"
+       transform="translate(201.512,334.1797)"><flowRegion
+         id="flowRegion2110"><rect
+           id="rect2112"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara2114">rss</flowPara></flowRoot>    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 98.237332,557.01321 L 481.08515,554.99291"
+       id="path2120" />
+    <rect
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect2022"
+       width="115.66247"
+       height="95.964485"
+       x="565.43286"
+       y="534.48798"
+       rx="6.9961648"
+       ry="7.9610276" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot2024"
+       transform="translate(304.5289,349.5419)"><flowRegion
+         id="flowRegion2026"><rect
+           id="rect2028"
            width="170"
            height="61.42857"
            x="281.42856"
            y="212.66591" /></flowRegion><flowPara
-         id="flowPara2085">feed</flowPara></flowRoot>    <path
+         id="flowPara2030">AlertFeed</flowPara><flowPara
+         id="flowPara2032">Service</flowPara></flowRoot>    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 540.93669,563.74164 L 574.27173,563.74164 L 580.33264,576.87362 L 573.26158,588.99546 L 540.93669,588.99546 L 548.51284,576.87362 L 540.93669,563.74164 z "
+       id="path2073" />
+    <path
+       style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 657.10424,562.7721 L 690.43928,562.7721 L 696.50019,575.90408 L 689.42913,588.02592 L 657.10424,588.02592 L 664.68039,575.90408 L 657.10424,562.7721 z "
+       id="path2034" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 525.27933,230.93699 L 685.89358,229.92684 L 685.89358,259.22126 L 724.27938,259.22126"
+       id="path2038" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 525.27933,286.49538 L 671.75144,284.47507 L 671.75144,267.30248 L 726.29968,267.30248"
+       id="path2040" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 701.04587,349.12484 L 714.17785,348.11468 L 714.17785,275.3837 L 722.25907,275.3837"
+       id="path2043" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 525.27933,374.37865 L 538.41131,374.37865 L 538.41131,401.65277 L 550.53314,400.64262"
+       id="path2045" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 701.04587,437.00811 L 721.24892,437.00811 L 721.24892,480.44467 L 732.3606,480.44467"
+       id="path2049" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 701.04587,481.45482 L 714.17785,481.45482 L 714.17785,579.43962 L 733.37075,579.43962"
+       id="path2051" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 697.00526,575.39901 L 705.08648,575.39901 L 704.07633,518.83046 L 541.44177,518.83046 L 541.44177,415.7949 L 552.55344,415.7949"
+       id="path2053" />
+    <path
        style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 524.36018,456.20101 L 556.50304,456.20101"
-       id="path2087" />
+       d="M 522.24887,451.15024 L 533.36055,451.15024 L 533.36055,409.73399 L 554.57375,409.73399"
+       id="path2055" />
     <path
        style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 523.35003,523.88123 L 555.49289,523.88123"
-       id="path2089" />
+       d="M 522.24887,552.1655 L 535.38085,552.1655 L 534.3707,574.38885 L 546.49253,574.38885"
+       id="path2057" />
     <path
        style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       d="M 482.85292,524.89138 C 83.842662,521.86092 83.842662,522.87107 83.842662,522.87107 L 83.842662,489.53604"
-       id="path2091" />
+       d="M 522.24887,604.69343 L 535.38085,603.68328 L 535.38085,583.48023 L 542.45192,583.48023"
+       id="path2059" />
   </g>
 </svg>

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/pom.xml?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/pom.xml (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/pom.xml Fri Jun  1 15:28:04 2007
@@ -44,6 +44,12 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+	        <groupId>httpunit</groupId>
+	        <artifactId>httpunit</artifactId>
+	        <version>1.6.1</version>
+	        <scope>test</scope>
+        </dependency>        
+        <dependency>
             <groupId>org.apache.tuscany.sdo</groupId>
             <artifactId>tuscany-sdo-impl</artifactId>
             <version>1.0-incubating-SNAPSHOT</version>
@@ -112,7 +118,13 @@
             <artifactId>tuscany-binding-jsonrpc</artifactId>
             <version>1.0-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
-        </dependency>        
+        </dependency>    
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-feed</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>              
 		<dependency>
 		    <groupId>rome</groupId>
 		    <artifactId>rome</artifactId>

Added: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsFeedServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsFeedServiceImpl.java?view=auto&rev=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsFeedServiceImpl.java (added)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsFeedServiceImpl.java Fri Jun  1 15:28:04 2007
@@ -0,0 +1,98 @@
+/*
+ * 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 org.apache.tuscany.sca.samples.aggregator;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.tuscany.sca.samples.aggregator.types.ConfigType;
+import org.apache.tuscany.sca.samples.aggregator.types.SourceType;
+import org.apache.tuscany.sca.samples.aggregator.types.TypesFactory;
+import org.apache.tuscany.sca.samples.aggregator.types.AlertsType;
+import org.apache.tuscany.sca.samples.aggregator.types.AlertType;
+import org.apache.tuscany.sca.samples.aggregator.types.impl.AlertsTypeImpl;
+
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Reference;
+
+import com.sun.syndication.feed.synd.SyndEntry;
+import com.sun.syndication.feed.synd.SyndEntryImpl;
+import com.sun.syndication.feed.synd.SyndFeed;
+import com.sun.syndication.feed.synd.SyndFeedImpl;
+
+import org.apache.tuscany.sca.binding.feed.Feed;
+
+/**
+ * Read all new alerts from the specified sources
+ *
+ * @version $Rev$ $Date$
+ */
+@Service(Feed.class)
+public class AlertsFeedServiceImpl implements Feed {
+  
+    private AlertsService alerts;
+    
+    @Reference
+    public void alerts(AlertsService alerts) {
+        this.alerts = alerts;
+    }    
+    
+    DateFormat dateFormatter = DateFormat.getDateTimeInstance();
+    
+    /**
+     * Return the alerts as a feed. Used by binding.feed
+     * 
+     * @return the structure containing alerts 
+     */    
+    public SyndFeed get() {
+        
+        // Create a new Feed
+        SyndFeed feed = new SyndFeedImpl();
+        feed.setTitle("Apache Tuscant Feed Aggregator");
+        feed.setDescription("A sample showing an SCA application to aggregate various types of feeds");
+        feed.setAuthor("Apache Tuscany");
+        feed.setLink("http://incubator.apache.org/tuscany");
+ 
+        // Aggregate entries from feed1 and feed2
+        List<SyndEntry> entries = new ArrayList<SyndEntry>();
+        
+        try {        
+            AlertsType alerts = this.alerts.getAllNewAlerts("");
+            
+            for( Object alertObject : alerts.getAlert() ){         
+                AlertType alert = ((AlertType)alertObject);
+                SyndEntry entry = new SyndEntryImpl();
+                entry.setTitle(alert.getTitle());
+                //entry.(alert.getSummary());                    
+                entry.setLink(alert.getAddress());
+                entry.setPublishedDate(dateFormatter.parse(alert.getDate()));
+                        
+                entries.add(entry);
+            }
+        } catch(Exception ex) {
+            System.err.println("Exception " + ex.toString());
+        }
+        
+        feed.setEntries(entries);
+        return feed;
+    }    
+}

Propchange: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsFeedServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsFeedServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsServiceImpl.java?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsServiceImpl.java (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsServiceImpl.java Fri Jun  1 15:28:04 2007
@@ -20,6 +20,7 @@
 package org.apache.tuscany.sca.samples.aggregator;
 
 import java.text.DateFormat;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -33,13 +34,20 @@
 import org.osoa.sca.annotations.Service;
 import org.osoa.sca.annotations.Reference;
 
+import com.sun.syndication.feed.synd.SyndEntry;
+import com.sun.syndication.feed.synd.SyndEntryImpl;
+import com.sun.syndication.feed.synd.SyndFeed;
+import com.sun.syndication.feed.synd.SyndFeedImpl;
+
+import org.apache.tuscany.sca.binding.feed.Feed;
+
 /**
  * Read all new alerts from the specified sources
  *
  * @version $Rev$ $Date$
  */
 @Service(AlertsService.class)
-public class AlertsServiceImpl {
+public class AlertsServiceImpl implements AlertsService {
 
     private RSSCheckerService    rssChecker;
     
@@ -55,6 +63,8 @@
         this.alertsSources = alertsSources;
     }    
     
+    DateFormat dateFormatter = DateFormat.getDateTimeInstance();
+    
     /**
      * Return a structure holding all of the new alerts that have been found
      * 
@@ -72,49 +82,53 @@
         // get the date/time now so that we can update the 
         // alert source record so that next time we 
         // only get the latest alerts
-        DateFormat dateFormatter = DateFormat.getDateTimeInstance();
         Date now = new Date();
         String nowString = dateFormatter.format(now);
               
-        ConfigType alertSourceConfig = alertsSources.getAlertSources(id);
-        
-        for (Object source : alertSourceConfig.getSource()){
-            SourceType sourceType = (SourceType)source;
-            
-            AlertsType alerts = null;
+        try {
+            ConfigType alertSourceConfig = alertsSources.getAlertSources(id);
             
-            if ( sourceType.getType_().equals("rss")){
-                alerts = rssChecker.getNewAlerts(sourceType.getFeedAddress(),
-                                                 sourceType.getLastChecked());
-            } else {
+            for (Object source : alertSourceConfig.getSource()){
+                SourceType sourceType = (SourceType)source;
                 
-            }
-            
-            // extend return list with any alerts we found
-            for( Object alert : alerts.getAlert() ){
-                // set the id on the alert so we know which source it
-                // came from 
-                ((AlertType)alert).setSourceId(sourceType.getId());
+                AlertsType alerts = null;
                 
-                // convert from SDO to POJO so that the 
-                // JSONRPC binding will work. It can't currently
-                // handle SDOs
-                AlertType newAlert = new AlertTypeNonSDOImpl();
-
-                newAlert.setSourceId(((AlertType)alert).getSourceId());
-                newAlert.setTitle(((AlertType)alert).getTitle());
-                newAlert.setSummary(((AlertType)alert).getSummary());                    
-                newAlert.setAddress(((AlertType)alert).getAddress());
-                newAlert.setDate("Thu May 31 09:42:00");//((AlertType)alert).getDate());
-                newAlert.setId(((AlertType)alert).getId());
-                newAlert.setUnread(((AlertType)alert).isUnread());                
+                if ( sourceType.getFeedType().equals("rss")){
+                    alerts = rssChecker.getNewAlerts(sourceType.getFeedAddress(),
+                                                     sourceType.getLastChecked());
+                } else {
+                    
+                }
                 
-                returnAlertList.add(newAlert);
+                // extend return list with any alerts we found
+                for( Object alert : alerts.getAlert() ){         
+
+                    // set the id on the alert so we know which source it
+                    // came from 
+                    ((AlertType)alert).setSourceId(sourceType.getId());
+                    
+                    // convert from SDO to POJO so that the 
+                    // JSONRPC binding will work. It can't currently
+                    // handle SDOs
+                    AlertType newAlert = new AlertTypeNonSDOImpl();
+    
+                    newAlert.setSourceId(((AlertType)alert).getSourceId());
+                    newAlert.setTitle(((AlertType)alert).getTitle());
+                    newAlert.setSummary(((AlertType)alert).getSummary());                    
+                    newAlert.setAddress(((AlertType)alert).getAddress());
+                    newAlert.setDate(((AlertType)alert).getDate());
+                    newAlert.setId(((AlertType)alert).getId());
+                    newAlert.setUnread(((AlertType)alert).isUnread());                
+                    
+                    returnAlertList.add(newAlert);
+                }
+                
+                // update the time last checked for this source
+                sourceType.setLastChecked(nowString);
+                //alertsSources.updateAlertSource(sourceType);
             }
-            
-            // update the time last checked for this source
-            sourceType.setLastChecked(nowString);
-            //alertsSources.updateAlertSource(sourceType);
+        } catch(Exception ex) {
+            System.err.println("Exception " + ex.toString());
         }
         
         return returnAlerts ;

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsSourcesServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsSourcesServiceImpl.java?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsSourcesServiceImpl.java (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/AlertsSourcesServiceImpl.java Fri Jun  1 15:28:04 2007
@@ -21,6 +21,8 @@
 
 import java.io.FileInputStream;
 import java.io.InputStream;
+import java.text.DateFormat;
+import java.util.Date;
 import java.util.List;
 
 import org.apache.tuscany.sca.samples.aggregator.types.AlertsType;
@@ -48,7 +50,7 @@
  */
 @Service(AlertsSourcesService.class)
 @Scope("COMPOSITE")
-public class AlertsSourcesServiceImpl {
+public class AlertsSourcesServiceImpl implements AlertsSourcesService {
     
     ConfigType alertSources;
     
@@ -93,9 +95,9 @@
             newSource.setAddress(((SourceTypeImpl)source).getAddress());
             newSource.setFeedAddress(((SourceTypeImpl)source).getFeedAddress());
             newSource.setId(((SourceTypeImpl)source).getId());
-            newSource.setLastChecked("");//((SourceTypeImpl)source).getLastChecked())
+            newSource.setLastChecked(((SourceTypeImpl)source).getLastChecked());
             newSource.setName(((SourceTypeImpl)source).getName());
-            newSource.setType(((SourceTypeImpl)source).getType_());
+            newSource.setFeedType(((SourceTypeImpl)source).getFeedType());
             sources.getSource().add(newSource);
         }
         
@@ -152,6 +154,13 @@
     public String addAlertSource (SourceType newSource)
     {           
         System.err.println("addAlertSource()");
+        // set the date to now less 2 hours so we 
+        // get some alerts straight away
+        DateFormat dateFormatter = DateFormat.getDateTimeInstance();
+        Date now = new Date();
+        now.setHours(now.getHours()-2);
+        String nowString = dateFormatter.format(now);        
+        newSource.setLastChecked(nowString); 
         alertSources.getSource().add(newSource);  
         return "Done";
     }    

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/RSSCheckerServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/RSSCheckerServiceImpl.java?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/RSSCheckerServiceImpl.java (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/RSSCheckerServiceImpl.java Fri Jun  1 15:28:04 2007
@@ -69,7 +69,7 @@
                 //                        "]]>");
                     newAlert.setSummary("");                    
                     newAlert.setAddress(syndEntry.getLink());
-                    newAlert.setDate(syndEntry.getPublishedDate().toString());
+                    newAlert.setDate(dateFormatter.format(syndEntry.getPublishedDate()));
                     newAlert.setId(rssaddress);
                     newAlert.setUnread(true);
                     

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/SourceTypeNonSDOImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/SourceTypeNonSDOImpl.java?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/SourceTypeNonSDOImpl.java (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/java/org/apache/tuscany/sca/samples/aggregator/SourceTypeNonSDOImpl.java Fri Jun  1 15:28:04 2007
@@ -317,24 +317,25 @@
   protected String id = ID_DEFAULT_;
 
   /**
-   * The default value of the '{@link #getType_() <em>Type</em>}' attribute.
+   * The default value of the '{@link #getFeedType() <em>Feed Type</em>}' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
-   * @see #getType_()
+   * @see #getFeedType()
    * @generated
    * @ordered
    */
-  protected static final String TYPE_DEFAULT_ = null;
+  protected static final String FEED_TYPE_DEFAULT_ = null;
 
   /**
-   * The cached value of the '{@link #getType_() <em>Type</em>}' attribute.
+   * The cached value of the '{@link #getFeedType() <em>Feed Type</em>}' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
-   * @see #getType_()
+   * @see #getFeedType()
    * @generated
    * @ordered
    */
-  protected String type = TYPE_DEFAULT_;
+  protected String feedType = FEED_TYPE_DEFAULT_;
+  
 
   /**
    * <!-- begin-user-doc -->
@@ -505,18 +506,18 @@
    * <!-- end-user-doc -->
    * @generated
    */
-  public String getType_()
+  public String getFeedType()
   {
-    return type;
+    return feedType;
   }
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
-  public void setType(String newType)
+  public void setFeedType(String newType)
   {
-    type = newType;
+    feedType = newType;
   }
   
   public Sequence getAny(){

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/Alerts.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/Alerts.xsd?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/Alerts.xsd (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/Alerts.xsd Fri Jun  1 15:28:04 2007
@@ -52,7 +52,7 @@
     		<any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
     	</sequence>
         <attribute name="Id" type="string" use="optional"/>
-    	<attribute name="Type" use="required">
+    	<attribute name="FeedType" use="required">
     		<simpleType>
     			<restriction base="string">
     				<enumeration value="rss"/>

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/alerts.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/alerts.composite?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/alerts.composite (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/alerts.composite Fri Jun  1 15:28:04 2007
@@ -26,7 +26,22 @@
     <!-- SDO factory classes -->    
     <dbsdo:import.sdo factory="org.apache.tuscany.sca.samples.aggregator.service.ServiceFactory"/>        
     <dbsdo:import.sdo factory="org.apache.tuscany.sca.samples.aggregator.types.TypesFactory"/> 
+
+    <!-- The alerts rss service -->
+    <service name="AlertsFeedServiceRSS" promote="AlertsFeedServiceComponent/Feed">
+        <binding.rss />
+    </service>    
+    
+    <!-- The alerts atom service -->
+    <service name="AlertsFeedServiceAtom" promote="AlertsFeedServiceComponent/Feed">
+        <binding.atom />
+    </service> 
     
+    <component name="AlertsFeedServiceComponent">
+        <implementation.java class="org.apache.tuscany.sca.samples.aggregator.AlertsFeedServiceImpl" />
+        <reference name="alerts" target="AlertsServiceComponent"/>
+    </component>    
+        
     <!-- The alerts web service -->
     <service name="AlertsService" promote="AlertsServiceComponent">
         <interface.wsdl interface="http://tuscany.apache.org/sca/samples/aggregator/service#wsdl.interface(AlertsPortType)"/>
@@ -37,7 +52,7 @@
     <service name="AlertsServiceJSONRPC" promote="AlertsServiceComponent/AlertsService">
         <interface.java interface="org.apache.tuscany.sca.samples.aggregator.AlertsService" />
         <binding.jsonrpc />
-    </service>
+    </service>     
 
     <component name="AlertsServiceComponent">
         <implementation.java class="org.apache.tuscany.sca.samples.aggregator.AlertsServiceImpl" />

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/sources.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/sources.xml?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/sources.xml (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/resources/sources.xml Fri Jun  1 15:28:04 2007
@@ -18,16 +18,16 @@
    under the License.
 -->
 <ns0:Config xmlns:ns0="http://tuscany.apache.org/sca/samples/aggregator/types">
-<ns0:Source Id="0" Type="rss">
+<ns0:Source Id="0" FeedType="rss">
   <ns0:Name>BBC News</ns0:Name>
   <ns0:Address>http://news.bbc.co.uk/</ns0:Address>
-  <ns0:LastChecked>31-May-2007 08:34:03</ns0:LastChecked>
+  <ns0:LastChecked>01-Jun-2007 16:34:03</ns0:LastChecked>
   <ns0:FeedAddress>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml</ns0:FeedAddress>
 </ns0:Source>
-<ns0:Source Id="1" Type="rss">
+<ns0:Source Id="1" FeedType="rss">
   <ns0:Name>Engadget</ns0:Name>
   <ns0:Address>http://www.engadget.com</ns0:Address>
-  <ns0:LastChecked>31-May-2007 08:34:03</ns0:LastChecked>
+  <ns0:LastChecked>01-Jun-2007 16:34:03</ns0:LastChecked>
   <ns0:FeedAddress>http://www.engadget.com/rss.xml</ns0:FeedAddress>
 </ns0:Source>
-</ns0:Config>
\ No newline at end of file
+</ns0:Config>

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/webapp/FeedAggregator.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/webapp/FeedAggregator.html?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/webapp/FeedAggregator.html (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/webapp/FeedAggregator.html Fri Jun  1 15:28:04 2007
@@ -21,7 +21,7 @@
     <title>Apache Tuscany Feed Aggregator Sample</TITLE>
     
     <script type="text/javascript">
-        var djConfig = {isDebug: true,debugContainerId: "dojoDebug" };
+        //var djConfig = {isDebug: true,debugContainerId: "dojoDebug" };
         //djConfig.debugAtAllCosts = true;
     </script>
  
@@ -37,28 +37,34 @@
     <link rel="stylesheet" type="text/css" href="style.css" />
   </head>
 
-  <body>
+  <body onload="getAlertSources()">
 
     <script type="text/javascript">
     
         // The proxy for the alert and alertsources services running in Tuscany
-        //var alertsService       = new dojo.rpc.JsonService("services/AlertsServiceJSONRPC?smd");
-        //var alertSourcesService = new dojo.rpc.JsonService("services/AlertsSourcesServiceJSONRPC?smd");
+        var alertsService       = new dojo.rpc.JsonService("services/AlertsServiceJSONRPC?smd");
+        var alertSourcesService = new dojo.rpc.JsonService("services/AlertsSourcesServiceJSONRPC?smd");
+        // If you want to put an HTTP sniffer in the way to look at the JSONROPC packets you'll
+        // need to edit the target address of the service in the smd. The only way to do this easily
+        // is to read an smd from disc rather than generate one. There are two smds provided for this
 	//var alertsService       = new dojo.rpc.JsonService("service.smd");
-        var alertSourcesService = new dojo.rpc.JsonService("sources.smd");
+        //var alertSourcesService = new dojo.rpc.JsonService("sources.smd");
 
         // The global list of alerts sources
         var alertSourceList = null;
 
+        // The global list of alerts 
+        var alertList       = null;
+
         // the constructor for entries on the alert source list
-        function alertSourceType(name,id,address,feedAddress,type_,popUsername,popPassword,popServer,lastChecked,javaClass) {
+        function alertSourceType(name,id,address,feedAddress,feedType,popUsername,popPassword,popServer,lastChecked,javaClass) {
           this.name        = name;
           this.id          = id;
           this.address     = address;
           this.feedAddress = feedAddress;
-          this.type_       = type_;
+          this.feedType    = feedType;
           this.lastChecked = lastChecked;
-          this.javaClass   = "org.apache.tuscany.sca.samples.aggregator.SourceTypeNonSDOImpl";
+          this.javaClass   = "org.apache.tuscany.sca.samples.aggregator.types.impl.SourceTypeImpl";
 
         }
 
@@ -75,6 +81,7 @@
         { 
             response = alertSourcesService.getAlertSources("Dojo");
             response.addCallbacks(getAlertSourcesCallback, errorCallback);
+            getAlerts();
         }
 
         function getAlertSourcesCallback(result) {
@@ -199,11 +206,13 @@
             hideEditSource(sourceid);
             var source = getSource(sourceId);
             alertSourcesService.updateAlertSource(source);
+            getAlertSources();
         }
  
         function deleteSource(sourceid)
         {
             alertSourcesService.removeAlertSource(sourceid);
+            getAlertSources();
         }
 
         function showAddNewSource(sourceid)
@@ -221,6 +230,7 @@
             hideAddNewSource(sourceid);
             var source = getSource(sourceid);
             alertSourcesService.addAlertSource(source);
+            getAlertSources();
         }
 
         function getSource(sourceid)
@@ -228,24 +238,24 @@
             var source = alertSourceList[sourceid];
 
             if ( source == null ){
-                source = new alertSourceType("name","id","address","feedAddress","type_","popUsername","popPassword","popServer","lastChecked","javaClass");
+                source = new alertSourceType("name","id","address","feedAddress","feedType","popUsername","popPassword","popServer","lastChecked","javaClass");
                 alertSourceList[sourceid] = source;
             }
             
-            source.name = document.getElementById("source_"+sourceid+"_name").value;
-            source.id   = sourceid;
-            source.address = document.getElementById("source_"+sourceid+"_address").value;
-            var typeElem = document.getElementById("source_"+sourceid+"_type");
-            source.type_ = typeElem.options[typeElem.selectedIndex].value; 
+            source.name     = document.getElementById("source_"+sourceid+"_name").value;
+            source.id       = sourceid;
+            source.address  = document.getElementById("source_"+sourceid+"_address").value;
+            var typeElem    = document.getElementById("source_"+sourceid+"_type");
+            source.feedType = typeElem.options[typeElem.selectedIndex].value; 
 
-            if(source.type_=="rss")
+            if(source.feedType=="rss")
             {
                 source.feedAddress = document.getElementById("source_"+sourceid+"_feedAddress").value;
                 
             }
-            else if(type=="pop")
+            else if(source.feedType=="pop")
             {
-                source.popServer = document.getElementById("source_"+sourceid+"_popServer").value;
+                source.popServer   = document.getElementById("source_"+sourceid+"_popServer").value;
                 source.popUsername = document.getElementById("source_"+sourceid+"_popUsername").value;
                 source.popPassword = document.getElementById("source_"+sourceid+"_popPassword").value;
             } 
@@ -265,15 +275,16 @@
             if ( result.error != null ) {
                 resultsNode.innerHTML = result.error;
             } else {
+                alertList = result.alert.list;
                 var text = ""
                 for (var i in result.alert.list){
                     var alert = result.alert.list[i];
 
                     text = text + "<table>";
                     text = text + "<TR class='source_" + alert.sourceId + " clickable' onclick=\"displayAlert('" + alert.address + "')\">";
-                    text = text + " <TD>";
+                    text = text + " <TD class='alert_text'>";
                     text = text + "   <SPAN id='" + alert.id + "' class='unread_title'>" + alert.title + "</SPAN>";
-                    text = text + "   <SPAN class='summary'> - " + alert.summary  + "...</SPAN>";
+                    text = text + "   <SPAN class='summary'> - " + alert.summary.substring(0, 80)  + "...</SPAN>";
                     text = text + " </TD>";
                     text = text + " <TD>";
                     text = text +     alert.date;
@@ -302,10 +313,10 @@
     <h1 id="top">Apache Tuscany Feed Aggregator Sample</h1>
     <div id="errors"></div>
     <p>Alert Sources<span id="refreshSources"></span>:</p>
-    <input type="button" value="getSources" onclick="getAlertSources()"/>
+    <!--input type="button" value="getSources" onclick="getAlertSources()"/-->
     <div id="alertSourcesTable">Refreshing...</div>
     <p/>
-    <input type="button" value="getAlerts" onclick="getAlerts()"/>
+    <input type="button" value="Refresh" onclick="getAlerts()"/>
     <p/>
     <div id="alertsTable">Refreshing...</div>
     <p><a id="data" HREF="#top">Back to top</a></p>

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/webapp/style.css
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/webapp/style.css?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/webapp/style.css (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/main/webapp/style.css Fri Jun  1 15:28:04 2007
@@ -107,6 +107,11 @@
 display: none;
 }
 
+.alert_text
+{
+width: 600px;
+}
+
 .alert_data
 {
 margin-left: 10px;

Modified: incubator/tuscany/sandbox/slaws/feed-aggregator/src/test/java/org/apache/tuscany/sca/samples/aggregator/AlertsTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/slaws/feed-aggregator/src/test/java/org/apache/tuscany/sca/samples/aggregator/AlertsTestCase.java?view=diff&rev=543647&r1=543646&r2=543647
==============================================================================
--- incubator/tuscany/sandbox/slaws/feed-aggregator/src/test/java/org/apache/tuscany/sca/samples/aggregator/AlertsTestCase.java (original)
+++ incubator/tuscany/sandbox/slaws/feed-aggregator/src/test/java/org/apache/tuscany/sca/samples/aggregator/AlertsTestCase.java Fri Jun  1 15:28:04 2007
@@ -19,9 +19,17 @@
 
 package org.apache.tuscany.sca.samples.aggregator;
 
+import java.io.ByteArrayInputStream;
+
 import junit.framework.TestCase;
 
 import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.json.JSONObject;
+
+import com.meterware.httpunit.PostMethodWebRequest;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
 
 
 /**
@@ -42,15 +50,42 @@
     protected void tearDown() {
         scaDomain.close();
     }
-
-
-    /**
-     * Waits for a bit to keep the jetty server running
-     */
-    public void testWait() throws Exception {
-        System.out.println("Running server - press a key to stop");
-        //System.in.read();
-        System.out.println("Finished waiting");
+    /*  
+    public void testWait() throws Exception { 
+        System.out.println("Feed aggregator server started (press enter to shutdown)");
+        System.in.read();
+        System.out.println("Feed aggregator server stopped");
     }
 
+ 
+    public void testGetAllNewAlerts() throws Exception {   
+        JSONObject jsonRequest = new JSONObject("{\"params\":[\"sometext\"],\"method\":\"getAllNewAlerts\",\"id\":2}");
+        JSONObject jsonResp    = callService ("http://localhost:8080/AlertsServiceJSONRPC",
+                                              jsonRequest);                                  
+    }    
+    
+    public void testAddAlertSources() throws Exception {   
+        JSONObject jsonRequest = new JSONObject("{\"params\":[{\"name\":\"news\",\"id\":\"2\",\"address\":\"www.news.com\",\"feedAddress\":\"http://news.com.com/2547-1_3-0-20.xml\",\"feedType\":\"rss\",\"lastChecked\":\"lastChecked\",\"javaClass\":\"org.apache.tuscany.sca.samples.aggregator.types.impl.SourceTypeImpl\"}],\"method\":\"addAlertSource\",\"id\":2}");
+        JSONObject jsonResp    = callService ("http://localhost:8080/AlertsSourcesServiceJSONRPC",
+                                              jsonRequest);  
+    }
+    */ 
+    public void testGetAlertSources() throws Exception {   
+        JSONObject jsonRequest = new JSONObject("{\"params\":[\"sometext\"],\"method\":\"getAlertSources\",\"id\":2}");
+        JSONObject jsonResp    = callService ("http://localhost:8080/AlertsSourcesServiceJSONRPC",
+                                              jsonRequest);                                 
+        assertEquals("BBC News", jsonResp.getJSONObject("result").getJSONObject("source").optJSONArray("list").getJSONObject(0).getString("name")); 
+    }    
+  
+    public JSONObject callService(String url, JSONObject jsonRequest) throws Exception {
+        System.out.println("Request = " + jsonRequest.toString());
+        WebConversation wc   = new WebConversation();
+        WebRequest request   = new PostMethodWebRequest( url, 
+                                                         new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")),"application/json");
+        WebResponse response = wc.getResource(request);
+        System.out.println("Response= " + response.getText());               
+        assertEquals(200, response.getResponseCode());
+        return new JSONObject(response.getText()); 
+    }
+  
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org