Index: src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.html
===================================================================
--- src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.html	(revision 0)
+++ src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.html	(revision 0)
@@ -0,0 +1,50 @@
+<!-- 
+  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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" >
+
+    <span wicket:id="header">List of Portlets out of Service:</span>
+
+    <form wicket:id="trackingForm">
+    
+        <input type="submit" wicket:id="refresh"/>
+        <input type="submit" wicket:id="putInService"/>
+    
+        <p>
+            <span wicket:id="countLabel">Count: </span>
+            <span wicket:id="count">count</span>
+        </p>
+        
+        <p>&nbsp;</p>
+    
+        <span wicket:id="checkGroup">
+	        <table cellpadding="2" cellspacing="2" border="0">
+	            <tr>
+	                <th width="30">
+	                    <input type="checkbox" wicket:id="groupSelector"/>
+	                </th>
+	                <th><span wicket:id="portletsLabel">Portlets</span></th>
+	            </tr>
+	            <tr wicket:id="portlets">
+	                <td><input type="checkbox" wicket:id="checkbox"/></td>
+	                <td><span wicket:id="name"></span></td>
+	            </tr>
+	        </table>
+        </span>
+
+    </form>
+
+</html>

Property changes on: src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Index: src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingApplication.java
===================================================================
--- src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingApplication.java	(revision 0)
+++ src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingApplication.java	(revision 0)
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+package org.apache.jetspeed.portlets.tracking;
+
+import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
+
+public class WicketPortletTrackingApplication extends AbstractAdminWebApplication {
+
+    @Override
+    public Class getHomePage() {
+        return WicketPortletTrackingPortlet.class;
+    }
+
+}

Property changes on: src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingApplication.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Index: src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.properties
===================================================================
--- src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.properties	(revision 0)
+++ src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.properties	(revision 0)
@@ -0,0 +1,20 @@
+# 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.
+
+tracker.header=List of Portlets out of Service:
+tracker.refresh=Refresh
+tracker.putInService=Put in service
+tracker.count=Count: 
+tracker.portlets=Portlets
\ No newline at end of file

Property changes on: src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Index: src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.java
===================================================================
--- src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.java	(revision 0)
+++ src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.java	(revision 0)
@@ -0,0 +1,145 @@
+/*
+ * 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.
+ */
+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.PortletTrackingManager;
+import org.apache.jetspeed.container.PortletWindow;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+import org.apache.wicket.RequestContext;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Check;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.form.CheckGroupSelector;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.PageableListView;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.protocol.http.portlet.PortletRequestContext;
+
+public class WicketPortletTrackingPortlet extends WebPage {
+
+    private transient PortletTrackingManager trackingManager;
+    private transient List<PortletDefinition> outOfService;
+
+    public WicketPortletTrackingPortlet() {
+        super();
+
+        trackingManager = getPortletTrackingManager();
+        outOfService = createList();
+     
+        add(new Label("header", new ResourceModel("tracker.header")));
+        
+        Form trackingForm = new Form("trackingForm");
+        add(trackingForm);
+
+        final CheckGroup<List> checkGroup = new CheckGroup<List>("checkGroup", new ArrayList());
+        trackingForm.add(checkGroup);
+        
+        Button refresh = new Button("refresh", new ResourceModel("tracker.refresh")) {
+
+            @Override
+            public void onSubmit() {
+                outOfService = createList();
+                checkGroup.getModelObject().clear();
+            }
+            
+        };
+        trackingForm.add(refresh);
+        
+        Button putInService = new Button("putInService", new ResourceModel("tracker.putInService")) {
+
+            @Override
+            public void onSubmit() {
+                List<String> portletNames = new ArrayList<String>();
+                List selection = (List) checkGroup.getModelObject();
+                for (Object object : selection) {
+                    PortletDefinition pd = (PortletDefinition) object;
+                    portletNames.add(pd.getUniqueName());
+                }
+                if (portletNames.size() > 0) {
+                    trackingManager.putIntoService(portletNames);
+                    outOfService = createList();
+                    checkGroup.getModelObject().clear();
+                }
+            }
+            
+        };
+        trackingForm.add(putInService);
+        
+        trackingForm.add(new Label("countLabel", new ResourceModel("tracker.count")));
+        Label countValue = new Label("count", new Model(outOfService.size()));
+        trackingForm.add(countValue);
+        
+        checkGroup.add(new Label("portletsLabel", new ResourceModel("tracker.portlets")));
+        
+        PageableListView portletsList = new PageableListView("portlets", new PropertyModel(this, "outOfService"), 10)
+        {
+            protected void populateItem(ListItem item)
+            {
+                final PortletDefinition portletDefinition = (PortletDefinition) item.getModelObject();
+                item.add(new Check("checkbox", item.getModel()));
+                item.add(new Label("name", new PropertyModel(portletDefinition, "uniqueName")));
+            }
+        };
+        
+        checkGroup.add(new CheckGroupSelector("groupSelector"));
+        checkGroup.add(portletsList);
+        
+    }
+
+    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())
+        {
+            PortletWindow window = outOfService.next();
+            String id = window.getId().toString();
+            PortletDefinition pd = (PortletDefinition)window.getPortletEntity().getPortletDefinition();
+            String uniqueName = pd.getUniqueName();
+            if (!portlets.containsKey(uniqueName))
+            {
+                portlets.put(uniqueName, id);
+                result.add(pd);              
+            }
+        }
+        return result;
+    }
+    
+    protected PortletRequest getPortletRequest() {
+        return ((PortletRequestContext) RequestContext.get()).getPortletRequest();
+    }
+
+    protected PortletTrackingManager getPortletTrackingManager() {
+        return (PortletTrackingManager) getPortletRequest().getAttribute(CommonPortletServices.CPS_PORTLET_TRACKING_MANAGER);
+    }
+
+}

