Author: rgardler
Date: Thu Oct 27 16:50:10 2011
New Revision: 1189866

URL: http://svn.apache.org/viewvc?rev=1189866&view=rev
Log:
Make the template display a tweet rather than the more obscure myExperiment 
workflow.

Modified:
    
incubator/wookie/trunk/widgets/templates/itemDetail/default.widget.properties
    incubator/wookie/trunk/widgets/templates/itemDetail/detail2html.xsl
    incubator/wookie/trunk/widgets/templates/itemDetail/style/screen.css.add

Modified: 
incubator/wookie/trunk/widgets/templates/itemDetail/default.widget.properties
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/itemDetail/default.widget.properties?rev=1189866&r1=1189865&r2=1189866&view=diff
==============================================================================
--- 
incubator/wookie/trunk/widgets/templates/itemDetail/default.widget.properties 
(original)
+++ 
incubator/wookie/trunk/widgets/templates/itemDetail/default.widget.properties 
Thu Oct 27 16:50:10 2011
@@ -1,11 +1,11 @@
 # The URL for retrieving the item detals in XML format.
 # 
 # Variables: itemId is the id of the item to be displayed
-itemDetail.get.url="http://www.myexperiment.org/workflow.xml?id="; + itemId + 
"&elements=title,description,type,uploader,created-at,updated-at,thumbnail-big,license-type,tags,versions,ratings,statistics"
+itemDetail.get.url="http://api.twitter.com/1/statuses/show.xml?id="; + itemId + 
"&include_entities=false"
 
 # The initial itemID to use if none has been set.
 # This value will be overwritten by calling 
Widget.preferences.getItem("itemId");
-itemDetail.default.itemId=173
+itemDetail.default.itemId=129284508087357440
 
 # The XSL to transform the detail XML (from itemDetail.get.url) to HTML
 itemDetail.xsl.url="detail2html.xsl"
\ No newline at end of file

Modified: incubator/wookie/trunk/widgets/templates/itemDetail/detail2html.xsl
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/itemDetail/detail2html.xsl?rev=1189866&r1=1189865&r2=1189866&view=diff
==============================================================================
--- incubator/wookie/trunk/widgets/templates/itemDetail/detail2html.xsl 
(original)
+++ incubator/wookie/trunk/widgets/templates/itemDetail/detail2html.xsl Thu Oct 
27 16:50:10 2011
@@ -1,148 +1,140 @@
 <!-- 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. -->
+    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. -->
 <xsl:stylesheet version="1.0"
-       xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
 
-       <xsl:template match="/">
-               <xsl:apply-templates />
-       </xsl:template>
-
-       <xsl:template match="workflow">
-               <div class="workflow">
-                       <div class="overview">
-                               <xsl:apply-templates select="thumbnail-big" />
-                               <div class="meta-data">
-                                       <xsl:apply-templates select="title" />
-                                       <xsl:apply-templates select="uploader" 
/>
-                                       <div class="update-rating">
-                                               <xsl:apply-templates 
select="updated-at" />
-                                               <xsl:apply-templates 
select="ratings" />
-                                       </div>
-                                       <div class="version-info">
-                                               <xsl:apply-templates 
select="versions" />
-                                               <xsl:apply-templates 
select="type" />
-                                               <xsl:apply-templates 
select="license-type" />
-                                       </div>
-                               </div>
-                               <xsl:apply-templates select="description" />
-                       </div>
-
-                       <div class="clear">
-                               <div class="boxed">
-                                       <xsl:apply-templates 
select="created-at" />
-                                       <xsl:apply-templates 
select="statistics" />
-                               </div>
-                               <div class="boxed">
-                                       <xsl:apply-templates select="tags" />
-                                       <p>FIXME: Groups should be here</p>
-                               </div>
-                       </div>
-               </div>
-       </xsl:template>
-
-       <xsl:template match="title">
-               <h3>
-                       <xsl:value-of select="." />
-               </h3>
-       </xsl:template>
-
-       <xsl:template match="ratings">
-               <div class="rating">
-                       Rating:
-                       <xsl:value-of select="sum(rating) div count(rating)" />
-               </div>
-       </xsl:template>
-
-       <xsl:template match="type">
-               <p>
-                       Type:
-                       <xsl:value-of select="." />
-               </p>
-       </xsl:template>
-
-       <xsl:template match="license-type">
-               <p>
-                       License:
-                       <xsl:value-of select="." />
-               </p>
-       </xsl:template>
-
-       <xsl:template match="versions">
-               <p>
-                       Version:
-                       <xsl:for-each select="workflow[last()]">
-                               <xsl:number count="*"/>
-                       </xsl:for-each>
-               </p>
-       </xsl:template>
-
-       <xsl:template match="uploader">
-               <p>
-                       Uploaded By:
-                       <xsl:value-of select="." />
-               </p>
-       </xsl:template>
-
-       <xsl:template match="thumbnail-big">
-
-               <div class="thumbnail">
-                       <img width="241">
-                               <xsl:attribute name="src"><xsl:value-of 
select="." /></xsl:attribute>
-                               <xsl:attribute name="alt">Preview of the 
<xsl:value-of
-                                       select="../title" /> 
workflow.</xsl:attribute>
-                       </img>
-               </div>
-       </xsl:template>
-
-       <xsl:template match="updated-at">
-               <p>
-                       Last Updated:
-                       <xsl:value-of select="." />
-               </p>
-       </xsl:template>
-
-       <xsl:template match="created-at">
-               <p>
-                       Created:
-                       <xsl:value-of select="." />
-               </p>
-       </xsl:template>
-
-       <xsl:template match="description">
-               <div class="description">
-                       <xsl:value-of select="." />
-               </div>
-       </xsl:template>
-
-       <xsl:template match="statistics">
-               <p>
-                       Viewed:
-                       <xsl:value-of select="viewings/total" />
-               </p>
-               <p>
-                       Downloaded:
-                       <xsl:value-of select="downloads/total" />
-               </p>
-       </xsl:template>
-
-       <xsl:template match="tags">
-               <p>
-                       Tags:
-            <xsl:for-each select="tag">
-                <xsl:value-of select="." />
-                <xsl:if test="position() != last()">
-                    <xsl:text>, </xsl:text>
-                </xsl:if>
-            </xsl:for-each>
-               </p>
-       </xsl:template>
+    <xsl:output method="html" indent="yes" />
 
