You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by jo...@apache.org on 2007/11/06 00:41:32 UTC

svn commit: r592186 - in /maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main: java/org/apache/maven/archiva/web/action/ resources/ webapp/WEB-INF/jsp/

Author: joakime
Date: Mon Nov  5 15:41:29 2007
New Revision: 592186

URL: http://svn.apache.org/viewvc?rev=592186&view=rev
Log:
Adding "You have access to no repositories" screen.


Added:
    maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java   (with props)
    maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/accessToNoRepos.jsp   (with props)
Modified:
    maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java
    maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java
    maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/resources/xwork.xml

Modified: maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java?rev=592186&r1=592185&r2=592186&view=diff
==============================================================================
--- maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java (original)
+++ maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java Mon Nov  5 15:41:29 2007
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.database.browsing.BrowsingResults;
 import org.apache.maven.archiva.database.browsing.RepositoryBrowsing;
@@ -66,7 +67,13 @@
 
     public String browse()
     {
-        this.results = repoBrowsing.getRoot( getPrincipal(), getObservableRepos() );
+        List<String> selectedRepos = getObservableRepos();
+        if ( CollectionUtils.isEmpty( selectedRepos ) )
+        {
+            return GlobalResults.ACCESS_TO_NO_REPOS;
+        }
+
+        this.results = repoBrowsing.getRoot( getPrincipal(), selectedRepos );
         return SUCCESS;
     }
 
@@ -79,7 +86,14 @@
             return ERROR;
         }
 
-        this.results = repoBrowsing.selectGroupId( getPrincipal(), getObservableRepos(), groupId );
+        List<String> selectedRepos = getObservableRepos();
+        if ( CollectionUtils.isEmpty( selectedRepos ) )
+        {
+            return GlobalResults.ACCESS_TO_NO_REPOS;
+        }
+
+        
+        this.results = repoBrowsing.selectGroupId( getPrincipal(), selectedRepos, groupId );
         return SUCCESS;
     }
 
@@ -99,7 +113,14 @@
             return ERROR;
         }
 
-        this.results = repoBrowsing.selectArtifactId( getPrincipal(), getObservableRepos(), groupId, artifactId );
+        List<String> selectedRepos = getObservableRepos();
+        if ( CollectionUtils.isEmpty( selectedRepos ) )
+        {
+            return GlobalResults.ACCESS_TO_NO_REPOS;
+        }
+
+        
+        this.results = repoBrowsing.selectArtifactId( getPrincipal(), selectedRepos, groupId, artifactId );
         return SUCCESS;
     }
     

Added: maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java?rev=592186&view=auto
==============================================================================
--- maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java (added)
+++ maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java Mon Nov  5 15:41:29 2007
@@ -0,0 +1,31 @@
+package org.apache.maven.archiva.web.action;
+
+/*
+ * 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.
+ */
+
+/**
+ * GlobalResults - constants for global result definitions. 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class GlobalResults
+{
+    public static final String ACCESS_TO_NO_REPOS = "access_to_no_repos";
+}

Propchange: maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java?rev=592186&r1=592185&r2=592186&view=diff
==============================================================================
--- maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java (original)
+++ maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java Mon Nov  5 15:41:29 2007
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.Constraint;
@@ -95,8 +96,14 @@
         assert q != null && q.length() != 0;
 
         SearchResultLimits limits = new SearchResultLimits( 0 );
+        
+        List<String> selectedRepos = getObservableRepos();
+        if ( CollectionUtils.isEmpty( selectedRepos ) )
+        {
+            return GlobalResults.ACCESS_TO_NO_REPOS;
+        }
 
-        results = crossRepoSearch.searchForTerm( getPrincipal(), getObservableRepos(), q, limits );
+        results = crossRepoSearch.searchForTerm( getPrincipal(), selectedRepos, q, limits );
 
         if ( results.isEmpty() )
         {

Modified: maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/resources/xwork.xml?rev=592186&r1=592185&r2=592186&view=diff
==============================================================================
--- maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/resources/xwork.xml (original)
+++ maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/resources/xwork.xml Mon Nov  5 15:41:29 2007
@@ -82,6 +82,7 @@
 
     <global-results>
       <!-- The following security-* result names arrive from the plexus-security package -->
+      
       <result name="security-login-success" type="redirect-action">index</result>
       <result name="security-login-cancel" type="redirect-action">index</result>
       <result name="security-login-locked" type="redirect-action">
@@ -126,6 +127,7 @@
       <!-- Generic Catchall for those action configurations that forget to
            include a result for 'error' -->
       <result name="error">/WEB-INF/jsp/generalError.jsp</result>
+      <result name="access_to_no_repos">/WEB-INF/jsp/accessToNoRepos.jsp</result>
     </global-results>
   </package>
 

Added: maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/accessToNoRepos.jsp
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/accessToNoRepos.jsp?rev=592186&view=auto
==============================================================================
--- maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/accessToNoRepos.jsp (added)
+++ maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/accessToNoRepos.jsp Mon Nov  5 15:41:29 2007
@@ -0,0 +1,46 @@
+<%--
+  ~ 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.
+  --%>
+
+<%@ taglib prefix="ww" uri="/webwork" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+<head>
+  <title>You have access to no repositories</title>
+  <ww:head/>
+</head>
+
+<body>
+
+<div id="contentArea">
+  
+   <div id="results">
+     You have access to no repositories.  
+     Ask your system administrator for access.  
+   </div>
+  
+</div>
+
+<div class="clear">
+  <hr/>
+</div>
+
+</body>
+
+</html>

Propchange: maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/accessToNoRepos.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/branches/archiva-backend-security/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/accessToNoRepos.jsp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"