portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1610063 - in /portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main: java/org/apache/jetspeed/portlets/tracking/ webapp/WEB-INF/view/tracking/
Date Sat, 12 Jul 2014 21:53:59 GMT
Author: taylor
Date: Sat Jul 12 21:53:59 2014
New Revision: 1610063

URL: http://svn.apache.org/r1610063
Log:
JS2-1287: backporting trunk to 2.2.3 release

Modified:
    portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/java/org/apache/jetspeed/portlets/tracking/PortletTrackingPortlet.java
    portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.java
    portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/webapp/WEB-INF/view/tracking/tracking.vm

Modified: portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/java/org/apache/jetspeed/portlets/tracking/PortletTrackingPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/java/org/apache/jetspeed/portlets/tracking/PortletTrackingPortlet.java?rev=1610063&r1=1610062&r2=1610063&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/java/org/apache/jetspeed/portlets/tracking/PortletTrackingPortlet.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/java/org/apache/jetspeed/portlets/tracking/PortletTrackingPortlet.java
Sat Jul 12 21:53:59 2014
@@ -16,13 +16,11 @@
  */
 package org.apache.jetspeed.portlets.tracking;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.aggregator.PortletTrackingInfo;
+import org.apache.jetspeed.aggregator.PortletTrackingManager;
+import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
+import org.apache.velocity.context.Context;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -31,13 +29,10 @@ import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
-
-import org.apache.jetspeed.CommonPortletServices;
-import org.apache.jetspeed.aggregator.PortletTrackingManager;
-import org.apache.jetspeed.container.PortletWindow;
-import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
-import org.apache.velocity.context.Context;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
 
 public class PortletTrackingPortlet extends GenericVelocityPortlet
 {
@@ -56,37 +51,18 @@ public class PortletTrackingPortlet exte
 
     public void doView(RenderRequest request, RenderResponse response) throws PortletException,
IOException
     {
-        List outOfService = createList();
+        List<PortletTrackingInfo> outOfService = trackingManager.getOutOfServiceList();
         Context context = getContext(request);
         context.put("outOfService", outOfService);
         context.put("count", new Integer(outOfService.size()));
+        context.put("isEnabled", new Boolean(trackingManager.isEnabled()));
         super.doView(request, response);
     }
-    
-    protected List createList()
-    {
-        List result = new ArrayList();
-        Iterator outOfService = trackingManager.getOutOfServiceList().iterator();
-        Map portlets = new HashMap();
-        while (outOfService.hasNext())
-        {
-            PortletWindow window = (PortletWindow)outOfService.next();
-            String id = window.getId().toString();
-            PortletDefinition pd = window.getPortletDefinition();
-            String uniqueName = pd.getUniqueName();
-            if (!portlets.containsKey(uniqueName))
-            {
-                portlets.put(uniqueName, id);
-                result.add(pd);              
-            }
-        }
-        return result;
-    }
-    
+
     public void processAction(ActionRequest request, ActionResponse actionResponse)
     throws PortletException, IOException
     {
-        List result = new ArrayList();
+        List<String> portlets = new ArrayList<String>();
         Enumeration e = request.getParameterNames();
         while (e.hasMoreElements())
         {
@@ -96,13 +72,13 @@ public class PortletTrackingPortlet exte
                 String[] values = request.getParameterValues(param);
                 if (values[0] != null)
                 {
-                    result.add(param);
+                    portlets.add(param);
                 }
             }
         }
-        if (result.size() > 0)
+        if (portlets.size() > 0)
         {            
-            trackingManager.putIntoService(result);
+            trackingManager.putIntoService(portlets);
         }
         
     }

Modified: portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.java?rev=1610063&r1=1610062&r2=1610063&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.java
Sat Jul 12 21:53:59 2014
@@ -16,17 +16,10 @@
  */
 package org.apache.jetspeed.portlets.tracking;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.portlet.PortletRequest;
-
 import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.aggregator.PortletTrackingInfo;
 import org.apache.jetspeed.aggregator.PortletTrackingManager;
-import org.apache.jetspeed.container.PortletWindow;
+import org.apache.jetspeed.components.portletregistry.PortletRegistry;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.wicket.RequestContext;
 import org.apache.wicket.markup.html.WebPage;
