From f405f16e2d75b69dae7ccd56891122164559ab9e Mon Sep 17 00:00:00 2001 From: James William Dumay Date: Fri, 17 Oct 2008 08:35:26 +0000 Subject: [PATCH] Most jsp's working git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-struts2@705511 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-web/archiva-webapp/pom.xml | 54 ------------ .../action/reports/GenerateReportAction.java | 1 + .../archiva/web/tags/CopyPasteSnippetTag.java | 2 + .../archiva/web/tags/DownloadArtifact.java | 3 +- .../archiva/web/tags/DownloadArtifactTag.java | 17 +++- .../maven/archiva/web/tags/GroupIdLink.java | 4 +- .../archiva/web/tags/GroupIdLinkTag.java | 23 ++--- .../src/main/resources/struts.properties | 1 + .../src/main/resources/struts.xml | 7 -- .../src/main/resources/validators.xml | 5 ++ .../webapp/WEB-INF/jsp/admin/appearance.jsp | 2 +- .../jsp/admin/confirmAddRepository.jsp | 26 +++--- .../WEB-INF/jsp/admin/editAppearance.jsp | 6 +- .../jsp/admin/include/networkProxyForm.jspf | 12 +-- .../jsp/admin/include/proxyConnectorForm.jspf | 58 ++++++------ .../admin/include/remoteRepositoryForm.jspf | 14 +-- .../WEB-INF/jsp/admin/legacyArtifactPath.jsp | 2 +- .../WEB-INF/jsp/admin/networkProxies.jsp | 4 +- .../WEB-INF/jsp/admin/proxyConnectors.jsp | 26 +++--- .../webapp/WEB-INF/jsp/admin/repositories.jsp | 10 +-- .../WEB-INF/jsp/admin/repositoryScanning.jsp | 10 +-- .../webapp/WEB-INF/jsp/advancedSearch.jsp | 4 +- .../src/main/webapp/WEB-INF/jsp/browse.jsp | 12 +-- .../webapp/WEB-INF/jsp/browseArtifact.jsp | 6 +- .../main/webapp/WEB-INF/jsp/browseGroup.jsp | 10 +-- .../jsp/decorators/artifactDecorator.jsp | 2 +- .../main/webapp/WEB-INF/jsp/findArtifact.jsp | 2 +- .../jsp/include/artifactDependencies.jspf | 2 +- .../WEB-INF/jsp/include/artifactInfo.jspf | 20 ++--- .../WEB-INF/jsp/include/artifactReports.jspf | 2 +- .../WEB-INF/jsp/include/dependencyTree.jspf | 2 +- .../WEB-INF/jsp/include/mailingLists.jspf | 2 +- .../WEB-INF/jsp/include/projectDependees.jspf | 2 +- .../WEB-INF/jsp/include/uploadForm.jspf | 20 ++--- .../WEB-INF/jsp/reports/basicReport.jsp | 4 +- .../src/main/webapp/WEB-INF/jsp/results.jsp | 88 +++++++++---------- .../main/webapp/WEB-INF/tags/currentWWUrl.tag | 2 +- .../webapp/WEB-INF/tags/showArtifactLink.tag | 18 ++-- .../webapp/WEB-INF/tags/showArtifactTitle.tag | 20 ++--- pom.xml | 2 +- 40 files changed, 233 insertions(+), 274 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml index eaccde728..5c6a5a8f7 100644 --- a/archiva-modules/archiva-web/archiva-webapp/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml @@ -284,8 +284,6 @@ WEB-INF/temp - WEB-INF/jasperreports - @@ -478,57 +476,5 @@ - - - jasper - - - jasperreports - jasperreports - 1.2.0 - - - - - - org.codehaus.mojo - jasperreports-maven-plugin - 1.0-SNAPSHOT - - - compile - - compile-reports - - - - - src/main/webapp/WEB-INF/jasperreports - - - - - - - Codehaus Snapshots - http://snapshots.repository.codehaus.org/ - - true - - - false - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java index e65f3a181..cb90bc185 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java @@ -104,6 +104,7 @@ public class GenerateReportAction return repositoryIds; } + @Override public String execute() throws Exception { diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/CopyPasteSnippetTag.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/CopyPasteSnippetTag.java index 0a18effe6..61afc3fe4 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/CopyPasteSnippetTag.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/CopyPasteSnippetTag.java @@ -51,12 +51,14 @@ public class CopyPasteSnippetTag public static final String TOGGLE = "toggle"; + @Override public void release() { object = null; super.release(); } + @Override public int doEndTag() throws JspException { diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java index 8db360632..ff3b86ac4 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java @@ -21,7 +21,6 @@ package org.apache.maven.archiva.web.tags; import org.apache.struts2.StrutsException; import org.apache.struts2.components.Component; -import com.opensymphony.xwork2.util.OgnlValueStack; import com.opensymphony.xwork2.util.ValueStack; import org.apache.commons.lang.StringEscapeUtils; @@ -111,7 +110,7 @@ public class DownloadArtifact Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version ); List relatedArtifacts = dao.getArtifactDAO().queryArtifacts( constraint ); - if ( relatedArtifacts != null ) + if ( relatedArtifacts != null && relatedArtifacts.size() > 0 ) { String repoId = ( (ArchivaArtifact) relatedArtifacts.get( 0 ) ).getModel().getRepositoryId(); ManagedRepositoryContent repo = repositoryFactory.getManagedRepositoryContent( repoId ); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifactTag.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifactTag.java index 9b372cf5e..12dd48570 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifactTag.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifactTag.java @@ -19,10 +19,15 @@ package org.apache.maven.archiva.web.tags; * under the License. */ +import com.opensymphony.xwork2.util.ValueStack; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.struts2.components.Component; import org.apache.struts2.views.jsp.TagUtils; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; +import org.apache.struts2.views.jsp.ComponentTagSupport; /** * DownloadArtifactTag @@ -31,7 +36,7 @@ import javax.servlet.jsp.tagext.TagSupport; * @version $Id$ */ public class DownloadArtifactTag - extends TagSupport + extends ComponentTagSupport { private String groupId_; // stores EL-based groupId property @@ -49,19 +54,23 @@ public class DownloadArtifactTag private boolean mini; // stores the evaluated mini object. + @Override + public Component getBean(ValueStack valueStack, HttpServletRequest request, HttpServletResponse response) { + return new DownloadArtifact(valueStack, pageContext); + } + + @Override public int doEndTag() throws JspException { evaluateExpressions(); - DownloadArtifact download = new DownloadArtifact( TagUtils.getStack( pageContext ), pageContext ); + DownloadArtifact download = (DownloadArtifact)component; download.setGroupId( groupId ); download.setArtifactId( artifactId ); download.setVersion( version ); download.setMini( mini ); - download.end( pageContext.getOut(), "" ); - return super.doEndTag(); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java index 6593e1639..d92bb7fb5 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java @@ -114,14 +114,14 @@ public class GroupIdLink private String determineBrowseActionUrl() { - return determineActionURL( "browse", NAMESPACE, method, req, res, parameters, req.getScheme(), includeContext, encode ); + return determineActionURL( "browse", NAMESPACE, method, req, res, parameters, req.getScheme(), includeContext, encode, false, false ); } private String determineBrowseGroupActionUrl( String gid ) { parameters.put( "groupId", gid ); - return determineActionURL( ACTION, NAMESPACE, method, req, res, parameters, req.getScheme(), includeContext, encode ); + return determineActionURL( ACTION, NAMESPACE, method, req, res, parameters, req.getScheme(), includeContext, encode, false, false ); } public String getGroupId() diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java index 39a8d0f40..b76ce44bd 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java @@ -19,12 +19,13 @@ package org.apache.maven.archiva.web.tags; * under the License. */ -import org.apache.struts2.views.jsp.TagUtils; +import com.opensymphony.xwork2.util.ValueStack; +import org.apache.struts2.components.Component; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.jsp.JspException; -import javax.servlet.jsp.tagext.TagSupport; +import org.apache.struts2.views.jsp.ComponentTagSupport; /** * GroupIdLink @@ -33,7 +34,7 @@ import javax.servlet.jsp.tagext.TagSupport; * @version $Id$ */ public class GroupIdLinkTag - extends TagSupport + extends ComponentTagSupport { private String var_; // stores EL-based property @@ -41,6 +42,11 @@ public class GroupIdLinkTag private boolean includeTop = false; + @Override + public Component getBean(ValueStack valueStack, HttpServletRequest request, HttpServletResponse response) { + return new GroupIdLink( valueStack, request, response ); + } + @Override public void release() { @@ -56,14 +62,11 @@ public class GroupIdLinkTag throws JspException { evaluateExpressions(); + + GroupIdLink groupIdLink = (GroupIdLink)component; - GroupIdLink gidlink = new GroupIdLink( TagUtils.getStack( pageContext ), (HttpServletRequest) pageContext - .getRequest(), (HttpServletResponse) pageContext.getResponse() ); - - gidlink.setGroupId( var ); - gidlink.setIncludeTop( includeTop ); - - gidlink.end( pageContext.getOut(), "" ); + groupIdLink.setGroupId( var ); + groupIdLink.setIncludeTop( includeTop ); return super.doEndTag(); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties index 524cdb3fe..6f76d3f89 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties @@ -23,6 +23,7 @@ struts.objectFactory = org.codehaus.plexus.spring.Struts2PlexusInSpringObjectFa struts.url.includeParams = none struts.devMode = true +struts.configuration.xml.reload=true struts.multipart.parser=jakarta # TODO: package up a theme and share with Continuum. Should contain everything from xhtml, and set templateDir to WEB-INF/themes diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml index b5fb01de7..8c867863c 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml @@ -493,23 +493,16 @@ - diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml index 65b4ca2c3..d126e2a3b 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml @@ -1,4 +1,9 @@ + + +