portals-portalapps-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r832773 - in /portals/applications/demo/trunk: pom.xml src/main/webapp/WEB-INF/portlet.xml src/main/webapp/WEB-INF/view/webwidget-edit-prefs.vm
Date Wed, 04 Nov 2009 15:42:28 GMT
Author: woonsan
Date: Wed Nov  4 15:42:28 2009
New Revision: 832773

URL: http://svn.apache.org/viewvc?rev=832773&view=rev
Log:
APA-22: Adding a widget portlet as a demo

Added:
    portals/applications/demo/trunk/src/main/webapp/WEB-INF/view/webwidget-edit-prefs.vm 
 (with props)
Modified:
    portals/applications/demo/trunk/pom.xml
    portals/applications/demo/trunk/src/main/webapp/WEB-INF/portlet.xml

Modified: portals/applications/demo/trunk/pom.xml
URL: http://svn.apache.org/viewvc/portals/applications/demo/trunk/pom.xml?rev=832773&r1=832772&r2=832773&view=diff
==============================================================================
--- portals/applications/demo/trunk/pom.xml (original)
+++ portals/applications/demo/trunk/pom.xml Wed Nov  4 15:42:28 2009
@@ -34,7 +34,7 @@
 
   <properties>
     <portals.portlet2-api-spec.version>1.0</portals.portlet2-api-spec.version>
-    <portals.applications.apa-gems.version>1.0</portals.applications.apa-gems.version>
+    <portals.applications.apa-gems.version>1.1-SNAPSHOT</portals.applications.apa-gems.version>
     <velocity.version>1.5</velocity.version>
     <velocity-tools.version>1.3</velocity-tools.version>
     <org.apache.portals.bridges.common.version>1.0.4</org.apache.portals.bridges.common.version>
@@ -55,7 +55,7 @@
     <groovy.version>1.1-beta-2</groovy.version>
     <commons-collections.version>3.2</commons-collections.version>
     <commons-digester.version>1.8</commons-digester.version>
-    <commons-lang.version>2.1</commons-lang.version>
+    <commons-lang.version>2.4</commons-lang.version>
   </properties>
 
   <!-- Dependencies -->

Modified: portals/applications/demo/trunk/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/applications/demo/trunk/src/main/webapp/WEB-INF/portlet.xml?rev=832773&r1=832772&r2=832773&view=diff
==============================================================================
--- portals/applications/demo/trunk/src/main/webapp/WEB-INF/portlet.xml (original)
+++ portals/applications/demo/trunk/src/main/webapp/WEB-INF/portlet.xml Wed Nov  4 15:42:28
2009
@@ -766,7 +766,73 @@
     </portlet-preferences>
   </portlet>
 
-
+  <portlet id="webWidgetIFrame">
+    <description>Hosts a web widget code inside an IFrame. Go to edit mode to configure
your web widget source.</description>
+    <portlet-name>WebWidgetIFramePortlet</portlet-name>
+    <display-name>Web Widget IFrame</display-name>
+    <portlet-class>org.apache.portals.gems.webwidget.WebWidgetIFramePortlet</portlet-class>
+    <init-param>
+      <name>EditPage</name>
+      <value>/WEB-INF/view/webwidget-edit-prefs.vm</value>
+    </init-param>
+    <init-param>
+      <name>HelpPage</name>
+      <value>/WEB-INF/view/iframe-help.html</value>
+    </init-param>
+    <init-param>
+      <name>portlet-icon</name>
+      <value>applications-internet.png</value>
+    </init-param>
+    <expiration-cache>300</expiration-cache>
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>VIEW</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
+    </supports>
+    <supported-locale>en</supported-locale>
+    <portlet-info>
+      <title>Web Widget IFrame</title>
+      <short-title>Web Widget IFrame</short-title>
+      <keywords>tool,iframe,web,widget,frame</keywords>
+    </portlet-info>
+    <portlet-preferences>
+      <preference>
+        <name>EDITABLEPREFS</name>
+        <value>TITLE, WIDTH, HEIGHT, MAX-WIDTH, MAX-HEIGHT, SCROLLING, WIDGETSOURCE</value>
+      </preference>
+      <preference>
+        <name>TITLE</name>
+        <value>Web Widget IFrame (Wikipedia)</value>
+      </preference>
+      <preference>
+        <name>HEIGHT</name>
+        <value>150</value>
+      </preference>
+      <preference>
+        <name>WIDTH</name>
+        <value>100%</value>
+      </preference>
+      <preference>
+        <name>MAX-HEIGHT</name>
+        <value>800</value>
+      </preference>
+      <preference>
+        <name>MAX-WIDTH</name>
+        <value>100%</value>
+      </preference>
+      <preference>
+        <name>SCROLLING</name>
+        <value>AUTO</value>
+      </preference>
+      <preference>
+        <name>WIDGETSOURCE</name>
+        <value><![CDATA[
+          <script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/wikipedia.xml&amp;up_mylang=en&amp;synd=open&amp;w=320&amp;h=46&amp;title=Wikipedia&amp;lang=en&amp;country=ALL&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>
+        ]]></value>
+      </preference>
+    </portlet-preferences>
+  </portlet>
 
   <portlet id="HelloGroovy">
     <portlet-name>HelloGroovy</portlet-name>