@@ -43,6 +36,10 @@ import org.apache.wicket.model.PropertyM
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.protocol.http.portlet.PortletRequestContext;
 
+import javax.portlet.PortletRequest;
+import java.util.ArrayList;
+import java.util.List;
+
 public class WicketPortletTrackingPortlet extends WebPage {
 
     private transient PortletTrackingManager trackingManager;
@@ -117,19 +114,11 @@ public class WicketPortletTrackingPortle
     protected List<PortletDefinition> createList()
     {
         List<PortletDefinition> result = new ArrayList<PortletDefinition>();
-        Iterator<PortletWindow> outOfService = trackingManager.getOutOfServiceList().iterator();
-        Map<String,String> portlets = new HashMap<String,String>();
-        while (outOfService.hasNext())
+        List<PortletTrackingInfo> outOfService = trackingManager.getOutOfServiceList();
+        for (PortletTrackingInfo info : outOfService)
         {
-            PortletWindow window = outOfService.next();
-            String id = window.getId().toString();
-            PortletDefinition pd = window.getPortletDefinition();
-            String uniqueName = pd.getUniqueName();
-            if (!portlets.containsKey(uniqueName))
-            {
-                portlets.put(uniqueName, id);
-                result.add(pd);              
-            }
+            PortletDefinition pd = getPortletRegistry().getPortletDefinitionByUniqueName(info.getFullPortletName());
+            result.add(pd);
         }
         return result;
     }
@@ -142,4 +131,9 @@ public class WicketPortletTrackingPortle
         return (PortletTrackingManager) getPortletRequest().getAttribute(CommonPortletServices.CPS_PORTLET_TRACKING_MANAGER);
     }
 
+    protected PortletRegistry getPortletRegistry()
+    {
+        return (PortletRegistry) getPortletRequest().getAttribute(CommonPortletServices.CPS_REGISTRY_COMPONENT);
+    }
+
 }

Modified: portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/webapp/WEB-INF/view/tracking/tracking.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/webapp/WEB-INF/view/tracking/tracking.vm?rev=1610063&r1=1610062&r2=1610063&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/webapp/WEB-INF/view/tracking/tracking.vm
(original)
+++ portals/jetspeed-2/applications/j2-admin/branches/J2-ADMIN-BRANCH-2.2.2-POST-RELEASE/src/main/webapp/WEB-INF/view/tracking/tracking.vm
Sat Jul 12 21:53:59 2014
@@ -21,7 +21,11 @@
 <input type="submit" name="refresh" value="Refresh" class="portlet-form-button"/>
 <input type="submit" name="checks" value="Put in Service" class="portlet-form-button"/>
 </p>
-<p>Count: $!count</p>
+#if($isEnabled)
+<p>Tracking Manager is Enabled. Out of Service Count: $!count</p>
+#else
+<p>The Tracking Manager is Disabled. To enable, set the property 'portal.core.aggregator.portlet.timeout'
in WEB-INF/conf/override.properties to a value in milliseconds greater than zero</p>
+#end
 <br/>
 
 <table cellpadding=0 cellspacing=1 border=0 width='100%' >
@@ -32,6 +36,9 @@
       <th align='center' class="portlet-section-header" nowrap>
         Portlet
       </th>
+      <th align='center' class="portlet-section-header" nowrap>
+          Windows
+      </th>
   </tr>
 #foreach ( $entry in $outOfService )
   <tr>
@@ -41,11 +48,15 @@
 #set($rowstyle = "portlet-section-alternate")
 #end  
     <td class="$rowstyle" width="10">
-        <input type="checkbox" name="$entry.UniqueName"/>
+        <input type="checkbox" name="$entry.FullPortletName"/>
     </td>
     <td class="$rowstyle" nowrap>
-      <div align="center">$entry.UniqueName</div>
+      <div align="center">$entry.FullPortletName</div>
     </td>
+      <td class="$rowstyle" nowrap>
+          <div align="center">$entry.Windows.size()</div>
+      </td>
+
    </tr>
 #end
 </table>



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