You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2005/03/23 17:01:45 UTC

svn commit: r158787 - in lenya/trunk/src: java/org/apache/lenya/cms/ac/usecases/IPRanges.java webapp/WEB-INF/cocoon-xconf.xsl webapp/lenya/usecases/admin/ipRanges.jx webapp/lenya/usecases/tab/tabs.jx

Author: andreas
Date: Wed Mar 23 08:01:43 2005
New Revision: 158787

URL: http://svn.apache.org/viewcvs?view=rev&rev=158787
Log:
added IP range overview usecase

Added:
    lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/IPRanges.java
    lenya/trunk/src/webapp/lenya/usecases/admin/ipRanges.jx
Modified:
    lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl
    lenya/trunk/src/webapp/lenya/usecases/tab/tabs.jx

Added: lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/IPRanges.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/IPRanges.java?view=auto&rev=158787
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/IPRanges.java (added)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/IPRanges.java Wed Mar 23 08:01:43 2005
@@ -0,0 +1,47 @@
+/*
+ * Copyright  1999-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.lenya.cms.ac.usecases;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.lenya.ac.IPRange;
+
+/**
+ * Manage IP ranges.
+ * 
+ * @version $Id:$
+ */
+public class IPRanges extends AccessControlUsecase {
+
+    protected static final String IP_RANGES = "ipRanges";
+
+    /**
+     * @see org.apache.lenya.cms.usecase.AbstractUsecase#initParameters()
+     */
+    protected void initParameters() {
+        super.initParameters();
+
+        IPRange[] ipRanges = getIpRangeManager().getIPRanges();
+        List ipRangeList = new ArrayList();
+        ipRangeList.addAll(Arrays.asList(ipRanges));
+        Collections.sort(ipRangeList);
+        setParameter(IP_RANGES, ipRangeList);
+    }
+}

Modified: lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl?view=diff&r1=158786&r2=158787
==============================================================================
--- lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl (original)
+++ lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl Wed Mar 23 08:01:43 2005
@@ -276,6 +276,10 @@
     <component-instance name="admin.deleteGroup" logger="lenya.admin" class="org.apache.lenya.cms.ac.usecases.DeleteGroup">
       <view template="admin/deleteGroup" menu="true"/>
     </component-instance>
+    <component-instance name="admin.ipRanges" logger="lenya.admin" class="org.apache.lenya.cms.ac.usecases.IPRanges">
+      <view template="admin/ipRanges" menu="true"/>
+    </component-instance>
+
     <!--
     <component-instance name="admin.addIPRange" logger="lenya.admin" class="org.apache.lenya.cms.ac.usecases.AddIPRange"/>
     <component-instance name="admin.ipRangeProfileProfile" logger="lenya.admin" class="org.apache.lenya.cms.ac.usecases.IPRangeProfile"/>

Added: lenya/trunk/src/webapp/lenya/usecases/admin/ipRanges.jx
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/usecases/admin/ipRanges.jx?view=auto&rev=158787
==============================================================================
--- lenya/trunk/src/webapp/lenya/usecases/admin/ipRanges.jx (added)
+++ lenya/trunk/src/webapp/lenya/usecases/admin/ipRanges.jx Wed Mar 23 08:01:43 2005
@@ -0,0 +1,67 @@
+<page:page
+  xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+  xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
+  >
+  
+  <jx:import uri="tab/head.jx"/>
+  <page:body>
+    <jx:import uri="admin/tabs.jx"/>
+    <div id="contentblock1" class="lenya-tab">
+    
+      <table class="lenya-table-noborder">
+        <tr>
+          <td colspan="2">
+            <jx:import uri="templates/messages.jx"/>
+          </td>
+        </tr>
+      </table>
+      
+      <div style="margin: 10px 0px">
+        <table class="lenya-table-noborder">
+      	  <tr>
+      	    <td>
+              <form method="GET">
+                <input type="hidden" name="lenya.usecase" value="admin.addIPRange"/>
+                <input i18n:attr="value" type="submit" value="Add IP Range"/>
+              </form>
+            </td>
+          </tr>
+        </table>
+      </div>
+      
+      <table cellspacing="0" class="lenya-table">
+        <tr>
+          <th><i18n:text>IP Range ID</i18n:text></th>
+          <th><i18n:text>Name</i18n:text></th>
+          <th><i18n:text>Groups</i18n:text></th>
+          <th></th>
+        </tr>
+        <jx:forEach var="ipRange" items="${usecase.getParameter('ipRanges')}">
+          <tr>
+            <td style="vertical-align: middle">
+              <a href="${request.contextPath}${request.requestURI}?lenya.usecase=admin.ipRangeProfile&amp;ipRangeId=${ipRange.getId()}"><jx:out value="${ipRange.getId()}"/></a>
+            </td>
+            <td style="vertical-align: middle">
+              <jx:out value="${ipRange.getName()}"/>
+            </td>
+            <td>
+              <jx:forEach var="group" items="${ipRange.getGroups()}">
+                <a href="${request.contextPath}${request.requestURI}?lenya.usecase=admin.groupProfile&amp;groupId=${group.getId()}"><jx:out value="${group.getId()}"/></a>
+              </jx:forEach>
+            </td>
+            <td style="vertical-align: middle">
+              <form method="GET">
+                <input type="hidden" name="lenya.usecase" value="admin.deleteIPRange"/>
+                <input name="ipRangeId" type="hidden" value="${ipRange.getId()}"/>
+                <input i18n:attr="value" type="submit" value="Delete"/>
+              </form>
+            </td>
+          </tr>
+        </jx:forEach>
+      </table>
+        
+  </div>
+  </page:body>
+</page:page>
\ No newline at end of file

Modified: lenya/trunk/src/webapp/lenya/usecases/tab/tabs.jx
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/usecases/tab/tabs.jx?view=diff&r1=158786&r2=158787
==============================================================================
--- lenya/trunk/src/webapp/lenya/usecases/tab/tabs.jx (original)
+++ lenya/trunk/src/webapp/lenya/usecases/tab/tabs.jx Wed Mar 23 08:01:43 2005
@@ -23,10 +23,6 @@
   xmlns="http://www.w3.org/1999/xhtml"
   name="">
   
-    <!-- 
-		These are the tabs. Make sure that each of them has the correct id,
-		target and corresponding number in the Tab() call.
-	 -->
 	<div class="lenya-tabs">
     <table border="0" cellpadding="0" cellspacing="0">
       <tr>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org