Added: portals/applications/demo/trunk/src/main/webapp/WEB-INF/view/webwidget-edit-prefs.vm
URL: http://svn.apache.org/viewvc/portals/applications/demo/trunk/src/main/webapp/WEB-INF/view/webwidget-edit-prefs.vm?rev=832773&view=auto
==============================================================================
--- portals/applications/demo/trunk/src/main/webapp/WEB-INF/view/webwidget-edit-prefs.vm (added)
+++ portals/applications/demo/trunk/src/main/webapp/WEB-INF/view/webwidget-edit-prefs.vm Wed
Nov  4 15:42:28 2009
@@ -0,0 +1,78 @@
+
+#*
+  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.
+*#
+
+<script language="javascript" type="text/javascript">
+function webWidgetCodes_onchange(field) {
+    var height = null;
+    var rgx = [ /[;&]h=(\d+)[;&]/, /'height':\s*(\d+)\s*/ ];
+    for (var i = 0; i < rgx.length; i++) {
+        if (rgx[i].test(field.value)) {
+            height = parseInt(RegExp.$1) + 70;
+            break;
+        }
+    }
+    if (height) {
+        field.form.HEIGHT.value = height;
+    }
+}
+</script>
+
+<h2 class="portlet-section-header">Edit Preferences</h2>
+
+<form action="$renderResponse.createActionURL()" method="post">
+<table>
+#foreach ($pref in $prefs)
+  #if ($pref.Key == "WIDGETSOURCE")
+    #set ($pv = $pref.Value)
+    #foreach ($x in $pv)
+      #set ($extr = $x)
+    #end
+    #foreach ($x in $values)
+      #set ($extr = $x)
+    #end
+    <tr colspan="4" align="right">
+      <td width="5%" align="left">&nbsp;</td>
+      <td nowrap class="portlet-section-alternate" align="right">$!key:&nbsp;</td>
+      <td class="portlet-section-body" align="left">
+        <textarea name="$pref.Key" rows="4" cols="40" class="portlet-form-field-label"
onchange="return webWidgetCodes_onchange(this);">$!extr</textarea>
+      </td>
+      <td width="5%" class="portlet-form-label" align="left">&nbsp;</td>
+    </tr>
+  #else
+    #prefField($pref.Key $pref.Value "40")
+  #end
+#end
+</table>
+
+<P>
+  <strong>Please copy and paste the Web Widget Source that you find in the Web Widgets
Directory Sites.</strong>
+  <br/>
+  <em>Note: The Web Widget Source can be either script tags or a simple url.</em>
+</P>
+<P>
+  Here are some example Web Widgets Directory Sites:
+  <ul>
+    <li><A href="http://www.google.com/ig/directory?synd=open" target="_blank">Google
Gadgets Directory Page</A></li>
+    <li><A href="http://eco.netvibes.com/widgets" target="_blank">Netvibes Widgets
Directory Page</A></li>
+  </ul>
+</P>
+
+<input type="submit" name="Save" value="Save" />
+</form>
+
+

Propchange: portals/applications/demo/trunk/src/main/webapp/WEB-INF/view/webwidget-edit-prefs.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/applications/demo/trunk/src/main/webapp/WEB-INF/view/webwidget-edit-prefs.vm
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message