portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1687969 - in /portals/jetspeed-2/portal/trunk: applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/columns/ applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/max-responsive/ applications/jetspeed/src/main/...
Date Sat, 27 Jun 2015 22:00:02 GMT
Author: taylor
Date: Sat Jun 27 22:00:01 2015
New Revision: 1687969

URL: http://svn.apache.org/r1687969
Log:
JS2-845: AutoRefresh feature. To enable auto-refresh for a portlet, add an entry in portlet.xml like <js:metadata name=refreshRate>30000</js:metadata>. An optional refreshFunction can also be provided. If a function is not provided, the portlet pipeline is called for a portlet window automatically. A auto-refresh function can be provided, <js:metadata name=refreshFunction>ForgottenPasswordComponent.refresh</js:metadata>. Both global and module functions are supported. Module functions should be provided as Module.Function. Angular functions are also supported: <js:metadata name=refreshFunction>angular:memoryController</js:metadata> by prefixing with angular:, and provided the controller div id for an angular controller. A  function named refresh() with no parameters is required

Added:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetspeed-refresh.js
Modified:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/columns/layout.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/max-responsive/layout.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/maximized/layout.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/responsive/layout.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-blue/header.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-green/header.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-red/header.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap/header.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/greenearth/header.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/inherit/header.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/jetspeed/header.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/oldstyle/header.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/purpleplanet/css/styles.css
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/purpleplanet/header.vm
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/turbo/header.vm
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/JetspeedPowerTool.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/columns/layout.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/columns/layout.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/columns/layout.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/columns/layout.vm Sat Jun 27 22:00:01 2015
@@ -313,8 +313,15 @@ limitations under the License.
 			#set($col = $coords.x)
 			#set($lastRow = $columnLayout.getLastRowNumber($col))
 			#set($row = $coords.y)
-			
-			<div id='$f.id' name='$f.name' column='${col}' row='${row}' class="portal-layout-cell portal-layout-cell-${layoutType}-${row}-${col}" >
+            #set($refreshRate = "")
+            #set($refreshFunc = "")
+            #if($f.refreshRate != -1)
+              #set($refreshRate = "refreshRate='"+$f.refreshRate+"'")
+              #if ("$!f.refreshFunction" != "")
+                #set($refreshFunction = "refreshFunction='"+$f.refreshFunction+"'")
+              #end
+            #end
+			<div id='$f.id' name='$f.name' column='${col}' row='${row}' class="portal-layout-cell portal-layout-cell-${layoutType}-${row}-${col}" $refreshRate $refreshFunction>
 				
 		  #if($f.isLocked() == false)
 		  

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/max-responsive/layout.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/max-responsive/layout.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/max-responsive/layout.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/max-responsive/layout.vm Sat Jun 27 22:00:01 2015
@@ -18,13 +18,21 @@ limitations under the License.
 #set($f = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
 #set($rootFragment = $myPage.rootFragment)
 #set($messages = $portletConfig.getResourceBundle($renderRequest.Locale))
+#set($refreshRate = "")
+#set($refreshFunc = "")
+#if($f.refreshRate != -1)
+    #set($refreshRate = "refreshRate='"+$f.refreshRate+"'")
+    #if ("$!f.refreshFunction" != "")
+        #set($refreshFunction = "refreshFunction='"+$f.refreshFunction+"'")
+    #end
+#end
 
 #if ($rootFragment.decoration.header)
    #parse($rootFragment.decoration.header)
 #end
 
   ## get the decorated Portlet content
-  <div id="portal-layout-$htmlUtil.getSafeElementId($myPage.id)" class="portal-layout-maxed">
+  <div id="portal-layout-$htmlUtil.getSafeElementId($myPage.id)" name='$f.name' class="portal-layout-maxed" $refreshRate $refreshFunction>
     $jetspeed.setCurrentFragment($f)    
     #parse($f.decoration.template)
   </div>

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/maximized/layout.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/maximized/layout.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/maximized/layout.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/maximized/layout.vm Sat Jun 27 22:00:01 2015
@@ -18,13 +18,21 @@ limitations under the License.
 #set($f = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
 #set($rootFragment = $myPage.rootFragment)
 #set($messages = $portletConfig.getResourceBundle($renderRequest.Locale))
+#set($refreshRate = "")
+#set($refreshFunc = "")
+#if($f.refreshRate != -1)
+    #set($refreshRate = "refreshRate='"+$f.refreshRate+"'")
+    #if ("$!f.refreshFunction" != "")
+        #set($refreshFunction = "refreshFunction='"+$f.refreshFunction+"'")
+    #end
+#end
 
 #if ($rootFragment.decoration.header)
    #parse($rootFragment.decoration.header)
 #end
 
   ## get the decorated Portlet content
