Author: brett Date: Fri Aug 3 09:12:21 2007 New Revision: 562514 URL: http://svn.apache.org/viewvc?view=rev&rev=562514 Log: [MRM-329] revised reporting actions Submitted by: Teodoro Cue
Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/jasperreports/ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/jasperreports/report.jrxml maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ShowReportsAction.java (with props) maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/blankReport.jsp (with props) maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/showReports.jsp (with props) Removed: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/jasperreports/report.jrxml URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/jasperreports/report.jrxml?view=auto&rev=562514 ============================================================================== --- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/jasperreports/report.jrxml (added) +++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/jasperreports/report.jrxml Fri Aug 3 09:12:21 2007 @@ -0,0 +1,170 @@ +<?xml version="1.0"?> +<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> +<jasperReport name="ArchivaReport" + pageWidth="1040"> + <field name="groupId" class="java.lang.String"/> + <field name="artifactId" class="java.lang.String"/> + <field name="version" class="java.lang.String"/> + <field name="message" class="java.lang.String"/> + <field name="origin" class="java.lang.String"/> + <field name="path" class="java.lang.String"/> + <field name="type" class="java.lang.String"/> + <field name="groupURL" class="java.lang.String"/> + <field name="artifactURL" class="java.lang.String"/> + <field name="prev" class="java.lang.String"/> + <field name="next" class="java.lang.String"/> + <field name="page" class="java.lang.Integer"/> + <field name="isLastPage" class="java.lang.Boolean"/> + <title> + <band height="50"> + <staticText> + <reportElement x="0" y="0" width="1040" height="50"/> + <textElement textAlignment="Center"> + <font size="14" isBold="true"/> + </textElement> + <text><![CDATA[Archiva Report]]></text> + </staticText> + </band> + </title> + <pageHeader> + <band></band> + </pageHeader> + <columnHeader> + <band height="20"> + <staticText> + <reportElement x="0" y="0" width="200" height="20"/> + <box leftBorder="Thin" + leftPadding="10" + rightBorder="Thin" + rightPadding="10" + topBorder="Thin" + bottomBorder="Thin"/> + <textElement textAlignment="Center"> + <font size="12"/> + </textElement> + <text><![CDATA[Group Id]]></text> + </staticText> + <staticText> + <reportElement x="200" y="0" width="200" height="20"/> + <box leftPadding="10" + rightBorder="Thin" + rightPadding="10" + topBorder="Thin" + bottomBorder="Thin"/> + <textElement textAlignment="Center"> + <font size="12"/> + </textElement> + <text><![CDATA[Artifact Id]]></text> + </staticText> + <staticText> + <reportElement x="400" y="0" width="200" height="20"/> + <box leftPadding="10" + rightBorder="Thin" + rightPadding="10" + topBorder="Thin" + bottomBorder="Thin"/> + <textElement textAlignment="Center"> + <font size="12"/> + </textElement> + <text><![CDATA[Version]]></text> + </staticText> + <staticText> + <reportElement x="600" y="0" width="300" height="20"/> + <box leftPadding="10" + rightBorder="Thin" + rightPadding="10" + topBorder="Thin" + bottomBorder="Thin"/> + <textElement textAlignment="Center"> + <font size="12"/> + </textElement> + <text><![CDATA[Message]]></text> + </staticText> + </band> + </columnHeader> + <detail> + <band height="20"> + <textField isBlankWhenNull="true" hyperlinkType="Reference" hyperlinkTarget="Self"> + <reportElement x="0" y="0" width="200" height="15"/> + <box leftBorder="Thin" + leftPadding="10" + rightBorder="Thin" + rightPadding="10" + bottomBorder="Thin"/> + <textFieldExpression> + <![CDATA[$F{groupId}]]> + </textFieldExpression> + <hyperlinkReferenceExpression><![CDATA[$F{groupURL}]]></hyperlinkReferenceExpression> + </textField> + <textField isBlankWhenNull="true" hyperlinkType="Reference" hyperlinkTarget="Self"> + <reportElement x="200" y="0" width="200" height="15"/> + <box leftPadding="10" + rightBorder="Thin" + rightPadding="10" + bottomBorder="Thin"/> + <textFieldExpression> + <![CDATA[$F{artifactId}]]> + </textFieldExpression> + <hyperlinkReferenceExpression><![CDATA[$F{artifactURL}]]></hyperlinkReferenceExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement x="400" y="0" width="200" height="15"/> + <box leftPadding="10" + rightBorder="Thin" + rightPadding="10" + bottomBorder="Thin"/> + <textFieldExpression> + <![CDATA[$F{version}]]> + </textFieldExpression> + </textField> + <textField isBlankWhenNull="true" isStretchWithOverflow="true"> + <reportElement x="600" y="0" width="300" height="15"/> + <box leftPadding="10" + rightBorder="Thin" + rightPadding="10" + bottomBorder="Thin"/> + <textFieldExpression> + <![CDATA[$F{message}]]> + </textFieldExpression> + </textField> + </band> + </detail> + <columnFooter> + <band></band> + </columnFooter> + <pageFooter> + <band height="15"> + <textField> + <reportElement x="0" y="0" width="50" height="15"/> + <textFieldExpression> + <![CDATA["Page: " + $F{page}]]> + </textFieldExpression> + </textField> + <textField hyperlinkType="Reference" hyperlinkTarget="Self"> + <reportElement x="50" y="0" width="50" height="15"> + <printWhenExpression> + <![CDATA[$F{page}.intValue() != 1]]> + </printWhenExpression> + </reportElement> + <textFieldExpression> + <![CDATA["prev"]]> + </textFieldExpression> + <hyperlinkReferenceExpression><![CDATA[$F{prev}]]></hyperlinkReferenceExpression> + </textField> + <textField hyperlinkType="Reference" hyperlinkTarget="Self"> + <reportElement x="100" y="0" width="50" height="15"> + <printWhenExpression> + <![CDATA[$F{isLastPage} != true]]> + </printWhenExpression> + </reportElement> + <textFieldExpression> + <![CDATA["next"]]> + </textFieldExpression> + <hyperlinkReferenceExpression><![CDATA[$F{next}]]></hyperlinkReferenceExpression> + </textField> + </band> + </pageFooter> + <summary> + <band></band> + </summary> +</jasperReport> Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ShowReportsAction.java URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ShowReportsAction.java?view=auto&rev=562514 ============================================================================== --- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ShowReportsAction.java (added) +++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ShowReportsAction.java Fri Aug 3 09:12:21 2007 @@ -0,0 +1,59 @@ +package org.apache.maven.archiva.web.action.reports; + +/* + * 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. + */ + +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.constraints.UniqueFieldConstraint; +import org.apache.maven.archiva.model.RepositoryProblem; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * Show reports. + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="showReportsAction" + */ +public class ShowReportsAction + extends PlexusActionSupport +{ + /** + * @plexus.requirement role-hint="jdo" + */ + protected ArchivaDAO dao; + + private Collection repositoryIds = new ArrayList(); + + public String execute() + throws Exception + { + repositoryIds.add( "" ); + repositoryIds.addAll( + dao.query( new UniqueFieldConstraint( RepositoryProblem.class.getName(), "repositoryId" ) ) ); + + return SUCCESS; + } + + public Collection getRepositoryIds() + { + return repositoryIds; + } +} Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ShowReportsAction.java ------------------------------------------------------------------------------ svn:eol-style = native Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/blankReport.jsp URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/blankReport.jsp?view=auto&rev=562514 ============================================================================== --- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/blankReport.jsp (added) +++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/blankReport.jsp Fri Aug 3 09:12:21 2007 @@ -0,0 +1,37 @@ +<%-- + ~ 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" %> + +<html> +<head> + <title>Reports</title> + <ww:head/> +</head> + +<body> +<h1>Reports</h1> + +<div id="contentArea"> + + <ww:text name="The operation generated an empty report."/> + +</div> +</body> +</html> Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/blankReport.jsp ------------------------------------------------------------------------------ svn:eol-style = native Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/showReports.jsp URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/showReports.jsp?view=auto&rev=562514 ============================================================================== --- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/showReports.jsp (added) +++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/showReports.jsp Fri Aug 3 09:12:21 2007 @@ -0,0 +1,43 @@ +<%-- + ~ 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" %> + +<html> +<head> + <title>Reports</title> + <ww:head/> +</head> + +<body> +<h1>Reports</h1> + +<div id="contentArea"> + + <ww:form action="generateReportAction" namespace="/report"> + <ww:textfield label="Row Count" name="rowCount" value="100"/> + <ww:textfield label="Group ID" name="groupId"/> + <ww:select label="Repository ID" name="repositoryId" list="repositoryIds"/> + <ww:submit value="Show Report"/> + </ww:form> + +</div> + +</body> +</html> Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/showReports.jsp ------------------------------------------------------------------------------ svn:eol-style = native