+    <xsl:template match="/">
+        <xsl:apply-templates />
+    </xsl:template>
+
+    <xsl:template match="status">
+        <div class="tweet">
+            <div class="overview">
+                <div class="quote">
+                    <xsl:value-of select="text" />
+                </div>
+            </div>
+            <div class="meta-data">
+                <div class="clear">
+                    <xsl:apply-templates select="user"
+                        mode="summary" />
+                    <xsl:apply-templates select="in_reply_to_screen_name" />
+                    <xsl:apply-templates select="created_at" />
+                    <xsl:apply-templates select="source" />
+                </div>
+                <div class="clear">
+                    <xsl:apply-templates select="retweet_count" />
+                </div>
+            </div>
+            <xsl:apply-templates select="user" mode="detail" />
+        </div>
+    </xsl:template>
+
+    <xsl:template match="hashtags">
+        <span class="type">
+            <xslfor-each select="hashtag">
+                <xsl:value-of select="hashtag" />
+            </xslfor-each>
+        </span>
+    </xsl:template>
+
+    <xsl:template match="user" mode="summary">
+        <xsl:value-of select="name" />
+        (
+        <xsl:value-of select="screen_name" />
+        ) from
+        <xsl:value-of select="location" />
+    </xsl:template>
+
+    <xsl:template match="user" mode="detail">
+        <div class="user clear">
+            <h3>
+                About
+                <xsl:value-of select="name" />
+            </h3>
+            <xsl:apply-templates select="profile_image_url" />
+            <p>
+                <xsl:value-of select="name" />
+                uses the screen name
+                <xsl:value-of select="screen_name" />
+                <xsl:text>, and is based in</xsl:text>
+                <xsl:value-of select="location" />
+            </p>
+            <p>
+                <xsl:text>They describe themselves as '</xsl:text>
+                <xsl:value-of select="description" />
+                <xsl:text>' They provide more information about themselves 
at</xsl:text>
+                <a>
+                    <xsl:atrribute name="href">
+                        <xsl:value-of select="url" />
+                    </xsl:atrribute>
+                    <xsl:value-of select="url" />
+                </a>
+            </p>
+            <p>
+                They have
+                <xsl:value-of select="followers_count" />
+                followers, are listed in
+                <xsl:value-of select="listed_count" />
+                lists and follow
+                <xsl:value-of select="friends_count" />
+                <xsl:text> people. They have tweeted </xsl:text>
+                <xsl:value-of select="statuses_count" />
+                times.
+            </p>
+        </div>
+    </xsl:template>
+
+    <xsl:template match="in_reply_to_screen_name">
+        <xsl:if test="text()">
+            in reply to
+            <xsl:value-of select="name" />
+            (
+            <xsl:value-of select="screen_name" />
+            )
+        </xsl:if>
+    </xsl:template>
+
+    <xsl:template match="retweet_count">
+        <xsl:choose>
+            <xsl:when test="text() = 0">
+                Never retweeted.
+            </xsl:when>
+            <xsl:otherwise>
+                Retweeted
+                <xsl:value-of select="." />
+                times.
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+
+    <xsl:template match="profile_image_url">
+        <div class="thumbnail">
+            <img alt="Avatar for tweet author">
+                <xsl:attribute name="src"><xsl:value-of
+                    select="." /></xsl:attribute>
+            </img>
+        </div>
+    </xsl:template>
+
+    <xsl:template match="created_at">
+        at
+        <xsl:value-of select="." />
+    </xsl:template>
+
+    <xsl:template match="source">
+        (using
+        <xsl:value-of select="." disable-output-escaping="yes" />
+        )
+    </xsl:template>
 </xsl:stylesheet>

Modified: 
incubator/wookie/trunk/widgets/templates/itemDetail/style/screen.css.add
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/itemDetail/style/screen.css.add?rev=1189866&r1=1189865&r2=1189866&view=diff
==============================================================================
--- incubator/wookie/trunk/widgets/templates/itemDetail/style/screen.css.add 
(original)
+++ incubator/wookie/trunk/widgets/templates/itemDetail/style/screen.css.add 
Thu Oct 27 16:50:10 2011
@@ -14,39 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- /**
- * Summary information for a results browser
- */
 
 .thumbnail {
-  float:left;
-}
-
-.update {
   float: left;
 }
 
-.rating {
-  float: right;
-}
-
-.update_rating {
-  width: 100%;
+.quote {
+  font-style:italic;
 }
 
-.clearer {
-  clear: right;
-}
-
-.version-info {
+.meta-data {
+  font-size: 85%;
 }
 
 .clear {
-  clear:both;
-}
-
-.boxed {
-  border-style:solid;
-  border-color:gray;
-  border-width:1px;
+  clear: both;
 }
\ No newline at end of file


Reply via email to