Author: jonathan
Date: Tue Apr 1 17:32:59 2008
New Revision: 15451
Log:
Added .safe annotations wherever appropriate.
Modified:
trunk/mashup/java/modules/samples/digit2image/digit2image.js
trunk/mashup/java/modules/samples/exchangeRate/exchangeRate.js
trunk/mashup/java/modules/samples/formulaFlicks/formulaFlicks.js
trunk/mashup/java/modules/samples/sudoku/sudoku.js
trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.js
trunk/mashup/java/modules/samples/upgradeChecker/upgradeChecker.js
trunk/mashup/java/modules/samples/yahooGeoCode/yahooGeoCode.js
Modified: trunk/mashup/java/modules/samples/digit2image/digit2image.js
==============================================================================
--- trunk/mashup/java/modules/samples/digit2image/digit2image.js
(original)
+++ trunk/mashup/java/modules/samples/digit2image/digit2image.js Tue Apr
1 17:32:59 2008
@@ -41,8 +41,10 @@
</ul>
Except for "original" size, which returns the original format, all links
are to JPEGs.
</div>;
+digit2image.safe = true;
digit2image.inputTypes = {"digit" : "0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9",
"size" : "small | thumbnail | medium | normal | big | original"}; // MASHUP-303
"small | thumbnail | medium | normal | big | original"
digit2image.outputType = "xs:anyURI";
+
function digit2image(digit,size) {
var ns = new Namespace("http://services.wsaw.wso2.org/demo?xsd");
Modified: trunk/mashup/java/modules/samples/exchangeRate/exchangeRate.js
==============================================================================
--- trunk/mashup/java/modules/samples/exchangeRate/exchangeRate.js
(original)
+++ trunk/mashup/java/modules/samples/exchangeRate/exchangeRate.js Tue Apr
1 17:32:59 2008
@@ -28,8 +28,10 @@
<a href="http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=18"
target="_blank">here</a>.
<p>Note : The currency codes are case sensitive.</p>
</div>;
+convert.safe = true;
convert.inputTypes = { "fromCurrency" : "string", "toCurrency" : "string" };
convert.outputType = "string";
+
function convert(fromCurrency, toCurrency) {
if (fromCurrency == "")
Modified: trunk/mashup/java/modules/samples/formulaFlicks/formulaFlicks.js
==============================================================================
--- trunk/mashup/java/modules/samples/formulaFlicks/formulaFlicks.js
(original)
+++ trunk/mashup/java/modules/samples/formulaFlicks/formulaFlicks.js Tue Apr
1 17:32:59 2008
@@ -18,9 +18,11 @@
this.documentation =
<div>The <b>formulaFlicks</b> service exposes methods that will help a fan
of Formula 1 racing fan stay updated on the latest racing event with minimal
effort.</div>;
-videoList.documentation =
+videoList.safe = true;
+videoList.documentation =
<div>Returns a list of the most recently published youTube videos of the
last concluded race.</div>;
videoList.outputType = "xml";
+
function videoList() {
var response = <videos />;
var searchString;
@@ -68,9 +70,11 @@
}
-raceNewsRss.documentation =
+raceNewsRss.safe = true;
+raceNewsRss.documentation =
<div>Retrieves information from the formula1.com RSS feed.</div>;
raceNewsRss.outputType = "string";
+
function raceNewsRss() {
// Feed URI and keywords for races and testing.
var f1InfoFeed = "http://www.formula1.com/rss/news/headlines.rss";
@@ -112,8 +116,10 @@
currentRace.documentation =
<div>Scrapes the last element of a given list of similarly formatted
strings. Input should be CSS class used to format list items.</div>;
-currentRace.inputTypes = { "targetStyle" : "string" };
+currentRace.safe = true;
+currentRace.inputTypes = { "targetStyle" : "string" };
currentRace.outputType = "string";
+
function currentRace(targetStyle) {
var config =
<config>
Modified: trunk/mashup/java/modules/samples/sudoku/sudoku.js
==============================================================================
--- trunk/mashup/java/modules/samples/sudoku/sudoku.js (original)
+++ trunk/mashup/java/modules/samples/sudoku/sudoku.js Tue Apr 1 17:32:59 2008
@@ -118,8 +118,10 @@
<difficulty>trivial | easy | <b>medium</b> | difficult |
expert</difficulty> ?
<symmetrical><b>true</b> | false</symmetrical> ?
</options> ?</pre></div>;
+newpuzzle.safe = true;
newpuzzle.inputTypes = {"options" : "xml?"};
newpuzzle.outputType = "xml";
+
function newpuzzle(options) {
var i, j; //generic indices
var rating, symmetrical;
@@ -356,8 +358,10 @@
<pre><options>
<<i>option-name</i> default="<i>default-value</i>"><i>list of
acceptable values</i></<i>option-name</i>> *
</options></pre></div>;
+options.safe = true;
options.inputTypes = {};
options.outputType = "any";
+
function options() {
return <options>
<symmetrical default="true">true false</symmetrical>
Modified: trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.js
==============================================================================
--- trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.js (original)
+++ trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.js Tue Apr 1
17:32:59 2008
@@ -30,8 +30,10 @@
"and embeds a YouTube trailer to the feed,
creating a mashed up feed. " + "" +
"The current expected inputs are 'theater'
and 'dvd'. " +
"The mashed up feed is written to a file in
the workspace directory";
+readTomatoTubeFeed.safe = true;
readTomatoTubeFeed.inputTypes = { "mode" : "string" };
readTomatoTubeFeed.outputType = "xml";
+
function readTomatoTubeFeed(mode) {
//Checking for supported input types
@@ -186,8 +188,10 @@
findTrailer.documentation = "Uses the YouTube GData API to search for the
trailer of a given movie.";
+findTrailer.safe = true;
findTrailer.inputTypes = { "moviename" : "string" };
findTrailer.outputType = "String";
+
function findTrailer(moviename)
{
//Creating the query string we are using RSS 2.0 to retrieve a list of
trailers.
Modified: trunk/mashup/java/modules/samples/upgradeChecker/upgradeChecker.js
==============================================================================
--- trunk/mashup/java/modules/samples/upgradeChecker/upgradeChecker.js
(original)
+++ trunk/mashup/java/modules/samples/upgradeChecker/upgradeChecker.js Tue Apr
1 17:32:59 2008
@@ -37,8 +37,10 @@
getRecommendation.documentation = <div>Returns a structured object
representing the current, nightly, and released builds.</div>;
+getRecommendation.safe = true;
getRecommendation.inputTypes = {};
getRecommendation.outputType = "object";
+
function getRecommendation() {
// Fetch information about the currently running version of the Mashup
Server
var userBuildDate = version.buildDate();
@@ -103,8 +105,10 @@
getRecommendationXML.documentation = <div>Returns XML with similar structure
to the getRecommendation object.</div>;
+getRecommendationXML.safe = true;
getRecommendationXML.inputTypes = {};
getRecommendationXML.outputType = "#raw";
+
function getRecommendationXML() {
var build = getRecommendation();
return <build product={build.product}>
@@ -167,8 +171,10 @@
testXML.documentation = <div>Simulates various scenarios for UI testing
purposes.</div>;
+testXML.safe = true;
testXML.inputTypes = {"id" : "release-new-nightly | release-no-nightly |
old-release-new-nightly | old-release-no-nightly"};
testXML.outputType = "xml";
+
function testXML(id) {
// running 0.2 release, newer nightly
if (id == "release-new-nightly")
Modified: trunk/mashup/java/modules/samples/yahooGeoCode/yahooGeoCode.js
==============================================================================
--- trunk/mashup/java/modules/samples/yahooGeoCode/yahooGeoCode.js
(original)
+++ trunk/mashup/java/modules/samples/yahooGeoCode/yahooGeoCode.js Tue Apr
1 17:32:59 2008
@@ -18,20 +18,22 @@
Yahoo! Maps Web Services - Geocoding API.</a></div> ;
geocode.documentation = "Given an address returns a specific latitude and
longitude" ;
+geocode.safe = true;
geocode.inputTypes = {
"street" : "string" ,
"city" : "string",
"state" : "AL | AK | AZ | AR | CA | CO | CT | DC | DE | FL | GA | HI | ID
| IL | IN | IA | KS | KY | LA | ME | MD | MA | MI | MN | MS | MO | MT | NE | NV
| NH | NJ | NM | NY | NC | ND | OH | OK | OR | PA | RC | SC | SD | TN | TX | UT
| VT | VA | WA | WV | WI | WY" };
geocode.outputType = "xml";
+
function geocode(street, city, state)
{
-var yahoo = new WSRequest();
-var options = new Array();
-options["useSOAP"] = "false";
-options["HTTPMethod"] = "get";
+ var yahoo = new WSRequest();
+ var options = new Array();
+ options["useSOAP"] = "false";
+ options["HTTPMethod"] = "get";
-yahoo.open(options, "http://local.yahooapis.com/MapsService/V1/geocode",
false);
-var request = "<parameters><appid>YahooDemo</appid><street>" + street +
"</street><city>" + city + "</city><state>" + state + "</state></parameters>";
-yahoo.send(request);
-return yahoo.responseXML;
+ yahoo.open(options, "http://local.yahooapis.com/MapsService/V1/geocode",
false);
+ var request = "<parameters><appid>YahooDemo</appid><street>" + street +
"</street><city>" + city + "</city><state>" + state + "</state></parameters>";
+ yahoo.send(request);
+ return yahoo.responseXML;
}
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev