portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1687970 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main: java/org/apache/jetspeed/jetapp/ java/org/apache/jetspeed/portlets/security/ webapp/WEB-INF/ webapp/WEB-INF/view/userreg/ webapp/jetapp/charts/ webapp/jetapp/charts/scr...
Date Sat, 27 Jun 2015 22:02:51 GMT
Author: taylor
Date: Sat Jun 27 22:02:50 2015
New Revision: 1687970

URL: http://svn.apache.org/r1687970
Log:
JS2-845: AutoRefresh feature. Added auto-refresh examples to jetspeed-portlet.xml for DateTimePortlet,
and all (angular) chart portlets

Removed:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/scripts/app-caches.js
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/scripts/app-memory.js
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/scripts/app-pages.js
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/scripts/app-users.js
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/scripts/data.js
Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/jetapp/JetAppChartPortlet.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/JetspeedPrincipalManagementPortlet.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/userreg/forgottenPasswd.vm
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-caches.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-memory.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-pages.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-users.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/scripts/chartControllers.js

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/jetapp/JetAppChartPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/jetapp/JetAppChartPortlet.java?rev=1687970&r1=1687969&r2=1687970&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/jetapp/JetAppChartPortlet.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/jetapp/JetAppChartPortlet.java
Sat Jun 27 22:02:50 2015
@@ -42,11 +42,6 @@ public class JetAppChartPortlet extends
             { "/jetapp/scripts/filters.js", "j2admin_filters"},
             { "/jetapp/charts/scripts/d3.min.js", "chart_d3"},
             { "/jetapp/charts/scripts/nv.d3.min.js", "chart_nvd3js"}
-//            { "/jetapp/charts/scripts/data.js", "chart_data"},
-//            { "/jetapp/charts/scripts/app-memory.js", "chart_memory"},
-//            { "/jetapp/charts/scripts/app-caches.js", "chart_caches"},
-//            { "/jetapp/charts/scripts/app-pages.js", "chart_pages"},
-//            { "/jetapp/charts/scripts/app-users.js", "chart_users"}
     };
 
     @Override

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/JetspeedPrincipalManagementPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/JetspeedPrincipalManagementPortlet.java?rev=1687970&r1=1687969&r2=1687970&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/JetspeedPrincipalManagementPortlet.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/JetspeedPrincipalManagementPortlet.java
Sat Jun 27 22:02:50 2015
@@ -1024,7 +1024,6 @@ public class JetspeedPrincipalManagement
                 {
                     try
                     {
-                        boolean passwordSet = false;
                         UserManager manager = (UserManager) getManager();
                         PasswordCredential credential = manager
                                 .getPasswordCredential((User) getPrincipal());
@@ -1042,7 +1041,6 @@ public class JetspeedPrincipalManagement
                                             getPrincipal().getName(),
                                             AuditActivity.PASSWORD_RESET,
                                             AdminPortletWebPage.USER_ADMINISTRATION);
-                            passwordSet = true;
                         }
                         if (getCredentialUpdateRequired() != credential
                                 .isUpdateRequired())
@@ -1079,8 +1077,7 @@ public class JetspeedPrincipalManagement
                         String expiredFlagStr = getUserExpiredFlag();
                         if (expiredFlagStr != null)
                         {
-                            if (!passwordSet
-                                    && expiredFlagStr.equalsIgnoreCase("active"))
{
+                            if (expiredFlagStr.equalsIgnoreCase("active")) {
                                 credential.setExpirationDate(null);
                                 credential.setExpired(false);
                                 getServiceLocator()
@@ -1094,8 +1091,7 @@ public class JetspeedPrincipalManagement
                                                 AuditActivity.PASSWORD_ENABLED,
                                                 AdminPortletWebPage.USER_ADMINISTRATION);
                             }
-                            else if (!passwordSet
-                                    && expiredFlagStr.equalsIgnoreCase("expired"))
+                            else if (expiredFlagStr.equalsIgnoreCase("expired"))
                             {
                                 java.sql.Date today = new java.sql.Date(new Date().getTime());
                                 credential.setExpirationDate(today);

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml?rev=1687970&r1=1687969&r2=1687970&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml
Sat Jun 27 22:02:50 2015
@@ -74,6 +74,7 @@
   <portlet>
     <portlet-name>DateTimePortlet</portlet-name>
     <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <js:metadata name="refreshRate">5000</js:metadata>
   </portlet>
 
   <portlet>
@@ -81,6 +82,8 @@
     <js:security-constraint-ref>public-view</js:security-constraint-ref>
     <js:metadata name="merge.portal.parameters.with.portlet.parameters">true</js:metadata>
     <js:metadata name="merge.portal.parameters.before.portlet.parameters">true</js:metadata>
+    <!--<js:metadata name="refreshRate">5000</js:metadata>-->
+    <!--<js:metadata name="refreshFunction">ForgottenPasswordComponent.refresh</js:metadata>-->
   </portlet>
 
   <portlet>
@@ -197,8 +200,33 @@
   <portlet>
     <portlet-name>PortalDataSerializer</portlet-name>
     <js:metadata name="render-time.security-constraints">true</js:metadata>
-  </portlet>  
-  
+  </portlet>
+
+  <!-- Charts -->
+  <portlet>
+    <portlet-name>MemoryUsageChart</portlet-name>
+    <js:metadata name="refreshRate">10000</js:metadata>
+    <js:metadata name="refreshFunction">angular:memoryController</js:metadata>
+  </portlet>
+
+  <portlet>
+      <portlet-name>PageUsageChart</portlet-name>
+      <js:metadata name="refreshRate">30000</js:metadata>
+      <js:metadata name="refreshFunction">angular:pagesController</js:metadata>
+  </portlet>
+
+  <portlet>
+     <portlet-name>UserLoginsChart</portlet-name>
+     <js:metadata name="refreshRate">20000</js:metadata>
+     <js:metadata name="refreshFunction">angular:usersController</js:metadata>
+  </portlet>
+
+  <portlet>
+     <portlet-name>CacheUsageChart</portlet-name>
+      <js:metadata name="refreshRate">30000</js:metadata>
+      <js:metadata name="refreshFunction">angular:cachesController</js:metadata>
+  </portlet>
+
   <js:services>
     <js:service name='ApplicationServerManager' />
     <js:service name='DeploymentManager' />

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/userreg/forgottenPasswd.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/userreg/forgottenPasswd.vm?rev=1687970&r1=1687969&r2=1687970&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/userreg/forgottenPasswd.vm
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/userreg/forgottenPasswd.vm
Sat Jun 27 22:02:50 2015
@@ -82,3 +82,10 @@
 </div>
 
 #end
+
+<script type="text/javascript">
+    var ForgottenPasswordComponent = {};
+    ForgottenPasswordComponent.refresh = function(id, name) {
+        console.log('FPG: portlet.name =' + name + ", portlet.id = " + id);
+    }
+</script>
\ No newline at end of file

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-caches.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-caches.html?rev=1687970&r1=1687969&r2=1687970&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-caches.html
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-caches.html
Sat Jun 27 22:02:50 2015
@@ -1,4 +1,4 @@
-<div ng-controller="CachesController" ng-init="init()">
+<div ng-controller="CachesController" id="cachesController" ng-init="init()">
     <div class="form-group">
         <div class="col-md-10 col-sm-10 padding-left0">
             <alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)"><strong>{{alert.msg}}</strong></alert>

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-memory.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-memory.html?rev=1687970&r1=1687969&r2=1687970&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-memory.html
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-memory.html
Sat Jun 27 22:02:50 2015
@@ -1,4 +1,4 @@
-<div ng-controller="MemoryController" ng-init="init()">
+<div ng-controller="MemoryController" id="memoryController" ng-init="init()">
     <div class="form-group">
         <div class="col-md-10 col-sm-10 padding-left0">
             <alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)"><strong>{{alert.msg}}</strong></alert>

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-pages.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-pages.html?rev=1687970&r1=1687969&r2=1687970&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-pages.html
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-pages.html
Sat Jun 27 22:02:50 2015
@@ -1,4 +1,4 @@
-<div ng-controller="PagesController" ng-init="init()">
+<div ng-controller="PagesController" id="pagesController" ng-init="init()">
     <div class="form-group">
         <div class="col-md-10 col-sm-10 padding-left0">
             <alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)"><strong>{{alert.msg}}</strong></alert>

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-users.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-users.html?rev=1687970&r1=1687969&r2=1687970&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-users.html
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/charts/chart-users.html
Sat Jun 27 22:02:50 2015
@@ -1,4 +1,4 @@
-<div ng-controller="UsersController" ng-init="init()">
+<div ng-controller="UsersController" id="usersController" ng-init="init()">
     <div class="form-group">
         <div class="col-md-10 col-sm-10 padding-left0">
             <alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)"><strong>{{alert.msg}}</strong></alert>

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/scripts/chartControllers.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/scripts/chartControllers.js?rev=1687970&r1=1687969&r2=1687970&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/scripts/chartControllers.js
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/jetapp/scripts/chartControllers.js
Sat Jun 27 22:02:50 2015
@@ -65,6 +65,10 @@ angular.module('j2admin.chartControllers
             addFailureAlert(TextMessages, $scope, errorMessage, status);
         };
 
+        $scope.refresh = function() {
+            $scope.init();
+        };
+
         $scope.init = function () {
 
             // -- retrieve runtime memory usage
@@ -103,7 +107,7 @@ angular.module('j2admin.chartControllers
                                 return i == 1;
                             });
 
-                        donut.select("text").text("new text");
+                        donut.selectAll("text", "g").remove();
                         donut.append("text", "g")
                             .text("Total: " + bytesToSize($scope.memoryUsage.memory.total))
                             .attr("class","css-label-class")
@@ -133,6 +137,10 @@ angular.module('j2admin.chartControllers
             addFailureAlert(TextMessages, $scope, errorMessage, status);
         };
 
+        $scope.refresh = function() {
+            $scope.init();
+        };
+
         // ---- init function
         $scope.init = function () {
 
@@ -209,6 +217,10 @@ angular.module('j2admin.chartControllers
             addFailureAlert(TextMessages, $scope, errorMessage, status);
         };
 
+        $scope.refresh = function() {
+            $scope.init();
+        };
+
         // -- init function
         $scope.init = function () {
 
@@ -268,6 +280,10 @@ angular.module('j2admin.chartControllers
             addFailureAlert(TextMessages, $scope, errorMessage, status);
         };
 
+        $scope.refresh = function() {
+            $scope.init();
+        };
+
         // -- init function
         $scope.init = function () {
 



---------------------------------------------------------------------
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