Author: jonathan
Date: Thu Feb  7 16:34:46 2008
New Revision: 13414

Log:

Redid interface to allow more to show on one page.

Added:
   
trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.resources/www/index.html
   
trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.resources/www/tomato-tube.css
   
trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.resources/www/tomatotube.jpg
   (contents, props changed)
Modified:
   trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.js

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  Thu Feb  7 
16:34:46 2008
@@ -26,8 +26,8 @@
                      "services and the File host object.</p>";
 
 
-readTomatoTubeFeed.documentation = "Obtains the top rated, movies in theaters 
and dvd from rottentomatoes.com " +
-                                   "and embeds a You Tube trailer to the feed, 
creating a mashed up feed. " + "" +
+readTomatoTubeFeed.documentation = "Obtains the top rated movies in theaters 
and on dvd from rottentomatoes.com " +
+                                   "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.inputTypes = { "mode" : "string" };
@@ -102,7 +102,7 @@
         mashupFeed.title = "TomatoTube - A Mashup of Rotten Tomatoes and 
YouTube";
         mashupFeed.description = "The Top 20 tomato rated movies in theaters.";
         mashupFeed.link = "hosted-" + mode + "-mashup-feed.xml";
-
+         
         if (feedEntries.length > 0) {
             //Processing only the Top 10 results
             for (var x = 0; x < 10; x++) {
@@ -126,10 +126,10 @@
                     if (!(trailerLink == "Not Found...")) {
                         //Converting the link to an Embeddable You Tube video
                         var embedLink = convertLinkToEmbed(trailerLink);
-
+                        
                         //Attaching the Embeddable Link to the entry 
description
                         var description = feedEntries[x].description
-                        description = description + "<br><br>Here's a teaser 
from YouTube;<br><br>" + embedLink;
+                        description = "<div class='teasertext'>Here's a teaser 
from YouTube:</div><div class='teaser'>" + embedLink + "</div><div 
class='description'>" + description + "</div>";
 
                         //Wrapping with CDATA tags for transport
                         description = description;

Added: 
trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.resources/www/index.html
==============================================================================
--- (empty file)
+++ 
trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.resources/www/index.html
    Thu Feb  7 16:34:46 2008
@@ -0,0 +1,123 @@
+<!--
+  ~ Copyright 2007 WSO2, Inc. (http://wso2.com)
+  ~
+  ~ Licensed 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.
+  -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+
+    <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
+    <title>Welcome to TomatoTube</title>
+
+    <link rel="stylesheet" type="text/css" href="tomato-tube.css">
+
+    <script type="text/javascript" src="/js/wso2/WSRequest.js"></script>
+    <script type="text/javascript" src="../tomatoTube?stub"></script>
+    <script type="text/javascript" language="javascript">
+
+        function getData() {
+            //Displaying the loading animation
+            var contentDiv = document.getElementById("content");
+            contentDiv.innerHTML = "<img src='../../../images/loading.gif'/>   
  Gathering reviews and trailers. Please wait ...";
+
+            var mode = document.getElementById("mode").value;
+
+            tomatoTube.readTomatoTubeFeed.onError = handleError;
+            tomatoTube.readTomatoTubeFeed.callback = function (userdata) {
+                fillData(userdata);
+            }
+            tomatoTube.readTomatoTubeFeed(mode);
+        }
+
+        function handleError(error) {
+            alert("An Error occured: " + error.reason);
+        }
+
+        function fillData(userdata)
+        {
+            //writing RSS feed subscription info
+            var rssLink = 
userdata.getElementsByTagName("link")[0].firstChild.nodeValue;
+            var rssInfoDiv = document.getElementById("rss_links");
+            rssInfoDiv.innerHTML = '<p class="rss"><a 
type="application/rss+xml" rel="alternate" title="Subscribe to the RSS 2.0 feed 
of this result" href="' +
+                                   rssLink + '"><img style="border: 0pt none ; 
width: 20px; height: 20px;" alt="" src="rss_button.png"/></a> Subscribe to the 
RSS 2.0 feed of this result </p>';
+            //Getting all the entries
+            var entries = userdata.getElementsByTagName("item");
+            var contentDiv = document.getElementById("content");
+            contentDiv.innerHTML = "";
+            for (var x = 0; x < entries.length; x++) {
+                var entry = entries[x];
+                var entryContentDiv = document.createElement("div");
+                var titleContent = 
entry.getElementsByTagName("title")[0].firstChild.nodeValue;
+                var rottenLink = 
entry.getElementsByTagName("link")[0].firstChild.nodeValue;
+                var description = 
removeCDATA(entry.getElementsByTagName("description")[0].firstChild.nodeValue);
+                entryContentDiv.innerHTML = "<div class='item'><h2>#" + (x + 
1) + ": " + titleContent + "</h2>"+
+                                            "<p>" + description + "</p><p><a 
href='" + rottenLink + "' target='_blank'> Read the reviews at Rotten Tomatoes 
</a>" +
+                                            "</p></div>";
+                contentDiv.appendChild(entryContentDiv);
+            }
+        }
+
+        function removeCDATA(candidateString) {
+            //Verify whether this is a CDATA string
+            if (candidateString.substring(0, 9) == "<![CDATA[") {
+                //Removing <![CDATA[
+                candidateString = candidateString.substring(9, 
candidateString.length);
+                //Removing ]]>
+                candidateString = candidateString.substring(0, 
candidateString.length - 3);
+            } else if (candidateString.substring(0, 12) == "&lt;![CDATA[") {
+                //Removing &lt;![CDATA[
+                candidateString = candidateString.substring(12, 
candidateString.length);
+                //Removing ]]&lt;
+                candidateString = candidateString.substring(0, 
candidateString.length - 6);
+            }
+            return candidateString;
+        }
+    </script>
+</head>
+<body>
+<div id="page">
+<div id="intro">
+    <div class="intro">
+        <img src="tomatotube.jpg" style="float:left; padding-right:1em"/>
+        <div class="welcome">Welcome to TomatoTube</div>
+        Bringing you the top 10 rated movies in theaters and released on DVDs 
this week as reviewed by
+        <a href='http://www.rottentomatoes.com' target='_blank'>Rotten 
Tomatoes</a>, complete with by their
+        teasers/trailers
+        from <a href='http://www.youtube.com' target='_blank'>YouTube</a>.
+
+    </div>
+    <br/>
+    <div class="intro">Powered
+    by the <a href='http://wso2.org/projects/mashup' target='_blank'>WSO2 
Mashup Server</a>.</div>
+
+</div>
+<hr/>
+<div style="padding-top:10px; clear:both"><label for="mode">Choose query: 
</label>
+    <select id="mode">
+        <option value="theater">Get Top 10 in Theaters</option>
+        <option value="dvd">Get Top 10 DVD releases</option>
+    </select>
+    <input type="button" value="Get data" onclick="getData();"/>
+</div>
+
+<div id="rss_links" class="rssinfo"></div>
+
+<div id="content" class="contents"></div>
+
+<div id="footer"><p class="footer">Copyright 2007 <a 
href='http://www.wso2.com' target='_blank'>WSO2</a></p></div>
+
+</div>
+</body>
+</html>

Added: 
trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.resources/www/tomato-tube.css
==============================================================================
--- (empty file)
+++ 
trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.resources/www/tomato-tube.css
       Thu Feb  7 16:34:46 2008
@@ -0,0 +1,152 @@
+/*
+
+ Copyright 2005-2007 WSO2, Inc. http://www.wso2.org
+
+ Licensed 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.
+
+ Created 2007 Tyrell Perera; [EMAIL PROTECTED]
+
+*/
+
+body {
+    padding: 0;
+    margin: 0;
+    background-color: #666;
+    color: #000;
+    text-align: center;
+    font-family: sans-serif;
+}
+
+div#page {
+    margin:2em auto;
+    padding:2em;
+    width:800px;
+    text-align:left;
+    background-color:white;
+    min-height:400px;
+}
+
+.welcome {
+    font-size:200%;
+    padding-bottom: 10px;
+}
+.contents {
+    text-align: left;
+}
+
+.rssinfo {
+    margin-top: 10px;
+    margin-bottom: 10px;
+    margin-right: auto;
+    margin-left: auto;
+    width: 650px;
+    padding: 10px;
+    background-color: transparent;
+    color: #000;
+    text-align: left;
+}
+
+h1 {
+    color: #333;
+    background-color: transparent;
+    font-family: Arial, Helvetica, sans-serif;
+    font-size: 20px;
+}
+
+p {
+    color: #333;
+    background-color: transparent;
+    font-family: Arial, Helvetica, sans-serif;
+    font-size: 0.8em;
+}
+
+p.intro {
+    font-family: sans-serif;
+    font-style: oblique;
+    font-variant: normal;
+    font-weight: bolder;
+    font-size: larger;
+    line-height: 1em;
+    word-spacing: normal;
+    letter-spacing: normal;
+    text-decoration: none;
+    text-transform: none;
+    text-align: center;
+    text-indent: 0ex;
+}
+
+p.sub {
+    font-family: sans-serif;
+    font-style: italic;
+    font-variant: normal;
+    font-weight: normal;
+    font-size: small;
+    line-height: 1em;
+    word-spacing: normal;
+    letter-spacing: normal;
+    text-decoration: none;
+    text-transform: none;
+    text-align: center;
+    text-indent: 0ex;
+}
+
+p.rss {
+    font-style: italic;
+    line-height: 1em;
+    word-spacing: normal;
+    letter-spacing: normal;
+    text-align: right;
+    margin:0;
+}
+
+p.footer {
+    clear:both;
+    font-variant: normal;
+    font-weight: bold;
+    line-height: 100%;
+    word-spacing: normal;
+    letter-spacing: normal;
+    text-decoration: none;
+    text-align: center;
+    text-indent: 0ex;
+}
+
+div.item {
+    clear:both;
+}
+
+h2 {
+       line-height: 150%;
+}
+
+div.teaser {
+    float:left;
+    width: 500px;
+    height: 370px;
+    margin-bottom:2em;
+
+}
+
+div.teaser object, div.teaser object embed {
+    width: 500px;
+    height: 370px;
+}
+
+
+div.teasertext {
+    display:none
+}
+
+div.description {
+    font-size:100%;
+}
\ No newline at end of file

Added: 
trunk/mashup/java/modules/samples/tomatoTube/tomatoTube.resources/www/tomatotube.jpg
==============================================================================
Binary file. No diff available.

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to