--- /dev/null
+package org.apache.maven.archiva.model;
+
+public class RepositoryProblemReport extends RepositoryProblem
+{
+ protected String groupURL;
+
+ protected String artifactURL;
+
+ protected String versionURL;
+
+ public RepositoryProblemReport( RepositoryProblem repositoryProblem )
+ {
+ setGroupId( repositoryProblem.getGroupId() );
+ setArtifactId( repositoryProblem.getArtifactId() );
+ setVersion( repositoryProblem.getVersion() );
+ setMessage( repositoryProblem.getMessage() );
+ setOrigin( repositoryProblem.getOrigin() );
+ setPath( repositoryProblem.getPath() );
+ setType( repositoryProblem.getType() );
+ }
+
+ public void setGroupURL( String groupURL )
+ {
+ this.groupURL = groupURL;
+ }
+
+ public String getGroupURL()
+ {
+ return groupURL;
+ }
+
+ public void setArtifactURL( String artifactURL )
+ {
+ this.artifactURL = artifactURL;
+ }
+
+ public String getArtifactURL()
+ {
+ return artifactURL;
+ }
+
+ public void setVersionURL( String versionURL )
+ {
+ this.versionURL = versionURL;
+ }
+
+ public String getVersionURL()
+ {
+ return versionURL;
+ }
+}
* @return the equivalent of the SELECT WHERE (condition) value for this constraint. (can be null)
*/
public abstract String getWhereCondition();
+
+ /**
+ * Get the declared range used for this query. (optional)
+ *
+ * NOTE: This is DAO implementation specific.
+ *
+ * @return the range. (can be null)
+ */
+ public abstract int[] getRange();
}
\ No newline at end of file
protected Object[] params;
+ protected int[] range;
+
public String getFilter()
{
return null;
{
return variables;
}
+
+ public int[] getRange()
+ {
+ return range;
+ }
}
--- /dev/null
+package org.apache.maven.archiva.database.constraints;
+
+/*
+ * 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.Constraint;
+
+/**
+ * RangeConstraint
+ */
+public class RangeConstraint
+ extends AbstractDeclarativeConstraint
+ implements Constraint
+{
+ public RangeConstraint( int[] range )
+ {
+ this.range = range;
+ }
+
+ public String getSortColumn()
+ {
+ return null;
+ }
+
+ public String getWhereCondition()
+ {
+ return null;
+ }
+}
--- /dev/null
+package org.apache.maven.archiva.database.constraints;
+
+/*
+ * 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.Constraint;
+
+/**
+ * RepositoryProblemByArtifactIdConstraint
+ */
+public class RepositoryProblemByArtifactIdConstraint extends RangeConstraint implements Constraint
+{
+ private String whereClause;
+
+ public RepositoryProblemByArtifactIdConstraint( int[] range, String desiredArtifactId )
+ {
+ super( range );
+ whereClause = "artifactId == desiredArtifactId";
+ declParams = new String[] { "String desiredArtifactId" };
+ params = new Object[] { desiredArtifactId };
+ }
+
+ public String getSortColumn()
+ {
+ return "groupId";
+ }
+
+ public String getWhereCondition()
+ {
+ return whereClause;
+ }
+}
--- /dev/null
+package org.apache.maven.archiva.database.constraints;
+
+/*
+ * 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.Constraint;
+
+/**
+ * RepositoryProblemByGroupIdConstraint
+ */
+public class RepositoryProblemByGroupIdConstraint extends RangeConstraint implements Constraint
+{
+ private String whereClause;
+
+ public RepositoryProblemByGroupIdConstraint( int[] range, String desiredGroupId )
+ {
+ super( range );
+ whereClause = "groupId == desiredGroupId";
+ declParams = new String[] { "String desiredGroupId" };
+ params = new Object[] { desiredGroupId };
+ }
+
+ public String getSortColumn()
+ {
+ return "artifactId";
+ }
+
+ public String getWhereCondition()
+ {
+ return whereClause;
+ }
+}
--- /dev/null
+package org.apache.maven.archiva.database.constraints;
+
+/*
+ * 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.Constraint;
+
+/**
+ * RepositoryProblemByRepositoryIdConstraint
+ */
+public class RepositoryProblemByRepositoryIdConstraint extends RangeConstraint implements Constraint
+{
+ private String whereClause;
+
+ public RepositoryProblemByRepositoryIdConstraint( int[] range, String desiredRepositoryId )
+ {
+ super( range );
+ whereClause = "repositoryId == desiredRepositoryId";
+ declParams = new String[] { "String desiredRepositoryId" };
+ params = new Object[] { desiredRepositoryId };
+ }
+
+ public String getSortColumn()
+ {
+ return "groupId";
+ }
+
+ public String getWhereCondition()
+ {
+ return whereClause;
+ }
+}
query.declareImports( StringUtils.join( constraint.getDeclaredImports(), ", " ) );
}
+ if ( constraint.getRange() != null )
+ {
+ query.setRange( constraint.getRange()[0], constraint.getRange()[1] );
+ }
+
if ( constraint.getDeclaredParameters() != null )
{
if ( constraint.getParameters() == null )
<artifactId>activation</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>jasperreports</groupId>
+ <artifactId>jasperreports</artifactId>
+ <version>1.2.0</version>
+ </dependency>
</dependencies>
<build>
<plugins>
<!-- Directory created by jetty:run -->
<include>WEB-INF/temp</include>
<!-- Directory created by jetty:run -->
+ <include>WEB-INF/jasperreports</include>
+ <!-- Directory created by jasperreports-maven-plugin -->
</includes>
</fileset>
</filesets>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jasperreports-maven-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile-reports</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <targetDirectory>src/main/webapp/WEB-INF/jasperreports</targetDirectory>
+ </configuration>
+ </plugin>
</plugins>
</build>
<profiles>
</build>
</profile>
</profiles>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>Codehaus Snapshots</id>
+ <url>http://snapshots.repository.codehaus.org/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
</project>
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
+<jasperReport name="ArchivaReport"
+ pageWidth="1800">
+ <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="versionURL" 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="2240" height="50"/>
+ <textElement textAlignment="Center">
+ <font size="14" isBold="true"/>
+ </textElement>
+ <text><![CDATA[All Problematic Artifacts]]></text>
+ </staticText>
+ </band>
+ </title>
+ <pageHeader>
+ <band></band>
+ </pageHeader>
+ <columnHeader>
+ <band height="20">
+ <staticText>
+ <reportElement x="0" y="0" width="300" 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="300" 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[Artifact Id]]></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[Version]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="900" 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>
+ <staticText>
+ <reportElement x="1200" 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[Origin]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="1500" 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[Repository Path]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="1800" 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[Type]]></text>
+ </staticText>
+ </band>
+ </columnHeader>
+ <detail>
+ <band height="20">
+ <textField isBlankWhenNull="true" hyperlinkType="Reference" hyperlinkTarget="Self">
+ <reportElement x="0" y="0" width="300" 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="300" y="0" width="300" 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" hyperlinkType="Reference" hyperlinkTarget="Self">
+ <reportElement x="600" y="0" width="300" height="15"/>
+ <box leftPadding="10"
+ rightBorder="Thin"
+ rightPadding="10"
+ bottomBorder="Thin"/>
+ <textFieldExpression>
+ <![CDATA[$F{version}]]>
+ </textFieldExpression>
+ <hyperlinkReferenceExpression><![CDATA[$F{versionURL}]]></hyperlinkReferenceExpression>
+ </textField>
+ <textField isBlankWhenNull="true" isStretchWithOverflow="true">
+ <reportElement x="900" y="0" width="300" height="15"/>
+ <box leftPadding="10"
+ rightBorder="Thin"
+ rightPadding="10"
+ bottomBorder="Thin"/>
+ <textFieldExpression>
+ <![CDATA[$F{message}]]>
+ </textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement x="1200" y="0" width="300" height="15"/>
+ <box leftPadding="10"
+ rightBorder="Thin"
+ rightPadding="10"
+ bottomBorder="Thin"/>
+ <textFieldExpression>
+ <![CDATA[$F{origin}]]>
+ </textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true" isStretchWithOverflow="true">
+ <reportElement x="1500" y="0" width="300" height="15"/>
+ <box leftPadding="10"
+ rightBorder="Thin"
+ rightPadding="10"
+ bottomBorder="Thin"/>
+ <textFieldExpression>
+ <![CDATA[$F{path}]]>
+ </textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement x="1800" y="0" width="300" height="15"/>
+ <box leftPadding="10"
+ rightBorder="Thin"
+ rightPadding="10"
+ bottomBorder="Thin"/>
+ <textFieldExpression>
+ <![CDATA[$F{type}]]>
+ </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>
--- /dev/null
+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 java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.maven.archiva.database.ArchivaDAO;
+import org.apache.maven.archiva.database.Constraint;
+import org.apache.maven.archiva.model.RepositoryProblem;
+import org.apache.maven.archiva.model.RepositoryProblemReport;
+import org.apache.maven.archiva.security.ArchivaRoleConstants;
+import org.codehaus.plexus.redback.rbac.Resource;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureAction;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException;
+import org.codehaus.plexus.xwork.action.PlexusActionSupport;
+
+import com.opensymphony.webwork.interceptor.ServletRequestAware;
+
+/**
+ * Abstract reporting.
+ */
+public abstract class AbstractReportAction extends PlexusActionSupport implements SecureAction, ServletRequestAware
+{
+ /**
+ * @plexus.requirement role-hint="jdo"
+ */
+ protected ArchivaDAO dao;
+
+ protected Constraint constraint;
+
+ protected HttpServletRequest request;
+
+ protected List reports = new ArrayList();
+
+ protected String prev;
+
+ protected String next;
+
+ protected int[] range = new int[2];
+
+ protected int page = 1;
+
+ protected int rowCount = 100;
+
+ protected boolean isLastPage = false;
+
+ public static final String BLANK = "blank";
+
+ public String execute() throws Exception
+ {
+ range[0] = ( page - 1 ) * rowCount;
+ range[1] = ( page * rowCount ) + 1; // Add 1 to check if it's the last page or not.
+
+ configureConstraint();
+ List problemArtifacts = dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint );
+
+ String contextPath =
+ request.getRequestURL().substring( 0, request.getRequestURL().indexOf( request.getRequestURI() ) );
+ RepositoryProblem problemArtifact;
+ RepositoryProblemReport problemArtifactReport;
+ for ( int i = 0; i < problemArtifacts.size(); i++ )
+ {
+ problemArtifact = (RepositoryProblem) problemArtifacts.get( i );
+ problemArtifactReport = new RepositoryProblemReport( problemArtifact );
+
+ problemArtifactReport.setGroupURL( contextPath + "/browse/" + problemArtifact.getGroupId() );
+ problemArtifactReport.setArtifactURL( contextPath + "/browse/" + problemArtifact.getGroupId() + "/"
+ + problemArtifact.getArtifactId() );
+ problemArtifactReport.setVersionURL( contextPath + "/browse/" + problemArtifact.getGroupId() + "/"
+ + problemArtifact.getArtifactId() + "/" + problemArtifact.getVersion() );
+
+ reports.add( problemArtifactReport );
+ }
+
+ if ( reports.size() <= rowCount )
+ {
+ isLastPage = true;
+ }
+ else
+ {
+ reports.remove( rowCount );
+ }
+
+ prev = request.getRequestURL() + "?page=" + ( page - 1 ) + "&rowCount=" + rowCount;
+ next = request.getRequestURL() + "?page=" + ( page + 1 ) + "&rowCount=" + rowCount;
+
+ if ( reports.size() == 0 && page == 1 )
+ {
+ return BLANK;
+ }
+ else
+ {
+ return SUCCESS;
+ }
+ }
+
+ /**
+ * To be implemented by sub-reports to configure specific constraints.
+ */
+ abstract protected void configureConstraint();
+
+ public void setServletRequest( HttpServletRequest request )
+ {
+ this.request = request;
+ }
+
+ public List getReports()
+ {
+ return reports;
+ }
+
+ public String getPrev()
+ {
+ return prev;
+ }
+
+ public String getNext()
+ {
+ return next;
+ }
+
+ public int getPage()
+ {
+ return page;
+ }
+
+ public void setPage( int page )
+ {
+ this.page = page;
+ }
+
+ public int getRowCount()
+ {
+ return rowCount;
+ }
+
+ public void setRowCount( int rowCount )
+ {
+ this.rowCount = rowCount;
+ }
+
+ public boolean getIsLastPage()
+ {
+ return isLastPage;
+ }
+
+ public SecureActionBundle getSecureActionBundle() throws SecureActionException
+ {
+ SecureActionBundle bundle = new SecureActionBundle();
+
+ bundle.setRequiresAuthentication( true );
+ bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_ACCESS_REPORT, Resource.GLOBAL );
+
+ return bundle;
+ }
+}
--- /dev/null
+package org.apache.maven.archiva.web.action.reports;
+
+import org.apache.maven.archiva.database.constraints.RangeConstraint;
+
+/*
+ * 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.
+ */
+
+/**
+ * All problematic artifacts reporting.
+ *
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="allProblematicArtifactsAction"
+ */
+public class AllProblematicArtifactsAction extends AbstractReportAction
+{
+ protected void configureConstraint()
+ {
+ this.constraint = new RangeConstraint( range );
+ }
+}
--- /dev/null
+package org.apache.maven.archiva.web.action.reports;
+
+import org.apache.maven.archiva.database.constraints.RepositoryProblemByArtifactIdConstraint;
+
+/*
+ * 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.
+ */
+
+/**
+ * By artifact id reporting.
+ *
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="reportsByArtifactIdAction"
+ */
+public class ReportsByArtifactIdAction extends AbstractReportAction
+{
+ private String artifactId;
+
+ protected void configureConstraint()
+ {
+ this.constraint = new RepositoryProblemByArtifactIdConstraint( range, artifactId );
+ }
+
+ public void setArtifactId( String artifactId )
+ {
+ this.artifactId = artifactId;
+ }
+}
--- /dev/null
+package org.apache.maven.archiva.web.action.reports;
+
+import org.apache.maven.archiva.database.constraints.RangeConstraint;
+import org.apache.maven.archiva.database.constraints.RepositoryProblemByGroupIdConstraint;
+
+/*
+ * 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.
+ */
+
+/**
+ * By group id reporting.
+ *
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="reportsByGroupIdAction"
+ */
+public class ReportsByGroupIdAction extends AbstractReportAction
+{
+ private String groupId;
+
+ protected void configureConstraint()
+ {
+ this.constraint = new RepositoryProblemByGroupIdConstraint( range, groupId );
+ }
+
+ public void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+}
--- /dev/null
+package org.apache.maven.archiva.web.action.reports;
+
+import org.apache.maven.archiva.database.constraints.RepositoryProblemByRepositoryIdConstraint;
+
+/*
+ * 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.
+ */
+
+/**
+ * By repository id reporting.
+ *
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="reportsByRepositoryIdAction"
+ */
+public class ReportsByRepositoryIdAction extends AbstractReportAction
+{
+ private String repositoryId;
+
+ protected void configureConstraint()
+ {
+ this.constraint = new RepositoryProblemByRepositoryIdConstraint( range, repositoryId );
+ }
+
+ public void setRepositoryId( String repositoryId )
+ {
+ this.repositoryId = repositoryId;
+ }
+}
--- /dev/null
+package org.apache.maven.archiva.web.action.reports;
+
+import java.util.Collection;
+
+import org.apache.maven.archiva.database.ArchivaDAO;
+import org.codehaus.plexus.xwork.action.PlexusActionSupport;
+
+/**
+ * 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 groupIds;
+
+ private Collection artifactIds;
+
+ private Collection repositoryIds;
+
+ public String execute() throws Exception
+ {
+ /*
+ * TODO Use combo box for groupIds, artifactIds and repositoryIds instead of a text field.
+ */
+
+ return SUCCESS;
+ }
+
+ public Collection getGroupIds()
+ {
+ return groupIds;
+ }
+
+ public Collection getArtifactIds()
+ {
+ return artifactIds;
+ }
+
+ public Collection getRepositoryIds()
+ {
+ return repositoryIds;
+ }
+}
<interceptor-ref name="unconfiguredArchivaStack"/>
</action>
- <action name="reports" class="reportsAction">
- <result>/WEB-INF/jsp/reports/reports.jsp</result>
- </action>
-
- <action name="runReport" class="reportsAction" method="runReport">
- <interceptor-ref name="configuredArchivaStack"/>
- <interceptor-ref name="execAndWait"/>
- <result name="wait" type="redirect">/admin/reports.action?reportGroup=${reportGroup}&repositoryId=${repositoryId}&filter=${filter}</result>
- <result name="success" type="redirect">/admin/reports.action?reportGroup=${reportGroup}&repositoryId=${repositoryId}&filter=${filter}</result>
- </action>
-
<!-- The following are needed by the maven-app-configuration-web artifact -->
<action name="configureAppearance" class="configureAppearance" method="input">
</result>
</action>
</package>
+
+ <package name="report" namespace="/report" extends="base">
+ <action name="showReports" class="showReportsAction">
+ <result>/WEB-INF/jsp/reports/showReports.jsp</result>
+ </action>
+
+ <action name="allProblematicArtifacts" class="allProblematicArtifactsAction">
+ <result name="success" type="jasper">
+ <param name="location">/WEB-INF/jasperreports/report.jasper</param>
+ <param name="dataSource">reports</param>
+ <param name="format">HTML</param>
+ </result>
+ <result name="blank">/WEB-INF/jsp/reports/blankReport.jsp</result>
+ </action>
+
+ <action name="byGroupId" class="reportsByGroupIdAction">
+ <result name="success" type="jasper">
+ <param name="location">/WEB-INF/jasperreports/report.jasper</param>
+ <param name="dataSource">reports</param>
+ <param name="format">HTML</param>
+ </result>
+ <result name="blank">/WEB-INF/jsp/reports/blankReport.jsp</result>
+ </action>
+
+ <action name="byArtifactId" class="reportsByArtifactIdAction">
+ <result name="success" type="jasper">
+ <param name="location">/WEB-INF/jasperreports/report.jasper</param>
+ <param name="dataSource">reports</param>
+ <param name="format">HTML</param>
+ </result>
+ <result name="blank">/WEB-INF/jsp/reports/blankReport.jsp</result>
+ </action>
+
+ <action name="byRepositoryId" class="reportsByRepositoryIdAction">
+ <result name="success" type="jasper">
+ <param name="location">/WEB-INF/jasperreports/report.jasper</param>
+ <param name="dataSource">reports</param>
+ <param name="format">HTML</param>
+ </result>
+ <result name="blank">/WEB-INF/jsp/reports/blankReport.jsp</result>
+ </action>
+ </package>
</xwork>
<redback:ifAnyAuthorized permissions="archiva-manage-users,archiva-access-reports,archiva-manage-configuration">
<h5>Manage</h5>
<ul>
- <%-- POSTPONED to 1.0-alpha-2
<redback:ifAuthorized permission="archiva-access-reports">
<li class="none">
- <my:currentWWUrl action="reports" namespace="/admin">Reports</my:currentWWUrl>
+ <my:currentWWUrl action="showReports" namespace="/report">Show Reports</my:currentWWUrl>
</li>
</redback:ifAuthorized>
- --%>
<%-- POSTPONED to 1.1 series
<li class="none">
<a href="#">Synchronisation</a>
--- /dev/null
+<%--
+ ~ 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>
--- /dev/null
+<%--
+ ~ 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>
+<script>
+ function getRowCount()
+ {
+ document.getElementById("rowCount1_id").value = document.getElementById("rowCountSource_id").value;
+ document.getElementById("rowCount2_id").value = document.getElementById("rowCountSource_id").value;
+ document.getElementById("rowCount3_id").value = document.getElementById("rowCountSource_id").value;
+ document.getElementById("rowCount4_id").value = document.getElementById("rowCountSource_id").value;
+ }
+</script>
+
+<h1>Reports</h1>
+
+<div id="contentArea">
+
+ <h2>Global Settings</h2>
+ <ww:textfield id="rowCountSource_id" label="Row Count" value="100"/>
+ <br><br>
+
+ <h2>All Problematic Artifacts</h2>
+ <ww:form onsubmit="getRowCount();" action="allProblematicArtifacts" namespace="/report">
+ <ww:hidden id="rowCount1_id" name="rowCount"/>
+ <ww:submit value="Show All Problematic Artifacts"/>
+ </ww:form>
+ <br>
+
+ <h2>Problematic Artifacts by Group Id</h2>
+ <ww:form action="byGroupId" namespace="/report">
+ <ww:hidden id="rowCount2_id" name="rowCount"/>
+ <ww:textfield name="groupId"/>
+ <ww:submit value="Problematic Artifacts by Group Id"/>
+ </ww:form>
+ <br>
+
+ <h2>Problematic Artifacts by Artifact Id</h2>
+ <ww:form action="byArtifactId" namespace="/report">
+ <ww:hidden id="rowCount3_id" name="rowCount"/>
+ <ww:textfield name="artifactId"/>
+ <ww:submit value="Problematic Artifacts by Artifact Id"/>
+ </ww:form>
+ <br>
+
+ <h2>Problematic Artifacts by Repository Id</h2>
+ <ww:form action="byRepositoryId" namespace="/report">
+ <ww:hidden id="rowCount4_id" name="rowCount"/>
+ <ww:textfield name="repositoryId"/>
+ <ww:submit value="Problematic Artifacts by Repository Id"/>
+ </ww:form>
+
+</div>
+
+</body>
+</html>