1 package org.apache.maven.archiva.reporting.group;
4 * Copyright 2005-2006 The Apache Software Foundation.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 import org.apache.maven.artifact.Artifact;
20 import org.apache.maven.artifact.repository.ArtifactRepository;
21 import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
22 import org.apache.maven.model.Model;
23 import org.apache.maven.archiva.reporting.group.ReportGroup;
24 import org.apache.maven.archiva.reporting.database.ReportingDatabase;
25 import org.apache.maven.archiva.reporting.processor.ArtifactReportProcessor;
26 import org.apache.maven.archiva.reporting.processor.MetadataReportProcessor;
28 import java.util.Iterator;
32 * Basic functionality for all report groups.
34 public abstract class AbstractReportGroup
35 implements ReportGroup
38 * @plexus.requirement role="org.apache.maven.archiva.reporting.processor.ArtifactReportProcessor"
40 private Map artifactReports;
43 * @plexus.requirement role="org.apache.maven.archiva.reporting.processor.MetadataReportProcessor"
45 private Map metadataReports;
47 public void processArtifact( Artifact artifact, Model model, ReportingDatabase reportingDatabase )
49 for ( Iterator i = artifactReports.entrySet().iterator(); i.hasNext(); )
51 Map.Entry entry = (Map.Entry) i.next();
53 if ( includeReport( (String) entry.getKey() ) )
55 ArtifactReportProcessor report = (ArtifactReportProcessor) entry.getValue();
57 report.processArtifact( artifact, model, reportingDatabase );
62 public void processMetadata( RepositoryMetadata repositoryMetadata, ArtifactRepository repository,
63 ReportingDatabase reportingDatabase )
65 for ( Iterator i = metadataReports.entrySet().iterator(); i.hasNext(); )
67 Map.Entry entry = (Map.Entry) i.next();
69 if ( includeReport( (String) entry.getKey() ) )
71 MetadataReportProcessor report = (MetadataReportProcessor) entry.getValue();
73 report.processMetadata( repositoryMetadata, repository, reportingDatabase );
78 public String toString()