forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r1004623 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes: common/html/ pelt/html/
Date Tue, 05 Oct 2010 12:41:50 GMT
Author: thorsten
Date: Tue Oct  5 12:41:49 2010
New Revision: 1004623

URL: http://svn.apache.org/viewvc?rev=1004623&view=rev
Log:
Adding more social network contracts and updating google one to the newest version

Added:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/facebook-like.contract.xml
  (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/twitter.contract.xml
  (with props)
Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/google-analytics.contract.xml
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/facebook-like.contract.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/facebook-like.contract.xml?rev=1004623&view=auto
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/facebook-like.contract.xml
(added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/facebook-like.contract.xml
Tue Oct  5 12:41:49 2010
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<forrest:contract xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+xmlns:forrest="http://apache.org/forrest/templates/1.0" name="facebook-like">
+  <description>
+    <p>Note: This contract assumes that you have following properties set</p>
+    <ul>
+      <li>dispatcher.allowXmlProperties=false</li>
+      <li>dispatcher.shrink=true</li>
+    </ul>
+    <p>If you do not have this properties you need to use the traditional way to 
+    retrieve the properties via <![CDATA[<xsl:param name="defaultVariables" select="'test.html'"/>]]>.</p>
+    <p>This is the facebook-like contract, it will output the Facebook Like button,
which
+      enables users to post pages from your site back to their Fthe Like button, which enables
+      users to post pages from your site back to their Facebook profile with one click.</p>
+  </description>
+  <usage>
+    <![CDATA[<forrest:contract name="facebook-like">
+  <forrest:property name="facebook-like-url" value="${urlToLike}" />
+  <forrest:property name="facebook-like-width" value="${facebook-like-width}" />
+  <forrest:property name="facebook-like-height" value="${facebook-like-height}" />
+</forrest:contract>]]>
+</usage>
+  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+  name="facebook-like" inputFormat="xsl">
+    <xsl:stylesheet version="1.1"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+      <xsl:param name="facebook-like-url" select="'http://www.codebusters.es/'"/>
+      <xsl:param name="facebook-like-width" select="'450px'"/>
+      <xsl:param name="facebook-like-height" select="'80px'"/>
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part>
+            <iframe
+              src="http://www.facebook.com/widgets/like.php?href={$facebook-like-url}"
+              scrolling="no" frameborder="0"
+              style="border:none; width:{$facebook-like-width}; height:{$facebook-like-height}">&#160;</iframe>
+          </forrest:part>
+        </forrest:content>
+      </xsl:template>
+    </xsl:stylesheet>
+  </forrest:template>
+</forrest:contract>

Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/facebook-like.contract.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/google-analytics.contract.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/google-analytics.contract.xml?rev=1004623&r1=1004622&r2=1004623&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/google-analytics.contract.xml
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/google-analytics.contract.xml
Tue Oct  5 12:41:49 2010
@@ -1,49 +1,66 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-    
-    http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
+  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.
 -->
 <forrest:contract xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
-xmlns:forrest="http://apache.org/forrest/templates/1.0"
-name="google-analytics">
+xmlns:forrest="http://apache.org/forrest/templates/1.0" name="google-analytics">
   <description>
-    <p>Embeds the necessary Javascript to allow Google Analytics to track
-    website visitors.</p>
+    <p>Note: This contract assumes that you have following properties set</p>
+    <ul>
+      <li>dispatcher.allowXmlProperties=false</li>
+      <li>dispatcher.shrink=true</li>
+    </ul>
+    <p>If you do not have this properties you need to use the traditional way to 
+    retrieve the properties via <![CDATA[<xsl:param name="defaultVariables" select="'test.html'"/>]]>.</p>
+    <p>This is the Google Analytics tracking contract. Google Analytics lets you measure
+      your advertising ROI as well as track your Flash, video, and social networking sites
and
+      applications.</p>
+    <p>If you use the domain parameter all subdomains as well will be tracked.</p>
   </description>
-  <usage>Place the following code at the end of your page body, i.e. just
-  before the &lt;/body&gt; tag. 
-<![CDATA[
-<forrest:contract name="google-analytics">
-  <forrest:property name="google-analytics-uacct">GOOGLE_ANALYTICS_KEY</forrest:propery>
-</forrest:contract> ]]>
+  <usage>
+    <![CDATA[<forrest:contract name="google-analytics">
+  <forrest:property name="google-analytics-account" value="${google-analytics-account}"
/>
+  [<forrest:property name="google-analytics-domain" value="${google-analytics-domain}"
/>]
+</forrest:contract>]]>
 </usage>
   <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
   name="google-analytics" inputFormat="xsl">
     <xsl:stylesheet version="1.1"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:forrest="http://apache.org/forrest/templates/1.0">
-      <xsl:param name="google-analytics-uacct" />
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+      <xsl:param name="google-analytics-account" select="'none'"/>
+      <xsl:param name="google-analytics-domain" select="'none'"/>
       <xsl:template match="/">
         <forrest:content>
-          <forrest:part xpath="/html/body">
-            <script src="http://www.google-analytics.com/urchin.js"
-            type="text/javascript"></script>
-            <script type="text/javascript">_uacct = " 
-            <xsl:value-of select='$google-analytics-uacct' />";
-            urchinTracker();</script>
-          </forrest:part>
+          <forrest:part xpath="/html/head">
+            <script type="text/javascript">
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', '<xsl:value-of select="$google-analytics-account"/>']);
+  <xsl:if test="not($google-analytics-domain='none')">
+    _gaq.push(['_setDomainName', '<xsl:value-of select="$google-analytics-domain"/>']);
+  </xsl:if>
+  _gaq.push(['_trackPageview']);
+
+  (function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();
+
+</script>
+</forrest:part>
         </forrest:content>
       </xsl:template>
     </xsl:stylesheet>

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/twitter.contract.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/twitter.contract.xml?rev=1004623&view=auto
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/twitter.contract.xml
(added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/twitter.contract.xml
Tue Oct  5 12:41:49 2010
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<forrest:contract xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+xmlns:forrest="http://apache.org/forrest/templates/1.0" name="twitter">
+  <description>
+    <p>Note: This contract assumes that you have following properties set</p>
+    <ul>
+      <li>dispatcher.allowXmlProperties=false</li>
+      <li>dispatcher.shrink=true</li>
+    </ul>
+    <p>If you do not have this properties you need to use the traditional way to 
+    retrieve the properties via <![CDATA[<xsl:param name="defaultVariables" select="'test.html'"/>]]>.</p>
+    <p>This is just a twitter contract, it will output something but *nothing*
+    in special. It should just serve to explain a wee bit contracts and what
+    you can do with them.</p>
+  </description>
+  <usage>
+    <![CDATA[<forrest:contract name="twitter">
+  <forrest:property name="twitter-feed-features-user" value="'cazacodigos'"/>
+  <forrest:property name="twitter-feed-features-behavior" value="'all'"/>
+  <forrest:property name="twitter-feed-features-avatars" value="'false'"/>
+  <forrest:property name="twitter-feed-features-timestamp" value="'true'"/>
+  <forrest:property name="twitter-feed-features-hashtags" value="'true'"/>
+  <forrest:property name="twitter-feed-features-live" value="'false'"/>
+  <forrest:property name="twitter-feed-features-loop" value="'false'"/>
+  <forrest:property name="twitter-feed-features-scrollbar" value="'false'"/>
+  <forrest:property name="twitter-feed-tweets-color" value="'#000000'"/>
+  <forrest:property name="twitter-feed-tweets-background" value="'#ffffff'"/>
+  <forrest:property name="twitter-feed-tweets-links" value="'#cc3553'"/>
+  <forrest:property name="twitter-feed-shell-background" value="'#e6dae6'"/>
+  <forrest:property name="twitter-feed-shell-color" value="'#000000'"/>
+  <forrest:property name="twitter-feed-height" value="'300'"/>
+  <forrest:property name="twitter-feed-width" value="'150'"/>
+  <forrest:property name="twitter-feed-interval" value="'6000'"/>  
+  <forrest:property name="twitter-feed-rpp" value="'4'"/>
+</forrest:contract>]]>
+</usage>
+  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+  name="twitter" inputFormat="xsl">
+    <xsl:stylesheet version="1.1"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+      <xsl:param name="twitter-feed-features-user" select="'cazacodigos'"/>
+      <xsl:param name="twitter-feed-features-behavior" select="'all'"/>
+      <xsl:param name="twitter-feed-features-avatars" select="'false'"/>
+      <xsl:param name="twitter-feed-features-timestamp" select="'true'"/>
+      <xsl:param name="twitter-feed-features-hashtags" select="'true'"/>
+      <xsl:param name="twitter-feed-features-live" select="'false'"/>
+      <xsl:param name="twitter-feed-features-loop" select="'false'"/>
+      <xsl:param name="twitter-feed-features-scrollbar" select="'false'"/>
+      <xsl:param name="twitter-feed-tweets-color" select="'#000000'"/>
+      <xsl:param name="twitter-feed-tweets-background" select="'#ffffff'"/>
+      <xsl:param name="twitter-feed-tweets-links" select="'#cc3553'"/>
+      <xsl:param name="twitter-feed-shell-background" select="'#e6dae6'"/>
+      <xsl:param name="twitter-feed-shell-color" select="'#000000'"/>
+      <xsl:param name="twitter-feed-height" select="'300'"/>
+      <xsl:param name="twitter-feed-width" select="'150'"/>
+      <xsl:param name="twitter-feed-interval" select="'6000'"/>  
+      <xsl:param name="twitter-feed-rpp" select="'4'"/>
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part>
+            <script src="http://widgets.twimg.com/j/2/widget.js">&#160;</script>
+<script>
+new TWTR.Widget({
+  version: 2,
+  type: 'profile',
+  rpp: <xsl:value-of select="$twitter-feed-rpp"/>,
+  interval: <xsl:value-of select="$twitter-feed-interval"/>,
+  width: <xsl:value-of select="$twitter-feed-width"/>,
+  height: <xsl:value-of select="$twitter-feed-height"/>,
+  theme: {
+    shell: {
+      background: '<xsl:value-of select="$twitter-feed-shell-background"/>',
+      color: '<xsl:value-of select="$twitter-feed-shell-color"/>'
+    },
+    tweets: {
+      background: '<xsl:value-of select="$twitter-feed-tweets-background"/>',
+      color: '<xsl:value-of select="$twitter-feed-tweets-color"/>',
+      links: '<xsl:value-of select="$twitter-feed-tweets-links"/>'
+    }
+  },
+  features: {
+    scrollbar: <xsl:value-of select="$twitter-feed-features-scrollbar"/>,
+    loop: <xsl:value-of select="$twitter-feed-features-loop"/>,
+    live: <xsl:value-of select="$twitter-feed-features-live"/>,
+    hashtags: <xsl:value-of select="$twitter-feed-features-hashtags"/>,
+    timestamp: <xsl:value-of select="$twitter-feed-features-timestamp"/>,
+    avatars: <xsl:value-of select="$twitter-feed-features-avatars"/>,
+    behavior: '<xsl:value-of select="$twitter-feed-features-behavior"/>'
+  }
+}).render().setUser('<xsl:value-of select="$twitter-feed-features-user"/>').start();
+</script>
+          </forrest:part>
+        </forrest:content>
+      </xsl:template>
+    </xsl:stylesheet>
+  </forrest:template>
+</forrest:contract>

Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/common/html/twitter.contract.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml?rev=1004623&r1=1004622&r2=1004623&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml
Tue Oct  5 12:41:49 2010
@@ -18,6 +18,13 @@
 <forrest:contract name="search-input-provider-search-lucene"
 xmlns:forrest="http://apache.org/forrest/templates/1.0">
   <description>
+    <p>Note: This contract assumes that you have following properties set</p>
+    <ul>
+      <li>dispatcher.allowXmlProperties=false</li>
+      <li>dispatcher.shrink=true</li>
+    </ul>
+    <p>If you do not have this properties you need to use the traditional way to 
+    retrieve the properties via <![CDATA[<xsl:param name="defaultVariables" select="'test.html'"/>]]>.</p>
     <p>search-input-provider-search-lucene will output the default search form but
using search-lucene.com instead of any other provider.</p>
     <div class="warning">
       <div class="label">Warning</div>



Mime
View raw message