-  <div id="portal-layout-$htmlUtil.getSafeElementId($myPage.id)" class="portal-layout-maxed">
+  <div id="portal-layout-$htmlUtil.getSafeElementId($myPage.id)" name='$f.name' class="portal-layout-maxed" $refreshRate $refreshFunction>
     $jetspeed.setCurrentFragment($f)    
     #parse($f.decoration.template)
   </div>

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/responsive/layout.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/responsive/layout.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/responsive/layout.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/responsive/layout.vm Sat Jun 27 22:00:01 2015
@@ -80,8 +80,16 @@ limitations under the License.
           #set($col = $coords.x)
           #set($lastRow = $columnLayout.getLastRowNumber($col))
           #set($row = $coords.y)
+          #set($refreshRate = "")
+          #set($refreshFunc = "")
+          #if($f.refreshRate != -1)
+            #set($refreshRate = "refreshRate='"+$f.refreshRate+"'")
+            #if ("$!f.refreshFunction" != "")
+                #set($refreshFunction = "refreshFunction='"+$f.refreshFunction+"'")
+            #end
+          #end
 
-            <div id='$f.id' name='$f.name' column='${col}' row='${row}' class="portal-layout-cell portal-layout-cell-${layoutType}-${row}-${col}" >
+            <div id='$f.id' name='$f.name' column='${col}' row='${row}' class="portal-layout-cell portal-layout-cell-${layoutType}-${row}-${col}"  $refreshRate $refreshFunction>
 
               #if($f.isLocked() == false)
 
@@ -105,8 +113,8 @@ limitations under the License.
                                     #set ($fd = $f.Decorator)
                                   #end
                                   #foreach($pd in $decorationFactory.getPortletDecorations($rc))
