You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Emmanuel Venisse <em...@venisse.net> on 2006/03/02 11:08:38 UTC
Re: svn commit: r382337 - in /maven/repository-manager/trunk/maven-repository-webapp:
./ src/main/java/org/apache/maven/repository/manager/web/action/ src/main/java/org/apache/maven/repository/manager/web/job/
src/main/resources/ src/main/webapp/WEB-INF/ s...
I think it will be better to use a logger instead of System.out.println in DiscoverJob.
Emmanuel
epunzalan@apache.org a écrit :
> Author: epunzalan
> Date: Thu Mar 2 01:53:40 2006
> New Revision: 382337
>
> URL: http://svn.apache.org/viewcvs?rev=382337&view=rev
> Log:
> PR: MRM-36
> Submitted by: Maria Odea Ching
>
> Applied patch for discovery and indexing schedule
>
> Added:
> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
> Modified:
> maven/repository-manager/trunk/maven-repository-webapp/pom.xml
> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
> maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp
> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
>
> Modified: maven/repository-manager/trunk/maven-repository-webapp/pom.xml
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/pom.xml?rev=382337&r1=382336&r2=382337&view=diff
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/pom.xml (original)
> +++ maven/repository-manager/trunk/maven-repository-webapp/pom.xml Thu Mar 2 01:53:40 2006
> @@ -42,7 +42,7 @@
> <groupId>org.mortbay.jetty</groupId>
> <artifactId>maven-jetty6-plugin</artifactId>
> <configuration>
> - <webAppSourceDirectory>${basedir}/target/${artifactId}</webAppSourceDirectory >
> + <webAppSourceDirectory>${basedir}/target/${artifactId}</webAppSourceDirectory>
> <scanIntervalSeconds>10</scanIntervalSeconds>
> </configuration>
> </plugin>
>
> Added: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java?rev=382337&view=auto
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java (added)
> +++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java Thu Mar 2 01:53:40 2006
> @@ -0,0 +1,57 @@
> +package org.apache.maven.repository.manager.web.action;
> +
> +/*
> + * Copyright 2005-2006 The Apache Software Foundation.
> + *
> + * Licensed 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 com.opensymphony.xwork.Action;
> +import org.apache.maven.repository.manager.web.job.DiscovererScheduler;
> +
> +/**
> + * This is the Action class of index.jsp, which is the initial page of the web application.
> + * It invokes the DiscovererScheduler to set the DiscoverJob in the scheduler.
> + *
> + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="org.apache.maven.repository.manager.web.action.BaseAction"
> + */
> +public class BaseAction
> + implements Action
> +{
> +
> + /**
> + * @plexus.requirement
> + */
> + private DiscovererScheduler discovererScheduler;
> +
> + /**
> + * Method that executes the action
> + *
> + * @return a String that specifies if the action executed was a success or a failure
> + */
> + public String execute()
> + {
> + try
> + {
> + discovererScheduler.setSchedule();
> + }
> + catch ( Exception e )
> + {
> + e.printStackTrace();
> + return ERROR;
> + }
> +
> + return SUCCESS;
> + }
> +
> +}
>
> Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java?rev=382337&r1=382336&r2=382337&view=diff
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java (original)
> +++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java Thu Mar 2 01:53:40 2006
> @@ -24,7 +24,7 @@
> */
>
> /**
> - *
> + * This class contains the configuration values to be used by the scheduler
> */
> public class Configuration
> implements Initializable
> @@ -32,17 +32,29 @@
>
> private Properties props;
>
> + /**
> + * @throws InitializationException
> + */
> public void initialize()
> throws InitializationException
> {
> - System.out.println( "Configuration initialized" );
> }
>
> + /**
> + * Set the properties object
> + *
> + * @param properties
> + */
> public void setProperties( Properties properties )
> {
> this.props = properties;
> }
>
> + /**
> + * Returns the properties object
> + *
> + * @return a Properties object that contains the configuration values
> + */
> public Properties getProperties()
> {
> return props;
>
> Added: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java?rev=382337&view=auto
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java (added)
> +++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java Thu Mar 2 01:53:40 2006
> @@ -0,0 +1,260 @@
> +package org.apache.maven.repository.manager.web.job;
> +
> +/*
> + * Copyright 2005-2006 The Apache Software Foundation.
> + *
> + * Licensed 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.artifact.Artifact;
> +import org.apache.maven.artifact.repository.ArtifactRepository;
> +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
> +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
> +import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
> +import org.apache.maven.model.Model;
> +import org.apache.maven.repository.discovery.ArtifactDiscoverer;
> +import org.apache.maven.repository.discovery.DefaultArtifactDiscoverer;
> +import org.apache.maven.repository.discovery.DefaultMetadataDiscoverer;
> +import org.apache.maven.repository.discovery.LegacyArtifactDiscoverer;
> +import org.apache.maven.repository.discovery.MetadataDiscoverer;
> +import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
> +import org.apache.maven.repository.indexing.MetadataRepositoryIndex;
> +import org.apache.maven.repository.indexing.PomRepositoryIndex;
> +import org.apache.maven.repository.indexing.RepositoryIndexException;
> +import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
> +import org.codehaus.plexus.scheduler.AbstractJob;
> +import org.quartz.JobDataMap;
> +import org.quartz.JobExecutionContext;
> +import org.quartz.JobExecutionException;
> +
> +import java.io.File;
> +import java.net.MalformedURLException;
> +import java.util.Iterator;
> +import java.util.List;
> +
> +/**
> + * This class executes the discoverer and the indexer.
> + *
> + * @plexus.component role="org.apache.maven.repository.manager.web.job.DiscovererJob"
> + */
> +public class DiscovererJob
> + extends AbstractJob
> +{
> + public static final String ROLE = DiscovererJob.class.getName();
> +
> + private ArtifactDiscoverer defaultArtifactDiscoverer;
> +
> + private ArtifactDiscoverer legacyArtifactDiscoverer;
> +
> + private MetadataDiscoverer defaultMetadataDiscoverer;
> +
> + private RepositoryIndexingFactory indexFactory;
> +
> + private ArtifactRepositoryLayout layout;
> +
> + private ArtifactRepositoryFactory repoFactory;
> +
> + public static String MAP_INDEXPATH = "INDEXPATH";
> +
> + public static String MAP_LAYOUT = "LAYOUT";
> +
> + public static String MAP_DEFAULT_REPOSITORY = "DEFAULT_REPOSITORY";
> +
> + public static String MAP_BLACKLIST = "BLACKLISTED_PATTERNS";
> +
> + public static String MAP_SNAPSHOTS = "INCLUDE_SNAPSHOTS";
> +
> + public static String MAP_CONVERT = "CONVERT_SNAPSHOTS";
> +
> + public static String MAP_DEF_ARTIFACT_DISCOVERER = "DEFAULT_ARTIFACT_DISCOVERER";
> +
> + public static String MAP_LEG_ARTIFACT_DISCOVERER = "LEGACY_ARTIFACT_DISCOVERER";
> +
> + public static String MAP_DEF_METADATA_DISCOVERER = "DEFAULT_METADATA_DISCOVERER";
> +
> + public static String MAP_IDX_FACTORY = "INDEX_FACTORY";
> +
> + public static String MAP_REPO_LAYOUT = "REPOSITORY_LAYOUT";
> +
> + public static String MAP_REPO_FACTORY = "REPOSITORY_FACTORY";
> +
> + /**
> + * Execute the discoverer and the indexer.
> + *
> + * @param context
> + * @throws org.quartz.JobExecutionException
> + *
> + */
> + public void execute( JobExecutionContext context )
> + throws JobExecutionException
> + {
> + System.out.println( "Start execution of DiscovererJob.." );
> + JobDataMap dataMap = context.getJobDetail().getJobDataMap();
> +
> + //configuration values specified in properties file
> + String indexPath = (String) dataMap.get( MAP_INDEXPATH );
> + ArtifactRepository defaultRepository = (ArtifactRepository) dataMap.get( MAP_DEFAULT_REPOSITORY );
> + String blacklistedPatterns = (String) dataMap.get( MAP_BLACKLIST );
> + boolean includeSnapshots = ( (Boolean) dataMap.get( MAP_SNAPSHOTS ) ).booleanValue();
> + boolean convertSnapshots = ( (Boolean) dataMap.get( MAP_CONVERT ) ).booleanValue();
> +
> + //plexus components created in BaseAction
> + defaultArtifactDiscoverer = (DefaultArtifactDiscoverer) dataMap.get( MAP_DEF_ARTIFACT_DISCOVERER );
> + legacyArtifactDiscoverer = (LegacyArtifactDiscoverer) dataMap.get( MAP_LEG_ARTIFACT_DISCOVERER );
> + defaultMetadataDiscoverer = (DefaultMetadataDiscoverer) dataMap.get( MAP_DEF_METADATA_DISCOVERER );
> + indexFactory = (RepositoryIndexingFactory) dataMap.get( MAP_IDX_FACTORY );
> + layout = (ArtifactRepositoryLayout) dataMap.get( MAP_REPO_LAYOUT );
> + repoFactory = (ArtifactRepositoryFactory) dataMap.get( MAP_REPO_FACTORY );
> +
> + try
> + {
> + List artifacts;
> + if ( dataMap.get( MAP_LAYOUT ).equals( "default" ) )
> + {
> + artifacts = defaultArtifactDiscoverer.discoverArtifacts( defaultRepository, blacklistedPatterns,
> + includeSnapshots );
> + indexArtifact( artifacts, indexPath, defaultRepository );
> +
> + List models = defaultArtifactDiscoverer.discoverStandalonePoms( defaultRepository, blacklistedPatterns,
> + convertSnapshots );
> + indexPom( models, indexPath, defaultRepository );
> +
> + List metadataList = defaultMetadataDiscoverer.discoverMetadata(
> + new File( defaultRepository.getBasedir() ), blacklistedPatterns );
> + indexMetadata( metadataList, indexPath, new File( defaultRepository.getBasedir() ) );
> + }
> + else if ( dataMap.get( MAP_LAYOUT ).equals( "legacy" ) )
> + {
> + artifacts = legacyArtifactDiscoverer.discoverArtifacts( defaultRepository, blacklistedPatterns,
> + includeSnapshots );
> + indexArtifact( artifacts, indexPath, defaultRepository );
> + }
> + }
> + catch ( RepositoryIndexException e )
> + {
> + e.printStackTrace();
> + }
> + catch ( MalformedURLException me )
> + {
> + me.printStackTrace();
> + }
> +
> + System.out.println( "[DiscovererJob] DiscovererJob has finished executing." );
> + }
> +
> + /**
> + * Index the artifacts in the list
> + *
> + * @param artifacts the artifacts to be indexed
> + * @param indexPath the path to the index file
> + * @param repository the repository where the artifacts are located
> + */
> + private void indexArtifact( List artifacts, String indexPath, ArtifactRepository repository )
> + throws RepositoryIndexException
> + {
> + ArtifactRepositoryIndex artifactIndex = indexFactory.createArtifactRepositoryIndex( indexPath, repository );
> + for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
> + {
> + Artifact artifact = (Artifact) iter.next();
> + try
> + {
> + artifactIndex.indexArtifact( artifact );
> + }
> + catch ( Exception e )
> + {
> + if ( e instanceof RepositoryIndexException )
> + {
> + throw (RepositoryIndexException) e;
> + }
> + }
> +
> + if ( artifactIndex.isOpen() )
> + {
> + artifactIndex.optimize();
> + artifactIndex.close();
> + }
> + }
> + }
> +
> + /**
> + * Index the metadata in the list
> + *
> + * @param metadataList the metadata to be indexed
> + * @param indexPath the path to the index file
> + * @param repositoryBase the repository where the metadata are located
> + */
> + private void indexMetadata( List metadataList, String indexPath, File repositoryBase )
> + throws RepositoryIndexException, MalformedURLException
> + {
> + String repoDir = repositoryBase.toURL().toString();
> + ArtifactRepository repository =
> + repoFactory.createArtifactRepository( "repository", repoDir, layout, null, null );
> +
> + MetadataRepositoryIndex metadataIndex = indexFactory.createMetadataRepositoryIndex( indexPath, repository );
> + for ( Iterator iter = metadataList.iterator(); iter.hasNext(); )
> + {
> + RepositoryMetadata repoMetadata = (RepositoryMetadata) iter.next();
> + try
> + {
> + metadataIndex.index( repoMetadata );
> + }
> + catch ( Exception e )
> + {
> + if ( e instanceof RepositoryIndexException )
> + {
> + throw (RepositoryIndexException) e;
> + }
> + }
> + if ( metadataIndex.isOpen() )
> + {
> + metadataIndex.optimize();
> + metadataIndex.close();
> + }
> + }
> + }
> +
> + /**
> + * Index the poms in the list
> + *
> + * @param models list of poms that will be indexed
> + * @param indexPath the path to the index
> + * @param repository the artifact repository where the poms were discovered
> + */
> + private void indexPom( List models, String indexPath, ArtifactRepository repository )
> + throws RepositoryIndexException
> + {
> + PomRepositoryIndex pomIndex = indexFactory.createPomRepositoryIndex( indexPath, repository );
> + for ( Iterator iter = models.iterator(); iter.hasNext(); )
> + {
> + Model model = (Model) iter.next();
> + try
> + {
> + pomIndex.indexPom( model );
> + }
> + catch ( Exception e )
> + {
> + if ( e instanceof RepositoryIndexException )
> + {
> + throw (RepositoryIndexException) e;
> + }
> + }
> +
> + if ( pomIndex.isOpen() )
> + {
> + pomIndex.optimize();
> + pomIndex.close();
> + }
> + }
> + }
> +
> +}
>
> Added: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java?rev=382337&view=auto
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java (added)
> +++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java Thu Mar 2 01:53:40 2006
> @@ -0,0 +1,149 @@
> +package org.apache.maven.repository.manager.web.job;
> +
> +/*
> + * Copyright 2005-2006 The Apache Software Foundation.
> + *
> + * Licensed 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.artifact.repository.ArtifactRepository;
> +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
> +import org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory;
> +import org.apache.maven.repository.discovery.ArtifactDiscoverer;
> +import org.apache.maven.repository.discovery.MetadataDiscoverer;
> +import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
> +import org.codehaus.plexus.scheduler.Scheduler;
> +import org.quartz.CronTrigger;
> +import org.quartz.JobDataMap;
> +import org.quartz.JobDetail;
> +import org.quartz.SchedulerException;
> +
> +import java.io.File;
> +import java.io.IOException;
> +import java.net.MalformedURLException;
> +import java.text.ParseException;
> +import java.util.Properties;
> +
> +/**
> + * This class sets the job to be executed in the plexus-quartz scheduler
> + *
> + * @plexus.component role="org.apache.maven.repository.manager.web.job.DiscovererScheduler"
> + */
> +public class DiscovererScheduler
> +{
> + /**
> + * @plexus.requirement
> + */
> + private Configuration config;
> +
> + /**
> + * @plexus.requirement
> + */
> + private Scheduler scheduler;
> +
> + /**
> + * @plexus.requirement role="org.apache.maven.repository.discovery.ArtifactDiscoverer" role-hint="org.apache.maven.repository.discovery.DefaultArtifactDiscoverer"
> + */
> + private ArtifactDiscoverer defaultArtifactDiscoverer;
> +
> + /**
> + * @plexus.requirement role="org.apache.maven.repository.discovery.ArtifactDiscoverer" role-hint="org.apache.maven.repository.discovery.LegacyArtifactDiscoverer"
> + */
> + private ArtifactDiscoverer legacyArtifactDiscoverer;
> +
> + /**
> + * @plexus.requirement role="org.apache.maven.repository.discovery.MetadataDiscoverer" role-hint="org.apache.maven.repository.discovery.DefaultMetadataDiscoverer"
> + */
> + private MetadataDiscoverer defaultMetadataDiscoverer;
> +
> + /**
> + * @plexus.requirement
> + */
> + private RepositoryIndexingFactory indexFactory;
> +
> + /**
> + * @plexus.requirement
> + */
> + private ArtifactRepositoryFactory repoFactory;
> +
> + private Properties props;
> +
> + /**
> + * Method that sets the schedule in the plexus-quartz scheduler
> + *
> + * @throws IOException
> + * @throws ParseException
> + * @throws SchedulerException
> + */
> + public void setSchedule()
> + throws IOException, ParseException, SchedulerException
> + {
> + props = config.getProperties();
> + JobDetail jobDetail = new JobDetail( "discovererJob", "DISCOVERER", DiscovererJob.class );
> + JobDataMap dataMap = new JobDataMap();
> + dataMap.put( DiscovererJob.MAP_INDEXPATH, props.getProperty( "index.path" ) );
> + dataMap.put( DiscovererJob.MAP_BLACKLIST, props.getProperty( "blacklist.patterns" ) );
> + dataMap.put( DiscovererJob.MAP_DEFAULT_REPOSITORY, getDefaultRepository() );
> + dataMap.put( DiscovererJob.MAP_LAYOUT, props.getProperty( "layout" ) );
> + dataMap.put( DiscovererJob.MAP_SNAPSHOTS, new Boolean( props.getProperty( "include.snapshots" ) ) );
> + dataMap.put( DiscovererJob.MAP_CONVERT, new Boolean( props.getProperty( "convert.snapshots" ) ) );
> + dataMap.put( DiscovererJob.MAP_DEF_ARTIFACT_DISCOVERER, defaultArtifactDiscoverer );
> + dataMap.put( DiscovererJob.MAP_LEG_ARTIFACT_DISCOVERER, legacyArtifactDiscoverer );
> + dataMap.put( DiscovererJob.MAP_DEF_METADATA_DISCOVERER, defaultMetadataDiscoverer );
> + dataMap.put( DiscovererJob.MAP_IDX_FACTORY, indexFactory );
> + dataMap.put( DiscovererJob.MAP_REPO_LAYOUT, config.getLayout() );
> + dataMap.put( DiscovererJob.MAP_REPO_FACTORY, repoFactory );
> + jobDetail.setJobDataMap( dataMap );
> +
> + CronTrigger trigger =
> + new CronTrigger( "DiscovererTrigger", "DISCOVERER", props.getProperty( "cron.expression" ) );
> + scheduler.scheduleJob( jobDetail, trigger );
> + }
> +
> + /**
> + * Method that creates the artifact repository
> + *
> + * @return an ArtifactRepository instance
> + * @throws java.net.MalformedURLException
> + */
> + private ArtifactRepository getDefaultRepository()
> + throws MalformedURLException
> + {
> + File repositoryDirectory = new File( config.getRepositoryDirectory() );
> + String repoDir = repositoryDirectory.toURL().toString();
> + ArtifactRepositoryFactory repoFactory = new DefaultArtifactRepositoryFactory();
> +
> + return repoFactory.createArtifactRepository( "test", repoDir, config.getLayout(), null, null );
> + }
> +
> + /**
> + * Method that sets the configuration object
> + *
> + * @param config
> + */
> + public void setConfiguration( Configuration config )
> + {
> + this.config = config;
> + }
> +
> + /**
> + * Returns the cofiguration
> + *
> + * @return a Configuration object that contains the configuration values
> + */
> + public Configuration getConfiguration()
> + {
> + return config;
> + }
> +
> +}
>
> Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml?rev=382337&r1=382336&r2=382337&view=diff
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml (original)
> +++ maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml Thu Mar 2 01:53:40 2006
> @@ -27,8 +27,9 @@
> <default-interceptor-ref name="defaultStack"/>
>
> <!-- Action: Front page -->
> - <action name="index" class="com.opensymphony.xwork.ActionSupport">
> + <action name="index" class="org.apache.maven.repository.manager.web.action.BaseAction">
> <result name="success" type="dispatcher">/WEB-INF/jsp/index.jsp</result>
> + <result name="error" type="dispatcher">/WEB-INF/jsp/index.jsp</result>
> </action>
>
> <action name="searchg" class="org.apache.maven.repository.manager.web.action.GeneralSearchAction">
>
> Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp?rev=382337&r1=382336&r2=382337&view=diff
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp (original)
> +++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp Thu Mar 2 01:53:40 2006
> @@ -1,26 +1,28 @@
> <%@ taglib uri="webwork" prefix="ww" %>
> -<%@page import="java.util.*"%>
> +
> <html>
> <head>
> -<title>Repository Browser</title>
> + <title>Repository Browser</title>
> </head>
> +
> <body>
> <h3><a href="<ww:url value="browse!edit.action"><ww:param name="idx" value="0"/></ww:url>">basedir</a> /
> -<ww:set name="previousFolder" value="''"/>
> -<ww:set name="counter" value="0"/>
> -<ww:if test="folder != ''">
> - <ww:set name="folderHeader" value="folder.split('/')"/>
> - <ww:iterator value="#folderHeader">
> - <ww:set name="counter" value="#counter + 1"/>
> - <ww:if test="#previousFolder == ''">
> - <ww:set name="previousFolder" value="top"/>
> - </ww:if>
> - <ww:else>
> - <ww:set name="previousFolder" value="#previousFolder + '/' + top"/>
> - </ww:else>
> - <ww:if test="idx > (#counter + 1)"><a href="<ww:url value="browse!edit.action"><ww:param name="idx"><ww:property value="#counter"/></ww:param><ww:param name="folder"></ww:param></ww:url>"></ww:if><ww:property/></a> /
> - </ww:iterator>
> -</ww:if>
> + <ww:set name="previousFolder" value="''"/>
> + <ww:set name="counter" value="0"/>
> + <ww:if test="folder != ''">
> + <ww:set name="folderHeader" value="folder.split('/')"/>
> + <ww:iterator value="#folderHeader">
> + <ww:set name="counter" value="#counter + 1"/>
> + <ww:if test="#previousFolder == ''">
> + <ww:set name="previousFolder" value="top"/>
> + </ww:if>
> + <ww:else>
> + <ww:set name="previousFolder" value="#previousFolder + '/' + top"/>
> + </ww:else>
> + <ww:if test="idx > (#counter + 1)"><a href="<ww:url value="browse!edit.action"><ww:param name="idx"><ww:property
> + value="#counter"/></ww:param><ww:param name="folder"></ww:param></ww:url>"></ww:if><ww:property/></a> /
> + </ww:iterator>
> + </ww:if>
> </h3>
> <br/>
>
> @@ -29,54 +31,59 @@
> <ww:iterator value="artifactMap.keySet().iterator()">
> <ww:set name="groupName" value="top"/>
> <ww:if test="idx == 1 || (folder != '' and #groupName.startsWith(folder))">
> -<%
> -int ctr = 1;
> -%>
> + <%
> +
> + int ctr = 1;
> +
> + %>
> <ww:set name="groupFolder" value="#groupName.split('/')"/>
> - <ww:iterator value="#groupFolder">
> -<%
> -if (ctr == ((Integer)pageContext.getAttribute("in")).intValue()) {%>
> - <ww:if test="top != #previousFolder">
> - <ww:set name="previousFolder" value="top"/>
> - <a href="<ww:url value="browse!edit.action"><ww:param name="folder"><ww:property value="folder"/><ww:if test="folder != ''">/</ww:if><ww:property/></ww:param><ww:param name="idx" value="idx"/></ww:url>"">
> - <ww:property/>/
> - </a><br>
> - </ww:if>
> -<%
> -}
> -ctr++;
> -%>
> - </ww:iterator>
> -</ww:if>
> -</ww:iterator>
> +<ww:iterator value="#groupFolder">
> + <%
>
> -<ww:if test="folder != ''">
> - <ww:set name="previousFolder" value="''"/>
> - <ww:set name="artifactList" value="artifactMap.get(folder)"/>
> - <ww:iterator value="#artifactList">
> -<table border="1">
> - <tr align="left">
> - <th>Group ID</th>
> - <td><ww:property value="groupId"/></td>
> - </tr>
> - <tr align="left">
> - <th>Artifact ID</th>
> - <td><ww:property value="artifactId"/></td>
> - </tr>
> - <tr align="left">
> - <th>Version</th>
> - <td><ww:property value="version"/></td>
> - </tr>
> - <tr align="left">
> - <th>Derivatives</th>
> - <td><ww:property value="groupId"/></td>
> - </tr>
> - <tr align="left">
> - <th>Parent</th>
> - <td><ww:property value="folder"/></td>
> - </tr>
> -</table><br/>
> +if (ctr == ((Integer)pageContext.getAttribute("in")).intValue()) {
> + %>
> +<ww:if test="top != #previousFolder">
> + <ww:set name="previousFolder" value="top"/>
> +<a href="<ww:url value="browse!edit.action"><ww:param name="folder"><ww:property value="folder"/><ww:if test="folder != ''">/</ww:if><ww:property/></ww:param><ww:param name="idx" value="idx"/></ww:url>"">
> + <ww:property/>/
> + </ a><br>
> + </ww:if>
> + <%
> + }
> + ctr++;
> + %>
> + </ww:iterator>
> + </ww:if>
> </ww:iterator>
> -</ww:if>
> +
> + <ww:if test="folder != ''">
> + <ww:set name="previousFolder" value="''"/>
> + <ww:set name="artifactList" value="artifactMap.get(folder)"/>
> + <ww:iterator value="#artifactList">
> + <table border="1">
> + <tr align="left">
> + <th>Group ID</th>
> + <td><ww:property value="groupId"/></td>
> + </tr>
> + <tr align="left">
> + <th>Artifact ID</th>
> + <td><ww:property value="artifactId"/></td>
> + </tr>
> + <tr align="left">
> + <th>Version</th>
> + <td><ww:property value="version"/></td>
> + </tr>
> + <tr align="left">
> + <th>Derivatives</th>
> + <td><ww:property value="groupId"/></td>
> + </tr>
> + <tr align="left">
> + <th>Parent</th>
> + <td><ww:property value="folder"/></td>
> + </tr>
> + </table>
> + <br/>
> + </ww:iterator>
> + </ww:if>
> </body>
> </html>
>
> Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf?rev=382337&r1=382336&r2=382337&view=diff
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf (original)
> +++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf Thu Mar 2 01:53:40 2006
> @@ -34,30 +34,33 @@
> <!--"CONVERTED_APPLET"-->
> <!-- HTML CONVERTER -->
> <script language="JavaScript" type="text/javascript"><!--
> - var _info = navigator.userAgent;
> - var _ns = false;
> - var _ns6 = false;
> - var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
> +var _info = navigator.userAgent;
> +var _ns = false;
> +var _ns6 = false;
> +var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
> //--></script>
>
> <comment>
> <script language="JavaScript" type="text/javascript"><!--
> - var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) || (_info.indexOf("IRIX") > 0)));
> - var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
> -//--></script>
> + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 &&
> + java.lang.System.getProperty("os.version").indexOf("3.5") <
> + 0) || (_info.indexOf("Sun") > 0) ||
> + (_info.indexOf("Linux") > 0) ||
> + (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) ||
> + (_info.indexOf("IRIX") > 0)));
> + var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
> + //--></script>
> </comment>
>
> <script language="JavaScript" type="text/javascript"><!--
> - if (_ie == true) document.writeln('<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "400" HEIGHT = "20" NAME = "ChecksumApplet" codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,5"><noembed><xmp>');
> - else if (_ns == true && _ns6 == false) document.writeln('<embed ' +
> - 'type="application/x-java-applet;version=1.5" \
> +if ( _ie ==
> + true ) document.writeln('<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "400" HEIGHT = "20" NAME = "ChecksumApplet" codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,5"><noembed><xmp>');
> +else if ( _ns == true && _ns6 == false ) document.writeln('<embed ' + 'type="application/x-java-applet;version=1.5" \
> CODE = "org/apache/maven/repository/applet/ChecksumApplet.class" \
> ARCHIVE = "maven-repository-artifact-applet.jar" \
> NAME = "ChecksumApplet" \
> WIDTH = "400" \
> - HEIGHT = "20" ' +
> - 'scriptable=false ' +
> - 'pluginspage="http://java.sun.com/products/plugin/index.html#download"><noembed><xmp>');
> + HEIGHT = "20" ' + 'scriptable=false ' + 'pluginspage="http://java.sun.com/products/plugin/index.html#download"><noembed><xmp>');
> //--></script>
> <applet CODE="org/apache/maven/repository/applet/ChecksumApplet.class" ARCHIVE="maven-repository-artifact-applet.jar"
> WIDTH="400" HEIGHT="20" NAME="ChecksumApplet"></xmp>
>
> Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp?rev=382337&r1=382336&r2=382337&view=diff
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp (original)
> +++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp Thu Mar 2 01:53:40 2006
> @@ -24,7 +24,7 @@
>
> <h1>Maven Repository Manager</h1>
>
> -<%@include file="form.jspf"%>
> +<%@ include file="form.jspf" %>
>
> <table border="1px" cellspacing="0">
> <tr>
> @@ -50,8 +50,8 @@
> <tr>
> <td valign="top" width="15%" align="right"><ww:property value="Key"/></td>
> <td valign="top">
> - <ww:iterator value="Value" id="test" status="" >
> - <ww:property />
> + <ww:iterator value="Value" id="test" status="">
> + <ww:property/>
> </ww:iterator>
> <br/>
> </td>
>
> Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp?rev=382337&r1=382336&r2=382337&view=diff
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp (original)
> +++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp Thu Mar 2 01:53:40 2006
> @@ -24,7 +24,7 @@
>
> <h1>Maven Repository Manager</h1>
>
> -<%@include file="form.jspf"%>
> +<%@ include file="form.jspf" %>
>
> <table>
> <tr>
>
> Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
> URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml?rev=382337&r1=382336&r2=382337&view=diff
> ==============================================================================
> --- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml (original)
> +++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml Thu Mar 2 01:53:40 2006
> @@ -40,7 +40,7 @@
> <role>com.opensymphony.xwork.ObjectFactory</role>
> <implementation>org.codehaus.plexus.xwork.PlexusObjectFactory</implementation>
> </component>
> -
> +
> <component>
> <role>org.apache.maven.repository.manager.web.job.Configuration</role>
> <implementation>org.apache.maven.repository.manager.web.job.Configuration</implementation>
> @@ -52,7 +52,7 @@
> </property>
> <property>
> <name>default.repository.dir</name>
> - <value>C:/TEST_REPOS/repository</value>
> + <value>C:/TEST_REPOS/.m2/repository/</value>
> </property>
> <property>
> <name>legacy.repository.dir</name>
> @@ -81,14 +81,6 @@
> </properties>
> </configuration>
> </component>
> -
> -
> - <!--
> - <component>
> - <role>org.apache.maven.repository.manager.web.job.DiscovererJob</role>
> - </component>
> -
> - -->
>
> <!--
> | Logger manager
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r382337 - in /maven/repository-manager/trunk/maven-repository-webapp:
./ src/main/java/org/apache/maven/repository/manager/web/action/ src/main/java/org/apache/maven/repository/manager/web/job/
src/main/resources/ src/main/webapp/WEB-INF/ s...
Posted by Edwin Punzalan <ep...@exist.com>.
sorry, just got to read this now... will change it now. Thanks.
Emmanuel Venisse wrote:
> I think it will be better to use a logger instead of
> System.out.println in DiscoverJob.
>
> Emmanuel
>
> epunzalan@apache.org a écrit :
>> Author: epunzalan
>> Date: Thu Mar 2 01:53:40 2006
>> New Revision: 382337
>>
>> URL: http://svn.apache.org/viewcvs?rev=382337&view=rev
>> Log:
>> PR: MRM-36
>> Submitted by: Maria Odea Ching
>>
>> Applied patch for discovery and indexing schedule
>>
>> Added:
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/pom.xml
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
>>
>>
>> Modified: maven/repository-manager/trunk/maven-repository-webapp/pom.xml
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/pom.xml?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> --- maven/repository-manager/trunk/maven-repository-webapp/pom.xml
>> (original)
>> +++ maven/repository-manager/trunk/maven-repository-webapp/pom.xml
>> Thu Mar 2 01:53:40 2006
>> @@ -42,7 +42,7 @@
>> <groupId>org.mortbay.jetty</groupId>
>> <artifactId>maven-jetty6-plugin</artifactId>
>> <configuration>
>> -
>> <webAppSourceDirectory>${basedir}/target/${artifactId}</webAppSourceDirectory
>> >
>> +
>> <webAppSourceDirectory>${basedir}/target/${artifactId}</webAppSourceDirectory>
>>
>> <scanIntervalSeconds>10</scanIntervalSeconds>
>> </configuration>
>> </plugin>
>>
>> Added:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java?rev=382337&view=auto
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
>> (added)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
>> Thu Mar 2 01:53:40 2006
>> @@ -0,0 +1,57 @@
>> +package org.apache.maven.repository.manager.web.action;
>> +
>> +/*
>> + * Copyright 2005-2006 The Apache Software Foundation.
>> + *
>> + * Licensed 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 com.opensymphony.xwork.Action;
>> +import org.apache.maven.repository.manager.web.job.DiscovererScheduler;
>> +
>> +/**
>> + * This is the Action class of index.jsp, which is the initial page
>> of the web application.
>> + * It invokes the DiscovererScheduler to set the DiscoverJob in the
>> scheduler.
>> + *
>> + * @plexus.component role="com.opensymphony.xwork.Action"
>> role-hint="org.apache.maven.repository.manager.web.action.BaseAction"
>> + */
>> +public class BaseAction
>> + implements Action
>> +{
>> +
>> + /**
>> + * @plexus.requirement
>> + */
>> + private DiscovererScheduler discovererScheduler;
>> +
>> + /**
>> + * Method that executes the action
>> + *
>> + * @return a String that specifies if the action executed was a
>> success or a failure
>> + */
>> + public String execute()
>> + {
>> + try
>> + {
>> + discovererScheduler.setSchedule();
>> + }
>> + catch ( Exception e )
>> + {
>> + e.printStackTrace();
>> + return ERROR;
>> + }
>> +
>> + return SUCCESS;
>> + }
>> +
>> +}
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
>> Thu Mar 2 01:53:40 2006
>> @@ -24,7 +24,7 @@
>> */
>>
>> /**
>> - *
>> + * This class contains the configuration values to be used by the
>> scheduler
>> */
>> public class Configuration
>> implements Initializable
>> @@ -32,17 +32,29 @@
>>
>> private Properties props;
>>
>> + /**
>> + * @throws InitializationException
>> + */
>> public void initialize()
>> throws InitializationException
>> {
>> - System.out.println( "Configuration initialized" );
>> }
>>
>> + /**
>> + * Set the properties object
>> + *
>> + * @param properties
>> + */
>> public void setProperties( Properties properties )
>> {
>> this.props = properties;
>> }
>>
>> + /**
>> + * Returns the properties object
>> + *
>> + * @return a Properties object that contains the configuration
>> values
>> + */
>> public Properties getProperties()
>> {
>> return props;
>>
>> Added:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java?rev=382337&view=auto
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
>> (added)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
>> Thu Mar 2 01:53:40 2006
>> @@ -0,0 +1,260 @@
>> +package org.apache.maven.repository.manager.web.job;
>> +
>> +/*
>> + * Copyright 2005-2006 The Apache Software Foundation.
>> + *
>> + * Licensed 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.artifact.Artifact;
>> +import org.apache.maven.artifact.repository.ArtifactRepository;
>> +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
>> +import
>> org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
>> +import
>> org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
>> +import org.apache.maven.model.Model;
>> +import org.apache.maven.repository.discovery.ArtifactDiscoverer;
>> +import org.apache.maven.repository.discovery.DefaultArtifactDiscoverer;
>> +import org.apache.maven.repository.discovery.DefaultMetadataDiscoverer;
>> +import org.apache.maven.repository.discovery.LegacyArtifactDiscoverer;
>> +import org.apache.maven.repository.discovery.MetadataDiscoverer;
>> +import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
>> +import org.apache.maven.repository.indexing.MetadataRepositoryIndex;
>> +import org.apache.maven.repository.indexing.PomRepositoryIndex;
>> +import org.apache.maven.repository.indexing.RepositoryIndexException;
>> +import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
>> +import org.codehaus.plexus.scheduler.AbstractJob;
>> +import org.quartz.JobDataMap;
>> +import org.quartz.JobExecutionContext;
>> +import org.quartz.JobExecutionException;
>> +
>> +import java.io.File;
>> +import java.net.MalformedURLException;
>> +import java.util.Iterator;
>> +import java.util.List;
>> +
>> +/**
>> + * This class executes the discoverer and the indexer.
>> + *
>> + * @plexus.component
>> role="org.apache.maven.repository.manager.web.job.DiscovererJob"
>> + */
>> +public class DiscovererJob
>> + extends AbstractJob
>> +{
>> + public static final String ROLE = DiscovererJob.class.getName();
>> +
>> + private ArtifactDiscoverer defaultArtifactDiscoverer;
>> +
>> + private ArtifactDiscoverer legacyArtifactDiscoverer;
>> +
>> + private MetadataDiscoverer defaultMetadataDiscoverer;
>> +
>> + private RepositoryIndexingFactory indexFactory;
>> +
>> + private ArtifactRepositoryLayout layout;
>> +
>> + private ArtifactRepositoryFactory repoFactory;
>> +
>> + public static String MAP_INDEXPATH = "INDEXPATH";
>> +
>> + public static String MAP_LAYOUT = "LAYOUT";
>> +
>> + public static String MAP_DEFAULT_REPOSITORY = "DEFAULT_REPOSITORY";
>> +
>> + public static String MAP_BLACKLIST = "BLACKLISTED_PATTERNS";
>> +
>> + public static String MAP_SNAPSHOTS = "INCLUDE_SNAPSHOTS";
>> +
>> + public static String MAP_CONVERT = "CONVERT_SNAPSHOTS";
>> +
>> + public static String MAP_DEF_ARTIFACT_DISCOVERER =
>> "DEFAULT_ARTIFACT_DISCOVERER";
>> +
>> + public static String MAP_LEG_ARTIFACT_DISCOVERER =
>> "LEGACY_ARTIFACT_DISCOVERER";
>> +
>> + public static String MAP_DEF_METADATA_DISCOVERER =
>> "DEFAULT_METADATA_DISCOVERER";
>> +
>> + public static String MAP_IDX_FACTORY = "INDEX_FACTORY";
>> +
>> + public static String MAP_REPO_LAYOUT = "REPOSITORY_LAYOUT";
>> +
>> + public static String MAP_REPO_FACTORY = "REPOSITORY_FACTORY";
>> +
>> + /**
>> + * Execute the discoverer and the indexer.
>> + *
>> + * @param context
>> + * @throws org.quartz.JobExecutionException
>> + *
>> + */
>> + public void execute( JobExecutionContext context )
>> + throws JobExecutionException
>> + {
>> + System.out.println( "Start execution of DiscovererJob.." );
>> + JobDataMap dataMap = context.getJobDetail().getJobDataMap();
>> +
>> + //configuration values specified in properties file
>> + String indexPath = (String) dataMap.get( MAP_INDEXPATH );
>> + ArtifactRepository defaultRepository = (ArtifactRepository)
>> dataMap.get( MAP_DEFAULT_REPOSITORY );
>> + String blacklistedPatterns = (String) dataMap.get(
>> MAP_BLACKLIST );
>> + boolean includeSnapshots = ( (Boolean) dataMap.get(
>> MAP_SNAPSHOTS ) ).booleanValue();
>> + boolean convertSnapshots = ( (Boolean) dataMap.get(
>> MAP_CONVERT ) ).booleanValue();
>> +
>> + //plexus components created in BaseAction
>> + defaultArtifactDiscoverer = (DefaultArtifactDiscoverer)
>> dataMap.get( MAP_DEF_ARTIFACT_DISCOVERER );
>> + legacyArtifactDiscoverer = (LegacyArtifactDiscoverer)
>> dataMap.get( MAP_LEG_ARTIFACT_DISCOVERER );
>> + defaultMetadataDiscoverer = (DefaultMetadataDiscoverer)
>> dataMap.get( MAP_DEF_METADATA_DISCOVERER );
>> + indexFactory = (RepositoryIndexingFactory) dataMap.get(
>> MAP_IDX_FACTORY );
>> + layout = (ArtifactRepositoryLayout) dataMap.get(
>> MAP_REPO_LAYOUT );
>> + repoFactory = (ArtifactRepositoryFactory) dataMap.get(
>> MAP_REPO_FACTORY );
>> +
>> + try
>> + {
>> + List artifacts;
>> + if ( dataMap.get( MAP_LAYOUT ).equals( "default" ) )
>> + {
>> + artifacts =
>> defaultArtifactDiscoverer.discoverArtifacts( defaultRepository,
>> blacklistedPatterns,
>> +
>> includeSnapshots );
>> + indexArtifact( artifacts, indexPath,
>> defaultRepository );
>> +
>> + List models =
>> defaultArtifactDiscoverer.discoverStandalonePoms( defaultRepository,
>> blacklistedPatterns,
>> +
>> convertSnapshots );
>> + indexPom( models, indexPath, defaultRepository );
>> +
>> + List metadataList =
>> defaultMetadataDiscoverer.discoverMetadata(
>> + new File( defaultRepository.getBasedir() ),
>> blacklistedPatterns );
>> + indexMetadata( metadataList, indexPath, new File(
>> defaultRepository.getBasedir() ) );
>> + }
>> + else if ( dataMap.get( MAP_LAYOUT ).equals( "legacy" ) )
>> + {
>> + artifacts =
>> legacyArtifactDiscoverer.discoverArtifacts( defaultRepository,
>> blacklistedPatterns,
>> +
>> includeSnapshots );
>> + indexArtifact( artifacts, indexPath,
>> defaultRepository );
>> + }
>> + }
>> + catch ( RepositoryIndexException e )
>> + {
>> + e.printStackTrace();
>> + }
>> + catch ( MalformedURLException me )
>> + {
>> + me.printStackTrace();
>> + }
>> +
>> + System.out.println( "[DiscovererJob] DiscovererJob has
>> finished executing." );
>> + }
>> +
>> + /**
>> + * Index the artifacts in the list
>> + *
>> + * @param artifacts the artifacts to be indexed
>> + * @param indexPath the path to the index file
>> + * @param repository the repository where the artifacts are located
>> + */
>> + private void indexArtifact( List artifacts, String indexPath,
>> ArtifactRepository repository )
>> + throws RepositoryIndexException
>> + {
>> + ArtifactRepositoryIndex artifactIndex =
>> indexFactory.createArtifactRepositoryIndex( indexPath, repository );
>> + for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
>> + {
>> + Artifact artifact = (Artifact) iter.next();
>> + try
>> + {
>> + artifactIndex.indexArtifact( artifact );
>> + }
>> + catch ( Exception e )
>> + {
>> + if ( e instanceof RepositoryIndexException )
>> + {
>> + throw (RepositoryIndexException) e;
>> + }
>> + }
>> +
>> + if ( artifactIndex.isOpen() )
>> + {
>> + artifactIndex.optimize();
>> + artifactIndex.close();
>> + }
>> + }
>> + }
>> +
>> + /**
>> + * Index the metadata in the list
>> + *
>> + * @param metadataList the metadata to be indexed
>> + * @param indexPath the path to the index file
>> + * @param repositoryBase the repository where the metadata are
>> located
>> + */
>> + private void indexMetadata( List metadataList, String indexPath,
>> File repositoryBase )
>> + throws RepositoryIndexException, MalformedURLException
>> + {
>> + String repoDir = repositoryBase.toURL().toString();
>> + ArtifactRepository repository =
>> + repoFactory.createArtifactRepository( "repository",
>> repoDir, layout, null, null );
>> +
>> + MetadataRepositoryIndex metadataIndex =
>> indexFactory.createMetadataRepositoryIndex( indexPath, repository );
>> + for ( Iterator iter = metadataList.iterator();
>> iter.hasNext(); )
>> + {
>> + RepositoryMetadata repoMetadata = (RepositoryMetadata)
>> iter.next();
>> + try
>> + {
>> + metadataIndex.index( repoMetadata );
>> + }
>> + catch ( Exception e )
>> + {
>> + if ( e instanceof RepositoryIndexException )
>> + {
>> + throw (RepositoryIndexException) e;
>> + }
>> + }
>> + if ( metadataIndex.isOpen() )
>> + {
>> + metadataIndex.optimize();
>> + metadataIndex.close();
>> + }
>> + }
>> + }
>> +
>> + /**
>> + * Index the poms in the list
>> + *
>> + * @param models list of poms that will be indexed
>> + * @param indexPath the path to the index
>> + * @param repository the artifact repository where the poms were
>> discovered
>> + */
>> + private void indexPom( List models, String indexPath,
>> ArtifactRepository repository )
>> + throws RepositoryIndexException
>> + {
>> + PomRepositoryIndex pomIndex =
>> indexFactory.createPomRepositoryIndex( indexPath, repository );
>> + for ( Iterator iter = models.iterator(); iter.hasNext(); )
>> + {
>> + Model model = (Model) iter.next();
>> + try
>> + {
>> + pomIndex.indexPom( model );
>> + }
>> + catch ( Exception e )
>> + {
>> + if ( e instanceof RepositoryIndexException )
>> + {
>> + throw (RepositoryIndexException) e;
>> + }
>> + }
>> +
>> + if ( pomIndex.isOpen() )
>> + {
>> + pomIndex.optimize();
>> + pomIndex.close();
>> + }
>> + }
>> + }
>> +
>> +}
>>
>> Added:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java?rev=382337&view=auto
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
>> (added)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
>> Thu Mar 2 01:53:40 2006
>> @@ -0,0 +1,149 @@
>> +package org.apache.maven.repository.manager.web.job;
>> +
>> +/*
>> + * Copyright 2005-2006 The Apache Software Foundation.
>> + *
>> + * Licensed 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.artifact.repository.ArtifactRepository;
>> +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
>> +import
>> org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory;
>> +import org.apache.maven.repository.discovery.ArtifactDiscoverer;
>> +import org.apache.maven.repository.discovery.MetadataDiscoverer;
>> +import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
>> +import org.codehaus.plexus.scheduler.Scheduler;
>> +import org.quartz.CronTrigger;
>> +import org.quartz.JobDataMap;
>> +import org.quartz.JobDetail;
>> +import org.quartz.SchedulerException;
>> +
>> +import java.io.File;
>> +import java.io.IOException;
>> +import java.net.MalformedURLException;
>> +import java.text.ParseException;
>> +import java.util.Properties;
>> +
>> +/**
>> + * This class sets the job to be executed in the plexus-quartz
>> scheduler
>> + *
>> + * @plexus.component
>> role="org.apache.maven.repository.manager.web.job.DiscovererScheduler"
>> + */
>> +public class DiscovererScheduler
>> +{
>> + /**
>> + * @plexus.requirement
>> + */
>> + private Configuration config;
>> +
>> + /**
>> + * @plexus.requirement
>> + */
>> + private Scheduler scheduler;
>> +
>> + /**
>> + * @plexus.requirement
>> role="org.apache.maven.repository.discovery.ArtifactDiscoverer"
>> role-hint="org.apache.maven.repository.discovery.DefaultArtifactDiscoverer"
>>
>> + */
>> + private ArtifactDiscoverer defaultArtifactDiscoverer;
>> +
>> + /**
>> + * @plexus.requirement
>> role="org.apache.maven.repository.discovery.ArtifactDiscoverer"
>> role-hint="org.apache.maven.repository.discovery.LegacyArtifactDiscoverer"
>>
>> + */
>> + private ArtifactDiscoverer legacyArtifactDiscoverer;
>> +
>> + /**
>> + * @plexus.requirement
>> role="org.apache.maven.repository.discovery.MetadataDiscoverer"
>> role-hint="org.apache.maven.repository.discovery.DefaultMetadataDiscoverer"
>>
>> + */
>> + private MetadataDiscoverer defaultMetadataDiscoverer;
>> +
>> + /**
>> + * @plexus.requirement
>> + */
>> + private RepositoryIndexingFactory indexFactory;
>> +
>> + /**
>> + * @plexus.requirement
>> + */
>> + private ArtifactRepositoryFactory repoFactory;
>> +
>> + private Properties props;
>> +
>> + /**
>> + * Method that sets the schedule in the plexus-quartz scheduler
>> + *
>> + * @throws IOException
>> + * @throws ParseException
>> + * @throws SchedulerException
>> + */
>> + public void setSchedule()
>> + throws IOException, ParseException, SchedulerException
>> + {
>> + props = config.getProperties();
>> + JobDetail jobDetail = new JobDetail( "discovererJob",
>> "DISCOVERER", DiscovererJob.class );
>> + JobDataMap dataMap = new JobDataMap();
>> + dataMap.put( DiscovererJob.MAP_INDEXPATH, props.getProperty(
>> "index.path" ) );
>> + dataMap.put( DiscovererJob.MAP_BLACKLIST, props.getProperty(
>> "blacklist.patterns" ) );
>> + dataMap.put( DiscovererJob.MAP_DEFAULT_REPOSITORY,
>> getDefaultRepository() );
>> + dataMap.put( DiscovererJob.MAP_LAYOUT, props.getProperty(
>> "layout" ) );
>> + dataMap.put( DiscovererJob.MAP_SNAPSHOTS, new Boolean(
>> props.getProperty( "include.snapshots" ) ) );
>> + dataMap.put( DiscovererJob.MAP_CONVERT, new Boolean(
>> props.getProperty( "convert.snapshots" ) ) );
>> + dataMap.put( DiscovererJob.MAP_DEF_ARTIFACT_DISCOVERER,
>> defaultArtifactDiscoverer );
>> + dataMap.put( DiscovererJob.MAP_LEG_ARTIFACT_DISCOVERER,
>> legacyArtifactDiscoverer );
>> + dataMap.put( DiscovererJob.MAP_DEF_METADATA_DISCOVERER,
>> defaultMetadataDiscoverer );
>> + dataMap.put( DiscovererJob.MAP_IDX_FACTORY, indexFactory );
>> + dataMap.put( DiscovererJob.MAP_REPO_LAYOUT,
>> config.getLayout() );
>> + dataMap.put( DiscovererJob.MAP_REPO_FACTORY, repoFactory );
>> + jobDetail.setJobDataMap( dataMap );
>> +
>> + CronTrigger trigger =
>> + new CronTrigger( "DiscovererTrigger", "DISCOVERER",
>> props.getProperty( "cron.expression" ) );
>> + scheduler.scheduleJob( jobDetail, trigger );
>> + }
>> +
>> + /**
>> + * Method that creates the artifact repository
>> + *
>> + * @return an ArtifactRepository instance
>> + * @throws java.net.MalformedURLException
>> + */
>> + private ArtifactRepository getDefaultRepository()
>> + throws MalformedURLException
>> + {
>> + File repositoryDirectory = new File(
>> config.getRepositoryDirectory() );
>> + String repoDir = repositoryDirectory.toURL().toString();
>> + ArtifactRepositoryFactory repoFactory = new
>> DefaultArtifactRepositoryFactory();
>> +
>> + return repoFactory.createArtifactRepository( "test",
>> repoDir, config.getLayout(), null, null );
>> + }
>> +
>> + /**
>> + * Method that sets the configuration object
>> + *
>> + * @param config
>> + */
>> + public void setConfiguration( Configuration config )
>> + {
>> + this.config = config;
>> + }
>> +
>> + /**
>> + * Returns the cofiguration
>> + *
>> + * @return a Configuration object that contains the
>> configuration values
>> + */
>> + public Configuration getConfiguration()
>> + {
>> + return config;
>> + }
>> +
>> +}
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
>> Thu Mar 2 01:53:40 2006
>> @@ -27,8 +27,9 @@
>> <default-interceptor-ref name="defaultStack"/>
>>
>> <!-- Action: Front page -->
>> - <action name="index" class="com.opensymphony.xwork.ActionSupport">
>> + <action name="index"
>> class="org.apache.maven.repository.manager.web.action.BaseAction">
>> <result name="success"
>> type="dispatcher">/WEB-INF/jsp/index.jsp</result>
>> + <result name="error"
>> type="dispatcher">/WEB-INF/jsp/index.jsp</result>
>> </action>
>>
>> <action name="searchg"
>> class="org.apache.maven.repository.manager.web.action.GeneralSearchAction">
>>
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
>> Thu Mar 2 01:53:40 2006
>> @@ -1,26 +1,28 @@
>> <%@ taglib uri="webwork" prefix="ww" %>
>> -<%@page import="java.util.*"%>
>> +
>> <html>
>> <head>
>> -<title>Repository Browser</title>
>> + <title>Repository Browser</title>
>> </head>
>> +
>> <body>
>> <h3><a href="<ww:url value="browse!edit.action"><ww:param name="idx"
>> value="0"/></ww:url>">basedir</a> /
>> -<ww:set name="previousFolder" value="''"/>
>> -<ww:set name="counter" value="0"/>
>> -<ww:if test="folder != ''">
>> - <ww:set name="folderHeader" value="folder.split('/')"/>
>> - <ww:iterator value="#folderHeader">
>> - <ww:set name="counter" value="#counter + 1"/>
>> - <ww:if test="#previousFolder == ''">
>> - <ww:set name="previousFolder" value="top"/>
>> - </ww:if>
>> - <ww:else>
>> - <ww:set name="previousFolder" value="#previousFolder + '/' +
>> top"/>
>> - </ww:else>
>> - <ww:if test="idx > (#counter + 1)"><a href="<ww:url
>> value="browse!edit.action"><ww:param name="idx"><ww:property
>> value="#counter"/></ww:param><ww:param
>> name="folder"></ww:param></ww:url>"></ww:if><ww:property/></a> /
>> - </ww:iterator>
>> -</ww:if>
>> + <ww:set name="previousFolder" value="''"/>
>> + <ww:set name="counter" value="0"/>
>> + <ww:if test="folder != ''">
>> + <ww:set name="folderHeader" value="folder.split('/')"/>
>> + <ww:iterator value="#folderHeader">
>> + <ww:set name="counter" value="#counter + 1"/>
>> + <ww:if test="#previousFolder == ''">
>> + <ww:set name="previousFolder" value="top"/>
>> + </ww:if>
>> + <ww:else>
>> + <ww:set name="previousFolder" value="#previousFolder + '/' +
>> top"/>
>> + </ww:else>
>> + <ww:if test="idx > (#counter + 1)"><a href="<ww:url
>> value="browse!edit.action"><ww:param name="idx"><ww:property
>> + value="#counter"/></ww:param><ww:param
>> name="folder"></ww:param></ww:url>"></ww:if><ww:property/></a> /
>> + </ww:iterator>
>> + </ww:if>
>> </h3>
>> <br/>
>>
>> @@ -29,54 +31,59 @@
>> <ww:iterator value="artifactMap.keySet().iterator()">
>> <ww:set name="groupName" value="top"/>
>> <ww:if test="idx == 1 || (folder != '' and
>> #groupName.startsWith(folder))">
>> -<%
>> -int ctr = 1;
>> -%>
>> + <%
>> +
>> + int ctr = 1;
>> +
>> + %>
>> <ww:set name="groupFolder" value="#groupName.split('/')"/>
>> - <ww:iterator value="#groupFolder">
>> -<%
>> -if (ctr == ((Integer)pageContext.getAttribute("in")).intValue()) {%>
>> - <ww:if test="top != #previousFolder">
>> - <ww:set name="previousFolder" value="top"/>
>> - <a href="<ww:url value="browse!edit.action"><ww:param
>> name="folder"><ww:property value="folder"/><ww:if test="folder !=
>> ''">/</ww:if><ww:property/></ww:param><ww:param name="idx"
>> value="idx"/></ww:url>"">
>> - <ww:property/>/
>> - </a><br>
>> - </ww:if>
>> -<%
>> -}
>> -ctr++;
>> -%>
>> - </ww:iterator>
>> -</ww:if>
>> -</ww:iterator>
>> +<ww:iterator value="#groupFolder">
>> + <%
>>
>> -<ww:if test="folder != ''">
>> - <ww:set name="previousFolder" value="''"/>
>> - <ww:set name="artifactList" value="artifactMap.get(folder)"/>
>> - <ww:iterator value="#artifactList">
>> -<table border="1">
>> - <tr align="left">
>> - <th>Group ID</th>
>> - <td><ww:property value="groupId"/></td>
>> - </tr>
>> - <tr align="left">
>> - <th>Artifact ID</th>
>> - <td><ww:property value="artifactId"/></td>
>> - </tr>
>> - <tr align="left">
>> - <th>Version</th>
>> - <td><ww:property value="version"/></td>
>> - </tr>
>> - <tr align="left">
>> - <th>Derivatives</th>
>> - <td><ww:property value="groupId"/></td>
>> - </tr>
>> - <tr align="left">
>> - <th>Parent</th>
>> - <td><ww:property value="folder"/></td>
>> - </tr>
>> -</table><br/>
>> +if (ctr == ((Integer)pageContext.getAttribute("in")).intValue()) {
>> + %>
>> +<ww:if test="top != #previousFolder">
>> + <ww:set name="previousFolder" value="top"/>
>> +<a href="<ww:url value="browse!edit.action"><ww:param
>> name="folder"><ww:property value="folder"/><ww:if test="folder !=
>> ''">/</ww:if><ww:property/></ww:param><ww:param name="idx"
>> value="idx"/></ww:url>"">
>> + <ww:property/>/
>> + </ a><br>
>> + </ww:if>
>> + <%
>> + }
>> + ctr++;
>> + %>
>> + </ww:iterator>
>> + </ww:if>
>> </ww:iterator>
>> -</ww:if>
>> +
>> + <ww:if test="folder != ''">
>> + <ww:set name="previousFolder" value="''"/>
>> + <ww:set name="artifactList" value="artifactMap.get(folder)"/>
>> + <ww:iterator value="#artifactList">
>> + <table border="1">
>> + <tr align="left">
>> + <th>Group ID</th>
>> + <td><ww:property value="groupId"/></td>
>> + </tr>
>> + <tr align="left">
>> + <th>Artifact ID</th>
>> + <td><ww:property value="artifactId"/></td>
>> + </tr>
>> + <tr align="left">
>> + <th>Version</th>
>> + <td><ww:property value="version"/></td>
>> + </tr>
>> + <tr align="left">
>> + <th>Derivatives</th>
>> + <td><ww:property value="groupId"/></td>
>> + </tr>
>> + <tr align="left">
>> + <th>Parent</th>
>> + <td><ww:property value="folder"/></td>
>> + </tr>
>> + </table>
>> + <br/>
>> + </ww:iterator>
>> + </ww:if>
>> </body>
>> </html>
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
>> Thu Mar 2 01:53:40 2006
>> @@ -34,30 +34,33 @@
>> <!--"CONVERTED_APPLET"-->
>> <!-- HTML CONVERTER -->
>> <script language="JavaScript" type="text/javascript"><!--
>> - var _info = navigator.userAgent;
>> - var _ns = false;
>> - var _ns6 = false;
>> - var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0
>> && _info.indexOf("Windows 3.1") < 0);
>> +var _info = navigator.userAgent;
>> +var _ns = false;
>> +var _ns6 = false;
>> +var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 &&
>> _info.indexOf("Windows 3.1") < 0);
>> //--></script>
>>
>> <comment>
>> <script language="JavaScript" type="text/javascript"><!--
>> - var _ns = (navigator.appName.indexOf("Netscape") >= 0 &&
>> ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 &&
>> java.lang.System.getProperty("os.version").indexOf("3.5") < 0) ||
>> (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) ||
>> (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) ||
>> (_info.indexOf("IRIX") > 0)));
>> - var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >=
>> 0));
>> -//--></script>
>> + var _ns = (navigator.appName.indexOf("Netscape") >= 0 &&
>> ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 &&
>> +
>> java.lang.System.getProperty("os.version").indexOf("3.5") <
>> + 0) ||
>> (_info.indexOf("Sun") > 0) ||
>> +
>> (_info.indexOf("Linux") > 0) ||
>> +
>> (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) ||
>> +
>> (_info.indexOf("IRIX") > 0)));
>> + var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
>> + //--></script>
>> </comment>
>>
>> <script language="JavaScript" type="text/javascript"><!--
>> - if (_ie == true) document.writeln('<object
>> classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "400"
>> HEIGHT = "20" NAME = "ChecksumApplet"
>> codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,5"><noembed><xmp>');
>>
>> - else if (_ns == true && _ns6 == false) document.writeln('<embed ' +
>> - 'type="application/x-java-applet;version=1.5" \
>> +if ( _ie ==
>> + true ) document.writeln('<object
>> classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "400"
>> HEIGHT = "20" NAME = "ChecksumApplet"
>> codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,5"><noembed><xmp>');
>>
>> +else if ( _ns == true && _ns6 == false ) document.writeln('<embed '
>> + 'type="application/x-java-applet;version=1.5" \
>> CODE =
>> "org/apache/maven/repository/applet/ChecksumApplet.class" \
>> ARCHIVE = "maven-repository-artifact-applet.jar" \
>> NAME = "ChecksumApplet" \
>> WIDTH = "400" \
>> - HEIGHT = "20" ' +
>> - 'scriptable=false ' +
>> -
>> 'pluginspage="http://java.sun.com/products/plugin/index.html#download"><noembed><xmp>');
>>
>> + HEIGHT = "20" ' + 'scriptable=false ' +
>> 'pluginspage="http://java.sun.com/products/plugin/index.html#download"><noembed><xmp>');
>>
>> //--></script>
>> <applet
>> CODE="org/apache/maven/repository/applet/ChecksumApplet.class"
>> ARCHIVE="maven-repository-artifact-applet.jar"
>> WIDTH="400" HEIGHT="20" NAME="ChecksumApplet"></xmp>
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp
>> Thu Mar 2 01:53:40 2006
>> @@ -24,7 +24,7 @@
>>
>> <h1>Maven Repository Manager</h1>
>>
>> -<%@include file="form.jspf"%>
>> +<%@ include file="form.jspf" %>
>>
>> <table border="1px" cellspacing="0">
>> <tr>
>> @@ -50,8 +50,8 @@
>> <tr>
>> <td valign="top" width="15%"
>> align="right"><ww:property value="Key"/></td>
>> <td valign="top">
>> - <ww:iterator value="Value" id="test" status="" >
>> - <ww:property />
>> + <ww:iterator value="Value" id="test" status="">
>> + <ww:property/>
>> </ww:iterator>
>> <br/>
>> </td>
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
>> Thu Mar 2 01:53:40 2006
>> @@ -24,7 +24,7 @@
>>
>> <h1>Maven Repository Manager</h1>
>>
>> -<%@include file="form.jspf"%>
>> +<%@ include file="form.jspf" %>
>>
>> <table>
>> <tr>
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
>> Thu Mar 2 01:53:40 2006
>> @@ -40,7 +40,7 @@
>> <role>com.opensymphony.xwork.ObjectFactory</role>
>>
>> <implementation>org.codehaus.plexus.xwork.PlexusObjectFactory</implementation>
>>
>> </component>
>> - +
>> <component>
>>
>> <role>org.apache.maven.repository.manager.web.job.Configuration</role>
>>
>> <implementation>org.apache.maven.repository.manager.web.job.Configuration</implementation>
>>
>> @@ -52,7 +52,7 @@
>> </property>
>> <property>
>> <name>default.repository.dir</name>
>> - <value>C:/TEST_REPOS/repository</value>
>> + <value>C:/TEST_REPOS/.m2/repository/</value>
>> </property>
>> <property>
>> <name>legacy.repository.dir</name>
>> @@ -81,14 +81,6 @@
>> </properties>
>> </configuration>
>> </component>
>> -
>> -
>> - <!--
>> - <component>
>> -
>> <role>org.apache.maven.repository.manager.web.job.DiscovererJob</role>
>> - </component>
>> -
>> - -->
>>
>> <!--
>> | Logger manager
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r382337 - in /maven/repository-manager/trunk/maven-repository-webapp:
./ src/main/java/org/apache/maven/repository/manager/web/action/ src/main/java/org/apache/maven/repository/manager/web/job/
src/main/resources/ src/main/webapp/WEB-INF/ s...
Posted by Emmanuel Venisse <em...@venisse.net>.
ping
Emmanuel Venisse a écrit :
> I think it will be better to use a logger instead of System.out.println
> in DiscoverJob.
>
> Emmanuel
>
> epunzalan@apache.org a écrit :
>
>> Author: epunzalan
>> Date: Thu Mar 2 01:53:40 2006
>> New Revision: 382337
>>
>> URL: http://svn.apache.org/viewcvs?rev=382337&view=rev
>> Log:
>> PR: MRM-36
>> Submitted by: Maria Odea Ching
>>
>> Applied patch for discovery and indexing schedule
>>
>> Added:
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/pom.xml
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
>>
>>
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
>>
>>
>> Modified: maven/repository-manager/trunk/maven-repository-webapp/pom.xml
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/pom.xml?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> --- maven/repository-manager/trunk/maven-repository-webapp/pom.xml
>> (original)
>> +++ maven/repository-manager/trunk/maven-repository-webapp/pom.xml Thu
>> Mar 2 01:53:40 2006
>> @@ -42,7 +42,7 @@
>> <groupId>org.mortbay.jetty</groupId>
>> <artifactId>maven-jetty6-plugin</artifactId>
>> <configuration>
>> -
>> <webAppSourceDirectory>${basedir}/target/${artifactId}</webAppSourceDirectory
>> >
>> +
>> <webAppSourceDirectory>${basedir}/target/${artifactId}</webAppSourceDirectory>
>>
>> <scanIntervalSeconds>10</scanIntervalSeconds>
>> </configuration>
>> </plugin>
>>
>> Added:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java?rev=382337&view=auto
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
>> (added)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
>> Thu Mar 2 01:53:40 2006
>> @@ -0,0 +1,57 @@
>> +package org.apache.maven.repository.manager.web.action;
>> +
>> +/*
>> + * Copyright 2005-2006 The Apache Software Foundation.
>> + *
>> + * Licensed 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 com.opensymphony.xwork.Action;
>> +import org.apache.maven.repository.manager.web.job.DiscovererScheduler;
>> +
>> +/**
>> + * This is the Action class of index.jsp, which is the initial page
>> of the web application.
>> + * It invokes the DiscovererScheduler to set the DiscoverJob in the
>> scheduler.
>> + *
>> + * @plexus.component role="com.opensymphony.xwork.Action"
>> role-hint="org.apache.maven.repository.manager.web.action.BaseAction"
>> + */
>> +public class BaseAction
>> + implements Action
>> +{
>> +
>> + /**
>> + * @plexus.requirement
>> + */
>> + private DiscovererScheduler discovererScheduler;
>> +
>> + /**
>> + * Method that executes the action
>> + *
>> + * @return a String that specifies if the action executed was a
>> success or a failure
>> + */
>> + public String execute()
>> + {
>> + try
>> + {
>> + discovererScheduler.setSchedule();
>> + }
>> + catch ( Exception e )
>> + {
>> + e.printStackTrace();
>> + return ERROR;
>> + }
>> +
>> + return SUCCESS;
>> + }
>> +
>> +}
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
>> Thu Mar 2 01:53:40 2006
>> @@ -24,7 +24,7 @@
>> */
>>
>> /**
>> - *
>> + * This class contains the configuration values to be used by the
>> scheduler
>> */
>> public class Configuration
>> implements Initializable
>> @@ -32,17 +32,29 @@
>>
>> private Properties props;
>>
>> + /**
>> + * @throws InitializationException
>> + */
>> public void initialize()
>> throws InitializationException
>> {
>> - System.out.println( "Configuration initialized" );
>> }
>>
>> + /**
>> + * Set the properties object
>> + *
>> + * @param properties
>> + */
>> public void setProperties( Properties properties )
>> {
>> this.props = properties;
>> }
>>
>> + /**
>> + * Returns the properties object
>> + *
>> + * @return a Properties object that contains the configuration
>> values
>> + */
>> public Properties getProperties()
>> {
>> return props;
>>
>> Added:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java?rev=382337&view=auto
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
>> (added)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
>> Thu Mar 2 01:53:40 2006
>> @@ -0,0 +1,260 @@
>> +package org.apache.maven.repository.manager.web.job;
>> +
>> +/*
>> + * Copyright 2005-2006 The Apache Software Foundation.
>> + *
>> + * Licensed 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.artifact.Artifact;
>> +import org.apache.maven.artifact.repository.ArtifactRepository;
>> +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
>> +import
>> org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
>> +import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
>> +import org.apache.maven.model.Model;
>> +import org.apache.maven.repository.discovery.ArtifactDiscoverer;
>> +import org.apache.maven.repository.discovery.DefaultArtifactDiscoverer;
>> +import org.apache.maven.repository.discovery.DefaultMetadataDiscoverer;
>> +import org.apache.maven.repository.discovery.LegacyArtifactDiscoverer;
>> +import org.apache.maven.repository.discovery.MetadataDiscoverer;
>> +import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
>> +import org.apache.maven.repository.indexing.MetadataRepositoryIndex;
>> +import org.apache.maven.repository.indexing.PomRepositoryIndex;
>> +import org.apache.maven.repository.indexing.RepositoryIndexException;
>> +import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
>> +import org.codehaus.plexus.scheduler.AbstractJob;
>> +import org.quartz.JobDataMap;
>> +import org.quartz.JobExecutionContext;
>> +import org.quartz.JobExecutionException;
>> +
>> +import java.io.File;
>> +import java.net.MalformedURLException;
>> +import java.util.Iterator;
>> +import java.util.List;
>> +
>> +/**
>> + * This class executes the discoverer and the indexer.
>> + *
>> + * @plexus.component
>> role="org.apache.maven.repository.manager.web.job.DiscovererJob"
>> + */
>> +public class DiscovererJob
>> + extends AbstractJob
>> +{
>> + public static final String ROLE = DiscovererJob.class.getName();
>> +
>> + private ArtifactDiscoverer defaultArtifactDiscoverer;
>> +
>> + private ArtifactDiscoverer legacyArtifactDiscoverer;
>> +
>> + private MetadataDiscoverer defaultMetadataDiscoverer;
>> +
>> + private RepositoryIndexingFactory indexFactory;
>> +
>> + private ArtifactRepositoryLayout layout;
>> +
>> + private ArtifactRepositoryFactory repoFactory;
>> +
>> + public static String MAP_INDEXPATH = "INDEXPATH";
>> +
>> + public static String MAP_LAYOUT = "LAYOUT";
>> +
>> + public static String MAP_DEFAULT_REPOSITORY = "DEFAULT_REPOSITORY";
>> +
>> + public static String MAP_BLACKLIST = "BLACKLISTED_PATTERNS";
>> +
>> + public static String MAP_SNAPSHOTS = "INCLUDE_SNAPSHOTS";
>> +
>> + public static String MAP_CONVERT = "CONVERT_SNAPSHOTS";
>> +
>> + public static String MAP_DEF_ARTIFACT_DISCOVERER =
>> "DEFAULT_ARTIFACT_DISCOVERER";
>> +
>> + public static String MAP_LEG_ARTIFACT_DISCOVERER =
>> "LEGACY_ARTIFACT_DISCOVERER";
>> +
>> + public static String MAP_DEF_METADATA_DISCOVERER =
>> "DEFAULT_METADATA_DISCOVERER";
>> +
>> + public static String MAP_IDX_FACTORY = "INDEX_FACTORY";
>> +
>> + public static String MAP_REPO_LAYOUT = "REPOSITORY_LAYOUT";
>> +
>> + public static String MAP_REPO_FACTORY = "REPOSITORY_FACTORY";
>> +
>> + /**
>> + * Execute the discoverer and the indexer.
>> + *
>> + * @param context
>> + * @throws org.quartz.JobExecutionException
>> + *
>> + */
>> + public void execute( JobExecutionContext context )
>> + throws JobExecutionException
>> + {
>> + System.out.println( "Start execution of DiscovererJob.." );
>> + JobDataMap dataMap = context.getJobDetail().getJobDataMap();
>> +
>> + //configuration values specified in properties file
>> + String indexPath = (String) dataMap.get( MAP_INDEXPATH );
>> + ArtifactRepository defaultRepository = (ArtifactRepository)
>> dataMap.get( MAP_DEFAULT_REPOSITORY );
>> + String blacklistedPatterns = (String) dataMap.get(
>> MAP_BLACKLIST );
>> + boolean includeSnapshots = ( (Boolean) dataMap.get(
>> MAP_SNAPSHOTS ) ).booleanValue();
>> + boolean convertSnapshots = ( (Boolean) dataMap.get(
>> MAP_CONVERT ) ).booleanValue();
>> +
>> + //plexus components created in BaseAction
>> + defaultArtifactDiscoverer = (DefaultArtifactDiscoverer)
>> dataMap.get( MAP_DEF_ARTIFACT_DISCOVERER );
>> + legacyArtifactDiscoverer = (LegacyArtifactDiscoverer)
>> dataMap.get( MAP_LEG_ARTIFACT_DISCOVERER );
>> + defaultMetadataDiscoverer = (DefaultMetadataDiscoverer)
>> dataMap.get( MAP_DEF_METADATA_DISCOVERER );
>> + indexFactory = (RepositoryIndexingFactory) dataMap.get(
>> MAP_IDX_FACTORY );
>> + layout = (ArtifactRepositoryLayout) dataMap.get(
>> MAP_REPO_LAYOUT );
>> + repoFactory = (ArtifactRepositoryFactory) dataMap.get(
>> MAP_REPO_FACTORY );
>> +
>> + try
>> + {
>> + List artifacts;
>> + if ( dataMap.get( MAP_LAYOUT ).equals( "default" ) )
>> + {
>> + artifacts =
>> defaultArtifactDiscoverer.discoverArtifacts( defaultRepository,
>> blacklistedPatterns,
>> +
>> includeSnapshots );
>> + indexArtifact( artifacts, indexPath,
>> defaultRepository );
>> +
>> + List models =
>> defaultArtifactDiscoverer.discoverStandalonePoms( defaultRepository,
>> blacklistedPatterns,
>> +
>> convertSnapshots );
>> + indexPom( models, indexPath, defaultRepository );
>> +
>> + List metadataList =
>> defaultMetadataDiscoverer.discoverMetadata(
>> + new File( defaultRepository.getBasedir() ),
>> blacklistedPatterns );
>> + indexMetadata( metadataList, indexPath, new File(
>> defaultRepository.getBasedir() ) );
>> + }
>> + else if ( dataMap.get( MAP_LAYOUT ).equals( "legacy" ) )
>> + {
>> + artifacts =
>> legacyArtifactDiscoverer.discoverArtifacts( defaultRepository,
>> blacklistedPatterns,
>> +
>> includeSnapshots );
>> + indexArtifact( artifacts, indexPath,
>> defaultRepository );
>> + }
>> + }
>> + catch ( RepositoryIndexException e )
>> + {
>> + e.printStackTrace();
>> + }
>> + catch ( MalformedURLException me )
>> + {
>> + me.printStackTrace();
>> + }
>> +
>> + System.out.println( "[DiscovererJob] DiscovererJob has
>> finished executing." );
>> + }
>> +
>> + /**
>> + * Index the artifacts in the list
>> + *
>> + * @param artifacts the artifacts to be indexed
>> + * @param indexPath the path to the index file
>> + * @param repository the repository where the artifacts are located
>> + */
>> + private void indexArtifact( List artifacts, String indexPath,
>> ArtifactRepository repository )
>> + throws RepositoryIndexException
>> + {
>> + ArtifactRepositoryIndex artifactIndex =
>> indexFactory.createArtifactRepositoryIndex( indexPath, repository );
>> + for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
>> + {
>> + Artifact artifact = (Artifact) iter.next();
>> + try
>> + {
>> + artifactIndex.indexArtifact( artifact );
>> + }
>> + catch ( Exception e )
>> + {
>> + if ( e instanceof RepositoryIndexException )
>> + {
>> + throw (RepositoryIndexException) e;
>> + }
>> + }
>> +
>> + if ( artifactIndex.isOpen() )
>> + {
>> + artifactIndex.optimize();
>> + artifactIndex.close();
>> + }
>> + }
>> + }
>> +
>> + /**
>> + * Index the metadata in the list
>> + *
>> + * @param metadataList the metadata to be indexed
>> + * @param indexPath the path to the index file
>> + * @param repositoryBase the repository where the metadata are
>> located
>> + */
>> + private void indexMetadata( List metadataList, String indexPath,
>> File repositoryBase )
>> + throws RepositoryIndexException, MalformedURLException
>> + {
>> + String repoDir = repositoryBase.toURL().toString();
>> + ArtifactRepository repository =
>> + repoFactory.createArtifactRepository( "repository",
>> repoDir, layout, null, null );
>> +
>> + MetadataRepositoryIndex metadataIndex =
>> indexFactory.createMetadataRepositoryIndex( indexPath, repository );
>> + for ( Iterator iter = metadataList.iterator(); iter.hasNext(); )
>> + {
>> + RepositoryMetadata repoMetadata = (RepositoryMetadata)
>> iter.next();
>> + try
>> + {
>> + metadataIndex.index( repoMetadata );
>> + }
>> + catch ( Exception e )
>> + {
>> + if ( e instanceof RepositoryIndexException )
>> + {
>> + throw (RepositoryIndexException) e;
>> + }
>> + }
>> + if ( metadataIndex.isOpen() )
>> + {
>> + metadataIndex.optimize();
>> + metadataIndex.close();
>> + }
>> + }
>> + }
>> +
>> + /**
>> + * Index the poms in the list
>> + *
>> + * @param models list of poms that will be indexed
>> + * @param indexPath the path to the index
>> + * @param repository the artifact repository where the poms were
>> discovered
>> + */
>> + private void indexPom( List models, String indexPath,
>> ArtifactRepository repository )
>> + throws RepositoryIndexException
>> + {
>> + PomRepositoryIndex pomIndex =
>> indexFactory.createPomRepositoryIndex( indexPath, repository );
>> + for ( Iterator iter = models.iterator(); iter.hasNext(); )
>> + {
>> + Model model = (Model) iter.next();
>> + try
>> + {
>> + pomIndex.indexPom( model );
>> + }
>> + catch ( Exception e )
>> + {
>> + if ( e instanceof RepositoryIndexException )
>> + {
>> + throw (RepositoryIndexException) e;
>> + }
>> + }
>> +
>> + if ( pomIndex.isOpen() )
>> + {
>> + pomIndex.optimize();
>> + pomIndex.close();
>> + }
>> + }
>> + }
>> +
>> +}
>>
>> Added:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java?rev=382337&view=auto
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
>> (added)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
>> Thu Mar 2 01:53:40 2006
>> @@ -0,0 +1,149 @@
>> +package org.apache.maven.repository.manager.web.job;
>> +
>> +/*
>> + * Copyright 2005-2006 The Apache Software Foundation.
>> + *
>> + * Licensed 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.artifact.repository.ArtifactRepository;
>> +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
>> +import
>> org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory;
>> +import org.apache.maven.repository.discovery.ArtifactDiscoverer;
>> +import org.apache.maven.repository.discovery.MetadataDiscoverer;
>> +import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
>> +import org.codehaus.plexus.scheduler.Scheduler;
>> +import org.quartz.CronTrigger;
>> +import org.quartz.JobDataMap;
>> +import org.quartz.JobDetail;
>> +import org.quartz.SchedulerException;
>> +
>> +import java.io.File;
>> +import java.io.IOException;
>> +import java.net.MalformedURLException;
>> +import java.text.ParseException;
>> +import java.util.Properties;
>> +
>> +/**
>> + * This class sets the job to be executed in the plexus-quartz scheduler
>> + *
>> + * @plexus.component
>> role="org.apache.maven.repository.manager.web.job.DiscovererScheduler"
>> + */
>> +public class DiscovererScheduler
>> +{
>> + /**
>> + * @plexus.requirement
>> + */
>> + private Configuration config;
>> +
>> + /**
>> + * @plexus.requirement
>> + */
>> + private Scheduler scheduler;
>> +
>> + /**
>> + * @plexus.requirement
>> role="org.apache.maven.repository.discovery.ArtifactDiscoverer"
>> role-hint="org.apache.maven.repository.discovery.DefaultArtifactDiscoverer"
>>
>> + */
>> + private ArtifactDiscoverer defaultArtifactDiscoverer;
>> +
>> + /**
>> + * @plexus.requirement
>> role="org.apache.maven.repository.discovery.ArtifactDiscoverer"
>> role-hint="org.apache.maven.repository.discovery.LegacyArtifactDiscoverer"
>>
>> + */
>> + private ArtifactDiscoverer legacyArtifactDiscoverer;
>> +
>> + /**
>> + * @plexus.requirement
>> role="org.apache.maven.repository.discovery.MetadataDiscoverer"
>> role-hint="org.apache.maven.repository.discovery.DefaultMetadataDiscoverer"
>>
>> + */
>> + private MetadataDiscoverer defaultMetadataDiscoverer;
>> +
>> + /**
>> + * @plexus.requirement
>> + */
>> + private RepositoryIndexingFactory indexFactory;
>> +
>> + /**
>> + * @plexus.requirement
>> + */
>> + private ArtifactRepositoryFactory repoFactory;
>> +
>> + private Properties props;
>> +
>> + /**
>> + * Method that sets the schedule in the plexus-quartz scheduler
>> + *
>> + * @throws IOException
>> + * @throws ParseException
>> + * @throws SchedulerException
>> + */
>> + public void setSchedule()
>> + throws IOException, ParseException, SchedulerException
>> + {
>> + props = config.getProperties();
>> + JobDetail jobDetail = new JobDetail( "discovererJob",
>> "DISCOVERER", DiscovererJob.class );
>> + JobDataMap dataMap = new JobDataMap();
>> + dataMap.put( DiscovererJob.MAP_INDEXPATH, props.getProperty(
>> "index.path" ) );
>> + dataMap.put( DiscovererJob.MAP_BLACKLIST, props.getProperty(
>> "blacklist.patterns" ) );
>> + dataMap.put( DiscovererJob.MAP_DEFAULT_REPOSITORY,
>> getDefaultRepository() );
>> + dataMap.put( DiscovererJob.MAP_LAYOUT, props.getProperty(
>> "layout" ) );
>> + dataMap.put( DiscovererJob.MAP_SNAPSHOTS, new Boolean(
>> props.getProperty( "include.snapshots" ) ) );
>> + dataMap.put( DiscovererJob.MAP_CONVERT, new Boolean(
>> props.getProperty( "convert.snapshots" ) ) );
>> + dataMap.put( DiscovererJob.MAP_DEF_ARTIFACT_DISCOVERER,
>> defaultArtifactDiscoverer );
>> + dataMap.put( DiscovererJob.MAP_LEG_ARTIFACT_DISCOVERER,
>> legacyArtifactDiscoverer );
>> + dataMap.put( DiscovererJob.MAP_DEF_METADATA_DISCOVERER,
>> defaultMetadataDiscoverer );
>> + dataMap.put( DiscovererJob.MAP_IDX_FACTORY, indexFactory );
>> + dataMap.put( DiscovererJob.MAP_REPO_LAYOUT,
>> config.getLayout() );
>> + dataMap.put( DiscovererJob.MAP_REPO_FACTORY, repoFactory );
>> + jobDetail.setJobDataMap( dataMap );
>> +
>> + CronTrigger trigger =
>> + new CronTrigger( "DiscovererTrigger", "DISCOVERER",
>> props.getProperty( "cron.expression" ) );
>> + scheduler.scheduleJob( jobDetail, trigger );
>> + }
>> +
>> + /**
>> + * Method that creates the artifact repository
>> + *
>> + * @return an ArtifactRepository instance
>> + * @throws java.net.MalformedURLException
>> + */
>> + private ArtifactRepository getDefaultRepository()
>> + throws MalformedURLException
>> + {
>> + File repositoryDirectory = new File(
>> config.getRepositoryDirectory() );
>> + String repoDir = repositoryDirectory.toURL().toString();
>> + ArtifactRepositoryFactory repoFactory = new
>> DefaultArtifactRepositoryFactory();
>> +
>> + return repoFactory.createArtifactRepository( "test", repoDir,
>> config.getLayout(), null, null );
>> + }
>> +
>> + /**
>> + * Method that sets the configuration object
>> + *
>> + * @param config
>> + */
>> + public void setConfiguration( Configuration config )
>> + {
>> + this.config = config;
>> + }
>> +
>> + /**
>> + * Returns the cofiguration
>> + *
>> + * @return a Configuration object that contains the configuration
>> values
>> + */
>> + public Configuration getConfiguration()
>> + {
>> + return config;
>> + }
>> +
>> +}
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
>> Thu Mar 2 01:53:40 2006
>> @@ -27,8 +27,9 @@
>> <default-interceptor-ref name="defaultStack"/>
>>
>> <!-- Action: Front page -->
>> - <action name="index" class="com.opensymphony.xwork.ActionSupport">
>> + <action name="index"
>> class="org.apache.maven.repository.manager.web.action.BaseAction">
>> <result name="success"
>> type="dispatcher">/WEB-INF/jsp/index.jsp</result>
>> + <result name="error"
>> type="dispatcher">/WEB-INF/jsp/index.jsp</result>
>> </action>
>>
>> <action name="searchg"
>> class="org.apache.maven.repository.manager.web.action.GeneralSearchAction">
>>
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
>> Thu Mar 2 01:53:40 2006
>> @@ -1,26 +1,28 @@
>> <%@ taglib uri="webwork" prefix="ww" %>
>> -<%@page import="java.util.*"%>
>> +
>> <html>
>> <head>
>> -<title>Repository Browser</title>
>> + <title>Repository Browser</title>
>> </head>
>> +
>> <body>
>> <h3><a href="<ww:url value="browse!edit.action"><ww:param name="idx"
>> value="0"/></ww:url>">basedir</a> /
>> -<ww:set name="previousFolder" value="''"/>
>> -<ww:set name="counter" value="0"/>
>> -<ww:if test="folder != ''">
>> - <ww:set name="folderHeader" value="folder.split('/')"/>
>> - <ww:iterator value="#folderHeader">
>> - <ww:set name="counter" value="#counter + 1"/>
>> - <ww:if test="#previousFolder == ''">
>> - <ww:set name="previousFolder" value="top"/>
>> - </ww:if>
>> - <ww:else>
>> - <ww:set name="previousFolder" value="#previousFolder + '/' +
>> top"/>
>> - </ww:else>
>> - <ww:if test="idx > (#counter + 1)"><a href="<ww:url
>> value="browse!edit.action"><ww:param name="idx"><ww:property
>> value="#counter"/></ww:param><ww:param
>> name="folder"></ww:param></ww:url>"></ww:if><ww:property/></a> /
>> - </ww:iterator>
>> -</ww:if>
>> + <ww:set name="previousFolder" value="''"/>
>> + <ww:set name="counter" value="0"/>
>> + <ww:if test="folder != ''">
>> + <ww:set name="folderHeader" value="folder.split('/')"/>
>> + <ww:iterator value="#folderHeader">
>> + <ww:set name="counter" value="#counter + 1"/>
>> + <ww:if test="#previousFolder == ''">
>> + <ww:set name="previousFolder" value="top"/>
>> + </ww:if>
>> + <ww:else>
>> + <ww:set name="previousFolder" value="#previousFolder + '/' +
>> top"/>
>> + </ww:else>
>> + <ww:if test="idx > (#counter + 1)"><a href="<ww:url
>> value="browse!edit.action"><ww:param name="idx"><ww:property
>> + value="#counter"/></ww:param><ww:param
>> name="folder"></ww:param></ww:url>"></ww:if><ww:property/></a> /
>> + </ww:iterator>
>> + </ww:if>
>> </h3>
>> <br/>
>>
>> @@ -29,54 +31,59 @@
>> <ww:iterator value="artifactMap.keySet().iterator()">
>> <ww:set name="groupName" value="top"/>
>> <ww:if test="idx == 1 || (folder != '' and
>> #groupName.startsWith(folder))">
>> -<%
>> -int ctr = 1;
>> -%>
>> + <%
>> +
>> + int ctr = 1;
>> +
>> + %>
>> <ww:set name="groupFolder" value="#groupName.split('/')"/>
>> - <ww:iterator value="#groupFolder">
>> -<%
>> -if (ctr == ((Integer)pageContext.getAttribute("in")).intValue()) {%>
>> - <ww:if test="top != #previousFolder">
>> - <ww:set name="previousFolder" value="top"/>
>> - <a href="<ww:url value="browse!edit.action"><ww:param
>> name="folder"><ww:property value="folder"/><ww:if test="folder !=
>> ''">/</ww:if><ww:property/></ww:param><ww:param name="idx"
>> value="idx"/></ww:url>"">
>> - <ww:property/>/
>> - </a><br>
>> - </ww:if>
>> -<%
>> -}
>> -ctr++;
>> -%>
>> - </ww:iterator>
>> -</ww:if>
>> -</ww:iterator>
>> +<ww:iterator value="#groupFolder">
>> + <%
>>
>> -<ww:if test="folder != ''">
>> - <ww:set name="previousFolder" value="''"/>
>> - <ww:set name="artifactList" value="artifactMap.get(folder)"/>
>> - <ww:iterator value="#artifactList">
>> -<table border="1">
>> - <tr align="left">
>> - <th>Group ID</th>
>> - <td><ww:property value="groupId"/></td>
>> - </tr>
>> - <tr align="left">
>> - <th>Artifact ID</th>
>> - <td><ww:property value="artifactId"/></td>
>> - </tr>
>> - <tr align="left">
>> - <th>Version</th>
>> - <td><ww:property value="version"/></td>
>> - </tr>
>> - <tr align="left">
>> - <th>Derivatives</th>
>> - <td><ww:property value="groupId"/></td>
>> - </tr>
>> - <tr align="left">
>> - <th>Parent</th>
>> - <td><ww:property value="folder"/></td>
>> - </tr>
>> -</table><br/>
>> +if (ctr == ((Integer)pageContext.getAttribute("in")).intValue()) {
>> + %>
>> +<ww:if test="top != #previousFolder">
>> + <ww:set name="previousFolder" value="top"/>
>> +<a href="<ww:url value="browse!edit.action"><ww:param
>> name="folder"><ww:property value="folder"/><ww:if test="folder !=
>> ''">/</ww:if><ww:property/></ww:param><ww:param name="idx"
>> value="idx"/></ww:url>"">
>> + <ww:property/>/
>> + </ a><br>
>> + </ww:if>
>> + <%
>> + }
>> + ctr++;
>> + %>
>> + </ww:iterator>
>> + </ww:if>
>> </ww:iterator>
>> -</ww:if>
>> +
>> + <ww:if test="folder != ''">
>> + <ww:set name="previousFolder" value="''"/>
>> + <ww:set name="artifactList" value="artifactMap.get(folder)"/>
>> + <ww:iterator value="#artifactList">
>> + <table border="1">
>> + <tr align="left">
>> + <th>Group ID</th>
>> + <td><ww:property value="groupId"/></td>
>> + </tr>
>> + <tr align="left">
>> + <th>Artifact ID</th>
>> + <td><ww:property value="artifactId"/></td>
>> + </tr>
>> + <tr align="left">
>> + <th>Version</th>
>> + <td><ww:property value="version"/></td>
>> + </tr>
>> + <tr align="left">
>> + <th>Derivatives</th>
>> + <td><ww:property value="groupId"/></td>
>> + </tr>
>> + <tr align="left">
>> + <th>Parent</th>
>> + <td><ww:property value="folder"/></td>
>> + </tr>
>> + </table>
>> + <br/>
>> + </ww:iterator>
>> + </ww:if>
>> </body>
>> </html>
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
>> Thu Mar 2 01:53:40 2006
>> @@ -34,30 +34,33 @@
>> <!--"CONVERTED_APPLET"-->
>> <!-- HTML CONVERTER -->
>> <script language="JavaScript" type="text/javascript"><!--
>> - var _info = navigator.userAgent;
>> - var _ns = false;
>> - var _ns6 = false;
>> - var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0
>> && _info.indexOf("Windows 3.1") < 0);
>> +var _info = navigator.userAgent;
>> +var _ns = false;
>> +var _ns6 = false;
>> +var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 &&
>> _info.indexOf("Windows 3.1") < 0);
>> //--></script>
>>
>> <comment>
>> <script language="JavaScript" type="text/javascript"><!--
>> - var _ns = (navigator.appName.indexOf("Netscape") >= 0 &&
>> ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 &&
>> java.lang.System.getProperty("os.version").indexOf("3.5") < 0) ||
>> (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) ||
>> (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) ||
>> (_info.indexOf("IRIX") > 0)));
>> - var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
>> -//--></script>
>> + var _ns = (navigator.appName.indexOf("Netscape") >= 0 &&
>> ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 &&
>> +
>> java.lang.System.getProperty("os.version").indexOf("3.5") <
>> + 0) ||
>> (_info.indexOf("Sun") > 0) ||
>> +
>> (_info.indexOf("Linux") > 0) ||
>> +
>> (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) ||
>> +
>> (_info.indexOf("IRIX") > 0)));
>> + var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
>> + //--></script>
>> </comment>
>>
>> <script language="JavaScript" type="text/javascript"><!--
>> - if (_ie == true) document.writeln('<object
>> classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "400"
>> HEIGHT = "20" NAME = "ChecksumApplet"
>> codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,5"><noembed><xmp>');
>>
>> - else if (_ns == true && _ns6 == false) document.writeln('<embed ' +
>> - 'type="application/x-java-applet;version=1.5" \
>> +if ( _ie ==
>> + true ) document.writeln('<object
>> classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "400"
>> HEIGHT = "20" NAME = "ChecksumApplet"
>> codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,5"><noembed><xmp>');
>>
>> +else if ( _ns == true && _ns6 == false ) document.writeln('<embed ' +
>> 'type="application/x-java-applet;version=1.5" \
>> CODE =
>> "org/apache/maven/repository/applet/ChecksumApplet.class" \
>> ARCHIVE = "maven-repository-artifact-applet.jar" \
>> NAME = "ChecksumApplet" \
>> WIDTH = "400" \
>> - HEIGHT = "20" ' +
>> - 'scriptable=false ' +
>> -
>> 'pluginspage="http://java.sun.com/products/plugin/index.html#download"><noembed><xmp>');
>>
>> + HEIGHT = "20" ' + 'scriptable=false ' +
>> 'pluginspage="http://java.sun.com/products/plugin/index.html#download"><noembed><xmp>');
>>
>> //--></script>
>> <applet
>> CODE="org/apache/maven/repository/applet/ChecksumApplet.class"
>> ARCHIVE="maven-repository-artifact-applet.jar"
>> WIDTH="400" HEIGHT="20" NAME="ChecksumApplet"></xmp>
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp
>> Thu Mar 2 01:53:40 2006
>> @@ -24,7 +24,7 @@
>>
>> <h1>Maven Repository Manager</h1>
>>
>> -<%@include file="form.jspf"%>
>> +<%@ include file="form.jspf" %>
>>
>> <table border="1px" cellspacing="0">
>> <tr>
>> @@ -50,8 +50,8 @@
>> <tr>
>> <td valign="top" width="15%" align="right"><ww:property
>> value="Key"/></td>
>> <td valign="top">
>> - <ww:iterator value="Value" id="test" status="" >
>> - <ww:property />
>> + <ww:iterator value="Value" id="test" status="">
>> + <ww:property/>
>> </ww:iterator>
>> <br/>
>> </td>
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
>> Thu Mar 2 01:53:40 2006
>> @@ -24,7 +24,7 @@
>>
>> <h1>Maven Repository Manager</h1>
>>
>> -<%@include file="form.jspf"%>
>> +<%@ include file="form.jspf" %>
>>
>> <table>
>> <tr>
>>
>> Modified:
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
>>
>> URL:
>> http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml?rev=382337&r1=382336&r2=382337&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
>> (original)
>> +++
>> maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
>> Thu Mar 2 01:53:40 2006
>> @@ -40,7 +40,7 @@
>> <role>com.opensymphony.xwork.ObjectFactory</role>
>>
>> <implementation>org.codehaus.plexus.xwork.PlexusObjectFactory</implementation>
>>
>> </component>
>> - +
>> <component>
>>
>> <role>org.apache.maven.repository.manager.web.job.Configuration</role>
>>
>> <implementation>org.apache.maven.repository.manager.web.job.Configuration</implementation>
>>
>> @@ -52,7 +52,7 @@
>> </property>
>> <property>
>> <name>default.repository.dir</name>
>> - <value>C:/TEST_REPOS/repository</value>
>> + <value>C:/TEST_REPOS/.m2/repository/</value>
>> </property>
>> <property>
>> <name>legacy.repository.dir</name>
>> @@ -81,14 +81,6 @@
>> </properties>
>> </configuration>
>> </component>
>> -
>> -
>> - <!--
>> - <component>
>> -
>> <role>org.apache.maven.repository.manager.web.job.DiscovererJob</role>
>> - </component>
>> -
>> - -->
>>
>> <!--
>> | Logger manager
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org