Property changes on: src/main/java/org/apache/jetspeed/portlets/tracking/WicketPortletTrackingPortlet.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Index: src/webapp/WEB-INF/portlet.xml
===================================================================
--- src/webapp/WEB-INF/portlet.xml	(revision 738316)
+++ src/webapp/WEB-INF/portlet.xml	(working copy)
@@ -1618,15 +1618,15 @@
     <init-param>
         <name>portlet-icon</name>
         <value>user-home.png</value>
-    </init-param>              
+    </init-param>
     <init-param>
       <name>wicketFilterPath</name>
       <value>/portalSiteManager</value>
-    </init-param>
+    </init-param>        
     <init-param>
       <name>serviceComponentNames</name>
       <value>cps:PageManager,cps:PortletRegistryComponent,cps:DecorationFactory,cps:ImporterManager,cps:UserManager</value>
-    </init-param>    
+    </init-param>              
     <expiration-cache>0</expiration-cache>
     <supports>
         <mime-type>text/html</mime-type>
@@ -2194,12 +2194,37 @@
             <keywords>admin,profiler</keywords>            
         </portlet-info>
     </portlet>
+
+    <portlet>
+        <description>wicket portlet tracking portlet</description>
+        <portlet-name>WicketPortletTrackingPortlet</portlet-name>
+        <display-name>Wicket Portlet Tracking Portlet</display-name>
+        <portlet-class>org.apache.jetspeed.portlets.wicket.AdminWicketPortlet</portlet-class>
+        <init-param>
+            <name>wicketFilterPath</name>
+            <value>/portlettracking</value>
+        </init-param>
+        <init-param>
+            <name>serviceComponentNames</name>
+            <value>cps:PortletTrackingManager</value>
+        </init-param>
+        <supports>
+            <mime-type>*/*</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+        </supports>
+        <supported-locale>en</supported-locale>
+        <!--<resource-bundle>org.apache.jetspeed.portlets.security.JetspeedPrincipalManagementUsers</resource-bundle> -->
+        <portlet-info>
+            <title>Wicket Portlet Tracking Portlet</title>
+            <short-title>PortletTracking</short-title>
+            <keywords>admin,tracking</keywords>            
+        </portlet-info>
+    </portlet>
     
-    
     <custom-portlet-mode>
         <description>a Custom Edit_defaults Mode</description>            
         <portlet-mode>edit_defaults</portlet-mode>
-    </custom-portlet-mode>
-  
+   </custom-portlet-mode>
+    
 </portlet-app>
 
Index: src/webapp/WEB-INF/web.xml
===================================================================
--- src/webapp/WEB-INF/web.xml	(revision 738316)
+++ src/webapp/WEB-INF/web.xml	(working copy)
@@ -124,7 +124,16 @@
     </init-param>
   </filter>
 
-    <filter>
+  <filter>
+    <filter-name>WicketPortletTrackingPortletApplication</filter-name>
+    <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+    <init-param>
+      <param-name>applicationClassName</param-name>
+      <param-value>org.apache.jetspeed.portlets.tracking.WicketPortletTrackingApplication</param-value>
+    </init-param>
+  </filter>
+
+  <filter>
       <filter-name>PortalSiteManagerApplication</filter-name>
       <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
       <init-param>
@@ -139,7 +148,7 @@
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
     </filter-mapping>
-    
+
     <filter-mapping>
       <filter-name>JetspeedPrincipalManagementPortlet</filter-name>
       <url-pattern>/jetspeedPrincipalmanagement/*</url-pattern>
@@ -167,6 +176,13 @@
     <dispatcher>REQUEST</dispatcher>
     <dispatcher>INCLUDE</dispatcher>
   </filter-mapping>
+
+  <filter-mapping>
+    <filter-name>WicketPortletTrackingPortletApplication</filter-name>
+    <url-pattern>/portlettracking/*</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+    <dispatcher>INCLUDE</dispatcher>
+  </filter-mapping>
   
     <listener>
       <listener-class>org.apache.jetspeed.webapp.logging.Log4JConfigurator</listener-class>