-                                  <option value='$pd' #if ($pd == $fd) SELECTED #end>$pd
-                    #end
+                                    <option value='$pd' #if ($pd == $fd) SELECTED #end>$pd
+                                  #end
                                 </select>
                             #end
                           #else

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-blue/header.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-blue/header.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-blue/header.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-blue/header.vm Sat Jun 27 22:00:01 2015
@@ -72,6 +72,28 @@ var JETUI_YUI = {
 #includeJavaScriptForHead()
 <link rel="stylesheet" type="text/css" href="#BaseHref()css/bootstrap/dist/css/bootstrap-blue.css"/>
 <link rel="stylesheet" type="text/css" href="#BaseHref()decorations/layout/bootstrap-blue/css/styles-new-blue.css"/>
+#if ($jetspeed.isAutoRefreshEnabled())
+<script type="text/javascript" src="#BaseHref()javascript/jetspeed/jetspeed-refresh.js"></script>
+<script type="text/javascript">
+#set ($max = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
+#if ($max)
+  var layoutCell = "portal-layout-maxed";
+#else
+  var layoutCell = "portal-layout-cell";
+#end
+function jetspeedLoad() {
+  jetspeedRefresher.load(layoutCell, "panel-body");
+}
+if (window.addEventListener) // W3C standard
+{
+  window.addEventListener('load', jetspeedLoad, false);
+}
+else if (window.attachEvent) // Microsoft
+{
+  window.attachEvent('onload', jetspeedLoad);
+}
+</script>
+#end
 </head>
 <body class="#PageBaseCSSClass()">
 <!--  BEGIN: layout/html/jetspeed/decorator.vm -->

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-green/header.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-green/header.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-green/header.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-green/header.vm Sat Jun 27 22:00:01 2015
@@ -72,6 +72,28 @@ var JETUI_YUI = {
 #includeJavaScriptForHead()
 <link rel="stylesheet" type="text/css" href="#BaseHref()css/bootstrap/dist/css/bootstrap-green.css"/>
 <link rel="stylesheet" type="text/css" href="#BaseHref()decorations/layout/bootstrap-green/css/styles-new-green.css"/>
+#if ($jetspeed.isAutoRefreshEnabled())
+<script type="text/javascript" src="#BaseHref()javascript/jetspeed/jetspeed-refresh.js"></script>
+<script type="text/javascript">
+#set ($max = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
+#if ($max)
+  var layoutCell = "portal-layout-maxed";
+#else
+  var layoutCell = "portal-layout-cell";
+#end
+function jetspeedLoad() {
+  jetspeedRefresher.load(layoutCell, "panel-body");
+}
+if (window.addEventListener) // W3C standard
+{
+  window.addEventListener('load', jetspeedLoad, false);
+}
+else if (window.attachEvent) // Microsoft
+{
+  window.attachEvent('onload', jetspeedLoad);
+}
+</script>
+#end
 </head>
 <body class="#PageBaseCSSClass()">
 <!--  BEGIN: layout/html/jetspeed/decorator.vm -->

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-red/header.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-red/header.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-red/header.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap-red/header.vm Sat Jun 27 22:00:01 2015
@@ -72,6 +72,28 @@ var JETUI_YUI = {
 #includeJavaScriptForHead()
 <link rel="stylesheet" type="text/css" href="#BaseHref()css/bootstrap/dist/css/bootstrap-red.css"/>
 <link rel="stylesheet" type="text/css" href="#BaseHref()decorations/layout/bootstrap-red/css/styles-new-red.css"/>
+#if ($jetspeed.isAutoRefreshEnabled())
+<script type="text/javascript" src="#BaseHref()javascript/jetspeed/jetspeed-refresh.js"></script>
+<script type="text/javascript">
+#set ($max = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
+#if ($max)
+  var layoutCell = "portal-layout-maxed";
+#else
+  var layoutCell = "portal-layout-cell";
+#end
+function jetspeedLoad() {
+  jetspeedRefresher.load(layoutCell, "panel-body");
+}
+if (window.addEventListener) // W3C standard
+{
+  window.addEventListener('load', jetspeedLoad, false);
+}
+else if (window.attachEvent) // Microsoft
+{
+  window.attachEvent('onload', jetspeedLoad);
+}
+</script>
+#end
 </head>
 <body class="#PageBaseCSSClass()">
 <!--  BEGIN: layout/html/jetspeed/decorator.vm -->

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap/header.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap/header.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap/header.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/bootstrap/header.vm Sat Jun 27 22:00:01 2015
@@ -72,6 +72,28 @@ var JETUI_YUI = {
 #includeJavaScriptForHead()
 <link rel="stylesheet" type="text/css" href="#BaseHref()css/bootstrap/dist/css/bootstrap.css"/>
 <link rel="stylesheet" type="text/css" href="#BaseHref()decorations/layout/bootstrap/css/styles-new.css"/>
+#if ($jetspeed.isAutoRefreshEnabled())
+<script type="text/javascript" src="#BaseHref()javascript/jetspeed/jetspeed-refresh.js"></script>
+<script type="text/javascript">
+#set ($max = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
+#if ($max)
+  var layoutCell = "portal-layout-maxed";
+#else
+  var layoutCell = "portal-layout-cell";
+#end
+function jetspeedLoad() {
+    jetspeedRefresher.load(layoutCell, "panel-body");
+}
+if (window.addEventListener) // W3C standard
+{
+    window.addEventListener('load', jetspeedLoad, false);
+}
+else if (window.attachEvent) // Microsoft
+{
+    window.attachEvent('onload', jetspeedLoad);
+}
+</script>
+#end
 </head>
 <body class="#PageBaseCSSClass()">
 <!--  BEGIN: layout/html/jetspeed/decorator.vm -->

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/greenearth/header.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/greenearth/header.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/greenearth/header.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/greenearth/header.vm Sat Jun 27 22:00:01 2015
@@ -70,7 +70,28 @@ var JETUI_YUI = {
 <link rel="shortcut icon" href="#BaseHref()images/jetspeed.jpg" type="image/x-icon" />
 #includeJavaScriptForHead()
 #IncludeStylesheets()
-
+#if ($jetspeed.isAutoRefreshEnabled())
+<script type="text/javascript" src="#BaseHref()javascript/jetspeed/jetspeed-refresh.js"></script>
+<script type="text/javascript">
+#set ($max = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
+#if ($max)
+  var layoutCell = "portal-layout-maxed";
+#else
+  var layoutCell = "portal-layout-cell";
+#end
+function jetspeedLoad() {
+  jetspeedRefresher.load(layoutCell, "PContent");
+}
+if (window.addEventListener) // W3C standard
+{
+  window.addEventListener('load', jetspeedLoad, false);
+}
+else if (window.attachEvent) // Microsoft
+{
+  window.attachEvent('onload', jetspeedLoad);
+}
+</script>
+#end
 </head>
 <body class="#PageBaseCSSClass()">
 <!--  BEGIN: layout/html/jetspeed/decorator.vm -->

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/inherit/header.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/inherit/header.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/inherit/header.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/inherit/header.vm Sat Jun 27 22:00:01 2015
@@ -72,7 +72,28 @@ var JETUI_YUI = {
 #includeJavaScriptForHead()
 #includeInheritStylesheets()
 #IncludeStylesheets()
-
+#if ($jetspeed.isAutoRefreshEnabled())
+<script type="text/javascript" src="#BaseHref()javascript/jetspeed/jetspeed-refresh.js"></script>
+<script type="text/javascript">
+#set ($max = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
+#if ($max)
+  var layoutCell = "portal-layout-maxed";
+#else
+  var layoutCell = "portal-layout-cell";
+#end
+function jetspeedLoad() {
+  jetspeedRefresher.load(layoutCell, "PContent");
+}
+if (window.addEventListener) // W3C standard
+{
+  window.addEventListener('load', jetspeedLoad, false);
+}
+else if (window.attachEvent) // Microsoft
+{
+  window.attachEvent('onload', jetspeedLoad);
+}
+</script>
+#end
 </head>
 <body class="#PageBaseCSSClass()">
 <!--  BEGIN: layout/html/jetspeed/decorator.vm -->

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/jetspeed/header.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/jetspeed/header.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/jetspeed/header.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/jetspeed/header.vm Sat Jun 27 22:00:01 2015
@@ -70,28 +70,50 @@ var JETUI_YUI = {
 <link rel="shortcut icon" href="#BaseHref()images/jetspeed.jpg" type="image/x-icon" />
 #includeJavaScriptForHead()
 #IncludeStylesheets()
-
+#if ($jetspeed.isAutoRefreshEnabled())
+<script type="text/javascript" src="#BaseHref()javascript/jetspeed/jetspeed-refresh.js"></script>
+<script type="text/javascript">
+#set ($max = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
+#if ($max)
+  var layoutCell = "portal-layout-maxed";
+#else
+  var layoutCell = "portal-layout-cell";
+#end
+function jetspeedLoad() {
+  jetspeedRefresher.load(layoutCell, "PContent");
+}
+if (window.addEventListener) // W3C standard
+{
+  window.addEventListener('load', jetspeedLoad, false);
+}
+else if (window.attachEvent) // Microsoft
+{
+  window.attachEvent('onload', jetspeedLoad);
+}
+</script>
+#end
 </head>
-<body class="#PageBaseCSSClass()">
-<!--  BEGIN: layout/html/jetspeed/decorator.vm -->
-<!-- Page Action Bar -->
+<body class="#PageBaseCSSClass()">
+<!--  BEGIN: layout/html/jetspeed/decorator.vm -->
+<!-- Page Action Bar -->
 #if ($request.getUserPrincipal())
 <span class="layout-statusarea"><b>$jetspeed.getUserAttribute("user.name.given","") $jetspeed.getUserAttribute("user.name.family", ${request.userPrincipal.name})</b> | <a href="#BaseHref()login/logout">Log out</a></span>
-#end
+#end
 #if (!$jetspeed.isAjaxCustomizationEnabled())
 #PageActionBar()
 #end
 <!-- end of header -->
 <div id="layout-${rootFragment.id}" class="#PageBaseCSSClass()" >
-<div class="header">
-<h1 class="logo">Jetspeed 2</h1>
-<div class="menu">
+<div class="header">
+<h1 class="logo">Jetspeed 2</h1>
+<div class="menu">
 #if (!$jetspeed.isAjaxCustomizationEnabled())
-#set($pagesStandardMenu = $site.getMenu("pages"))
#if(!$pagesStandardMenu.empty)
+#set($pagesStandardMenu = $site.getMenu("pages"))
+#if(!$pagesStandardMenu.empty)
 #includeTabsNavigation($pagesStandardMenu $LEFT_TO_RIGHT)
 #end
 #end
-</div>
+</div>
 </div>
 #if (!$jetspeed.isAjaxCustomizationEnabled())
     <!-- Content Table -->

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/oldstyle/header.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/oldstyle/header.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/oldstyle/header.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/oldstyle/header.vm Sat Jun 27 22:00:01 2015
@@ -35,25 +35,47 @@ limitations under the License.
 <link rel="shortcut icon" href="#BaseHref()images/jetspeed.jpg" type="image/x-icon" />
 #includeJavaScriptForHead()
 #IncludeStylesheets()
-
+#if ($jetspeed.isAutoRefreshEnabled())
+<script type="text/javascript" src="#BaseHref()javascript/jetspeed/jetspeed-refresh.js"></script>
+<script type="text/javascript">
+#set ($max = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
+#if ($max)
+  var layoutCell = "portal-layout-maxed";
+#else
+  var layoutCell = "portal-layout-cell";
+#end
+function jetspeedLoad() {
+  jetspeedRefresher.load(layoutCell, "PContent");
+}
+if (window.addEventListener) // W3C standard
+{
+  window.addEventListener('load', jetspeedLoad, false);
+}
+else if (window.attachEvent) // Microsoft
+{
+  window.attachEvent('onload', jetspeedLoad);
+}
+</script>
+#end
 </head>
-<body class="#PageBaseCSSClass()">
-<!--  BEGIN: layout/html/oldstyle/decorator.vm -->
-<!-- Page Action Bar -->
-#if ($request.getUserPrincipal())
-<a class="layout-oldstyle-logout" href="#BaseHref()login/logout">Logout</a>
-#end
-#PageActionBar()
+<body class="#PageBaseCSSClass()">
+<!--  BEGIN: layout/html/oldstyle/decorator.vm -->
+<!-- Page Action Bar -->
+#if ($request.getUserPrincipal())
+<a class="layout-oldstyle-logout" href="#BaseHref()login/logout">Logout</a>
+#end
+#PageActionBar()
 <!-- end of header -->
 </div>   
 <div id="layout-${rootFragment.id}" class="#PageBaseCSSClass()" >
-<div class="header">
-<h1 class="logo">Jetspeed 2</h1>
-<div class="menu">
-#set($pagesStandardMenu = $site.getMenu("pages"))
#if(!$pagesStandardMenu.empty)
+<div class="header">
+<h1 class="logo">Jetspeed 2</h1>
+<div class="menu">
+#set($pagesStandardMenu = $site.getMenu("pages"))
+#if(!$pagesStandardMenu.empty)
 #includeTabsNavigation($pagesStandardMenu $LEFT_TO_RIGHT)
 #end
-</div>
+</div>
 </div>
     <!-- Content Table -->
     <table cellpadding="0" cellspacing="0" border="0" width="100%" id="main">
@@ -85,4 +107,4 @@ limitations under the License.
                 ## $jetspeed.include($jetspeed.currentFragment)
                 
                 <!--  END: layout/html/tigris/decorator.vm -->
-                
+                

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/purpleplanet/css/styles.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/purpleplanet/css/styles.css?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/purpleplanet/css/styles.css (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/purpleplanet/css/styles.css Sat Jun 27 22:00:01 2015
@@ -182,7 +182,7 @@ background-position: 0px -30px
 }
 
 .layout-purpleplanet .menu {
-    background:url(../images/blue_gradient.png) #3A0058;
+    background:url(../images/blue_gradient.gif) #3A0058;
     padding:1px;
     border-top:1px solid #fff;
 }

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/purpleplanet/header.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/purpleplanet/header.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/purpleplanet/header.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/purpleplanet/header.vm Sat Jun 27 22:00:01 2015
@@ -70,7 +70,28 @@ var JETUI_YUI = {
 <link rel="shortcut icon" href="#BaseHref()images/jetspeed.jpg" type="image/x-icon" />
 #includeJavaScriptForHead()
 #IncludeStylesheets()
-
+#if ($jetspeed.isAutoRefreshEnabled())
+<script type="text/javascript" src="#BaseHref()javascript/jetspeed/jetspeed-refresh.js"></script>
+<script type="text/javascript">
+#set ($max = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
+#if ($max)
+  var layoutCell = "portal-layout-maxed";
+#else
+  var layoutCell = "portal-layout-cell";
+#end
+function jetspeedLoad() {
+  jetspeedRefresher.load(layoutCell, "PContent");
+}
+if (window.addEventListener) // W3C standard
+{
+  window.addEventListener('load', jetspeedLoad, false);
+}
+else if (window.attachEvent) // Microsoft
+{
+  window.attachEvent('onload', jetspeedLoad);
+}
+</script>
+#end
 </head>
 <body class="#PageBaseCSSClass()">
 <!--  BEGIN: layout/html/jetspeed/decorator.vm -->

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/turbo/header.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/turbo/header.vm?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/turbo/header.vm (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/turbo/header.vm Sat Jun 27 22:00:01 2015
@@ -70,7 +70,28 @@ var JETUI_YUI = {
 <link rel="shortcut icon" href="#BaseHref()images/jetspeed.jpg" type="image/x-icon" />
 #includeJavaScriptForHead()
 #IncludeStylesheets()
-
+#if ($jetspeed.isAutoRefreshEnabled())
+<script type="text/javascript" src="#BaseHref()javascript/jetspeed/jetspeed-refresh.js"></script>
+<script type="text/javascript">
+#set ($max = $request.getAttribute("org.apache.jetspeed.maximized.Fragment"))
+#if ($max)
+  var layoutCell = "portal-layout-maxed";
+#else
+  var layoutCell = "portal-layout-cell";
+#end
+function jetspeedLoad() {
+  jetspeedRefresher.load(layoutCell, "PContent");
+}
+if (window.addEventListener) // W3C standard
+{
+  window.addEventListener('load', jetspeedLoad, false);
+}
+else if (window.attachEvent) // Microsoft
+{
+  window.attachEvent('onload', jetspeedLoad);
+}
+</script>
+#end
 </head>
 <body class="#PageBaseCSSClass()">
 <!--  BEGIN: layout/html/jetspeed/decorator.vm -->

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetspeed-refresh.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetspeed-refresh.js?rev=1687969&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetspeed-refresh.js (added)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetspeed-refresh.js Sat Jun 27 22:00:01 2015
@@ -0,0 +1,117 @@
+var jetspeedRefresher = (function() {
+
+    return {
+        reloadPortlet : function(self, id, name, msWait, pContent) {
+            self.getContent(id, name, pContent);
+            setTimeout(self.reloadPortlet, msWait, self, id, name, msWait, pContent);
+        },
+
+        reloadFunction : function(self, id, name, msWait, f, pContent) {
+            if (f.indexOf(".") == -1) {
+                if (f.indexOf("angular") == 0) {
+                    var arguments = f.split(":");
+                    angular.element(document.getElementById(arguments[1])).scope().refresh();
+                }
+                else {
+                    window[f](id, name); // global function
+                }
+            }
+            else {
+                var namespaced = f.split(".");
+                window[namespaced[0]][namespaced[1]](id, name);
+            }
+            setTimeout(self.reloadFunction, msWait, self, id, name, msWait, f, pContent);
+        },
+
+        load : function(layoutCell, pContent) {
+            var x = document.getElementsByClassName(layoutCell);
+            var i = 0;
+            var self = this;
+            for (i = 0; i < x.length; i++) {
+                if (x[i].getAttribute('refreshRate')) {
+                    if (x[i].getAttribute('refreshFunction')) {
+                        setTimeout(this.reloadFunction, x[i].getAttribute('refreshRate'), self, x[i].id, x[i].getAttribute('name'),
+                            x[i].getAttribute('refreshRate'), x[i].getAttribute('refreshFunction'), pContent);
+                    }
+                    else {
+                        setTimeout(self.reloadPortlet, x[i].getAttribute('refreshRate'), self, x[i].id, x[i].getAttribute('name'),
+                            x[i].getAttribute('refreshRate'), pContent);
+                    }
+                }
+            }
+        },
+
+        getContent : function(id, name, pContent) {
+            this.ajax("/jetspeed/portlet?entity=" + id + "&portlet=" + name + "&skipHead=true", function(data)
+            {
+                var container = document.getElementById(id);
+                var inner = container.getElementsByClassName(pContent);
+                inner[0].innerHTML = "<span style=\"line-height:0.005px;\">&nbsp;</span>" + data;
+            });
+        },
+
+        ajax : function(url, callback) {
+            if(typeof jQuery != 'undefined')
+            {
+                jQuery.ajax({
+                    url: url,
+                    success: function(data, status, xhr)
+                    {
+                        if(callback)
+                        {
+                            callback(data);
+                        }
+                    }
+                });
+            }
+            else
+            {
+                var xmlhttp = null;
+
+                if(typeof XMLHttpRequest!='undefined')
+                {
+                    xmlhttp = new XMLHttpRequest();
+                }
+                else
+                {
+                    try
+                    {
+                        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+                    }
+                    catch (e)
+                    {
+                        try
+                        {
+                            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+                        }
+                        catch (E)
+                        {
+                            xmlhttp = null;
+                        }
+                    }
+                }
+
+                if(xmlhttp)
+                {
+                    xmlhttp.open('GET', url, true);
+
+                    xmlhttp.onreadystatechange = function()
+                    {
+                        if (xmlhttp.readyState == 4)
+                        {
+                            if(xmlhttp.status == 200)
+                            {
+                                if(callback)
+                                {
+                                    callback(xmlhttp.responseText);
+                                }
+                            }
+                        }
+                    };
+
+                    xmlhttp.send(null);
+                }
+            }
+        }
+    }
+})();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java Sat Jun 27 22:00:01 2015
@@ -76,6 +76,9 @@ public class ContentFragmentImpl impleme
     private SecurityConstraints constraints;
     private String refId;
 
+    private long refreshRate = -1;
+    private String refreshFunction = null;
+
     /**
      * Construct new dynamic content fragment with
      * a transiently computed id.
@@ -1718,4 +1721,21 @@ public class ContentFragmentImpl impleme
     {
         this.id = id;
     }
+
+    public long getRefreshRate() {
+        return refreshRate;
+    }
+
+    public void setRefreshRate(long rate) {
+        this.refreshRate = rate;
+    }
+
+    public String getRefreshFunction() {
+        return this.refreshFunction;
+    }
+
+    public void setRefreshFunction(String function) {
+        this.refreshFunction = function;
+    }
+
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java Sat Jun 27 22:00:01 2015
@@ -122,7 +122,11 @@ public class PortletAggregatorImpl imple
                 mutableNavState.setState(window, requestedWindowState);
             }
         }
-        
+        String skipHead = context.getRequestParameter("skipHead");
+        if (skipHead != null) {
+            context.setAttribute("jetapp.headers.flag", Boolean.TRUE);
+        }
+
         ContentFragment contentFragment = window.getFragment();
         renderer.renderNow(contentFragment, context);
         
@@ -130,9 +134,11 @@ public class PortletAggregatorImpl imple
         {            
             context.getResponse().setHeader( "JS_PORTLET_TITLE", StringEscapeUtils.escapeHtml( contentFragment.getPortletContent().getTitle() ) );
         }
-        
-        writeHeadElements(context, window);
-        
+
+        if (skipHead == null) {
+            writeHeadElements(context, window);
+        }
+
         context.getResponse().getWriter().write(contentFragment.getRenderedContent());
         PortletContent content = contentFragment.getPortletContent();
         

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java Sat Jun 27 22:00:01 2015
@@ -16,8 +16,10 @@
  */
 package org.apache.jetspeed.aggregator.impl;
 
+import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.administration.PortalConfigurationConstants;
 import org.apache.jetspeed.aggregator.PortletAccessDeniedException;
 import org.apache.jetspeed.aggregator.PortletContent;
 import org.apache.jetspeed.aggregator.PortletRenderer;
@@ -95,7 +97,9 @@ public class PortletRendererImpl impleme
      * The OutOfService message
      */
     protected String outOfServiceMessage = DEFAULT_OUT_OF_SERVICE_MESSAGE;
-    
+
+    protected boolean autoRefreshEnabled = true;
+
     public PortletRendererImpl(PortletContainer container, 
                                WorkerMonitor workMonitor,
                                PortalStatistics statistics,
@@ -111,6 +115,9 @@ public class PortletRendererImpl impleme
         this.checkSecurityConstraints = checkSecurityConstraints;
         this.accessController = accessController;
         this.portletContentCache = portletContentCache;
+        if (Jetspeed.getConfiguration() != null) {
+            this.autoRefreshEnabled = Jetspeed.getConfiguration().getBoolean(PortalConfigurationConstants.AUTO_REFRESH_ENABLED, true);
+
     }
 
     public PortletRendererImpl(PortletContainer container, 
@@ -243,6 +250,17 @@ public class PortletRendererImpl impleme
                     return null;
                 }
             }
+            // autoRefresh feature
+            if (autoRefreshEnabled) {
+                long refreshRate = this.getRefreshRate(portletDefinition);
+                if (refreshRate != -1) {
+                    portletWindow.getFragment().setRefreshRate(refreshRate);
+                    String refreshFunction = this.getRefreshFunction(portletDefinition);
+                    if (refreshFunction != null) {
+                        portletWindow.getFragment().setRefreshFunction(refreshFunction);
+                    }
+                }
+            }
             job = buildRenderingJob( portletWindow, requestContext, true, portletDefinition, timeoutMetadata );
         }
         catch (PortletAccessDeniedException pade)
@@ -256,7 +274,8 @@ public class PortletRendererImpl impleme
 
         return job;
     }
-           
+
+
     /** 
      * 
      * Render the specified rendering job.
@@ -393,7 +412,48 @@ public class PortletRendererImpl impleme
         }       
         return timeoutMetadata;
     }
-    
+
+    protected long getRefreshRate(PortletDefinition portletDefinition)
+    {
+        long refreshRate = -1;
+        Collection<LocalizedField> refreshFields = null;
+
+        if (portletDefinition != null)
+        {
+            refreshFields = portletDefinition.getMetadata().getFields(PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_REFRESH_RATE);
+        }
+
+        if (refreshFields != null && !refreshFields.isEmpty())
+        {
+            try
+            {
+                refreshRate = Long.parseLong(refreshFields.iterator().next().getValue());
+            }
+            catch (NumberFormatException nfe)
+            {
+                log.warn("Invalid refreshRate metadata: " + nfe.getMessage());
+            }
+        }
+        return refreshRate;
+    }
+
+    protected String getRefreshFunction(PortletDefinition portletDefinition)
+    {
+        String refreshFunction = null;
+        Collection<LocalizedField> refreshFields = null;
+
+        if (portletDefinition != null)
+        {
+            refreshFields = portletDefinition.getMetadata().getFields(PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_REFRESH_FUNCTION);
+        }
+
+        if (refreshFields != null && !refreshFields.isEmpty())
+        {
+            refreshFunction = refreshFields.iterator().next().getValue();
+        }
+        return refreshFunction;
+    }
+
     protected void setTimeoutOnJob(long timeoutMetadata, RenderingJob rJob)
     {
         

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java Sat Jun 27 22:00:01 2015
@@ -128,7 +128,9 @@ public class JetspeedPowerToolImpl imple
     private BasePortalURL baseUrlAccess;
     
     private PortletRenderer renderer;
+
     protected boolean ajaxCustomization = false;
+    protected boolean autoRefreshEnabled = true;
     
     public JetspeedPowerToolImpl(RequestContext requestContext, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse, PortletRenderer renderer) throws Exception
     {
@@ -151,7 +153,8 @@ public class JetspeedPowerToolImpl imple
         decorationLocator = (TemplateLocator) getComponent("DecorationLocator");
         String jetuiMode = Jetspeed.getConfiguration().getString(PortalConfigurationConstants.JETUI_CUSTOMIZATION_METHOD, PortalConfigurationConstants.JETUI_CUSTOMIZATION_SERVER);
         this.ajaxCustomization = (jetuiMode.equals(PortalConfigurationConstants.JETUI_CUSTOMIZATION_AJAX));
-        
+        this.autoRefreshEnabled = Jetspeed.getConfiguration().getBoolean(PortalConfigurationConstants.AUTO_REFRESH_ENABLED, true);
+
         // By using null, we create a re-useable locator
         capabilityMap = requestContext.getCapabilityMap();
         locale = requestContext.getLocale();
@@ -915,6 +918,10 @@ public class JetspeedPowerToolImpl imple
         return this.ajaxCustomization;
     }
 
+    public boolean isAutoRefreshEnabled() {
+        return this.autoRefreshEnabled;
+    }
+
     public Map<String,String> getUserAttributes()
     {
         RequestContext rc = getRequestContext();

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java Sat Jun 27 22:00:01 2015
@@ -188,5 +188,18 @@ public interface PortalReservedParameter
       * PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY - request portal site context attribute key
       */
      public static final String PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY = "org.apache.jetspeed.portalsite.PortalSiteRequestContext";
-     
+
+    /**
+     * A portlet can have a specific setting for the refresh rate for automatically
+     * re-rendering the portlet. If set to -1 or undefined, no refresh will be executed
+     * refresh rate is in seconds
+     */
+    public static final String PORTLET_EXTENDED_DESCRIPTOR_REFRESH_RATE = "refreshRate";
+
+    /**
+     * A portlet can have a specific setting for the automatic refresh function that will be called
+     * when refreshing the portlet. This setting is dependent on refreshRate.
+     */
+    public static final String PORTLET_EXTENDED_DESCRIPTOR_REFRESH_FUNCTION = "refreshFunction";
+
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java Sat Jun 27 22:00:01 2015
@@ -107,4 +107,7 @@ public interface PortalConfigurationCons
     static final String XSS_FILTER_POST = "xss.filter.post";
     static final String XSS_REGEX = "xss.filter.regexes";
     static final String XSS_FLAGS = "xss.filter.flags";
+
+    /** AutoRefresh */
+    static final String AUTO_REFRESH_ENABLED = "autorefresh.enabled";
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/JetspeedPowerTool.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/JetspeedPowerTool.java?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/JetspeedPowerTool.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/JetspeedPowerTool.java Sat Jun 27 22:00:01 2015
@@ -366,5 +366,10 @@ public interface JetspeedPowerTool
      * @return the portal configuration
      */
     PortalConfiguration getPortalConfiguration();
-    
+
+    /**
+     * Is AutoRefresh support for automatic portlet rendering enabled
+     * @return true when auto refresh is enabled in Jetspeed properties
+     */
+    boolean isAutoRefreshEnabled();
 }
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java Sat Jun 27 22:00:01 2015
@@ -694,4 +694,9 @@ public interface ContentFragment
      *                   or USER where the default user name is used if null)
      */
     void updateStateMode(String portletState, String portletMode, String scope, String scopeValue);
+
+    long getRefreshRate();
+    void setRefreshRate(long rate);
+    String getRefreshFunction();
+    void setRefreshFunction(String function);
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties?rev=1687969&r1=1687968&r2=1687969&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties Sat Jun 27 22:00:01 2015
@@ -449,6 +449,12 @@ xss.filter.flags = 2 | 8 | 32
 xss.filter.regexes = expression\\((.*?)\\)
 xss.filter.flags = 2 | 8 | 32
 
+#-------------------------------------------------------------------------
+# Auto Refresh
+# since 2.3.0
+#-------------------------------------------------------------------------
+autorefresh.enabled = true
+
 
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message