[MRM-138] add configuration of synced repositories

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@429989 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2006-08-09 08:20:02 +00:00
parent a5406f81fd
commit b5f12bb9b1
28 changed files with 781 additions and 189 deletions

View File

@ -26,18 +26,6 @@
<form onsubmit="this.action=this.method.value;" method="POST">
<table>
<tr>
<th>Identifier</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Name</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Method</th>
<td>
@ -49,30 +37,6 @@
</select>
</td>
</tr>
<tr>
<th>Type</th>
<td>
<select>
<option selected="selected">Maven 2.x Repository</option>
<option>Maven 1.x Repository</option>
</select>
</td>
</tr>
<tr>
<th>Synced to</th>
<td>
<select>
<option selected="selected">Central Repository (central)</option>
<option>Snapshot Repository (central-snapshots)</option>
</select>
</td>
</tr>
<tr>
<th>Schedule</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th></th>
<td>

View File

@ -24,15 +24,50 @@
<div id="contentArea">
<h2>Add (Edit) Repository</h2>
<h3>NAME GOES HERE</h3>
<form action="sync.html">
<table>
<tr>
<th>Identifier</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Name</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>CVS Root</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Type</th>
<td>
<select>
<option selected="selected">Maven 2.x Repository</option>
<option>Maven 1.x Repository</option>
</select>
</td>
</tr>
<tr>
<th>Synced to</th>
<td>
<select>
<option selected="selected">Central Repository (central)</option>
<option>Snapshot Repository (central-snapshots)</option>
</select>
</td>
</tr>
<tr>
<th>Schedule</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th></th>
<td>

View File

@ -24,15 +24,50 @@
<div id="contentArea">
<h2>Add (Edit) Repository</h2>
<h3>NAME GOES HERE</h3>
<form action="sync.html">
<table>
<tr>
<th>Identifier</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Name</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Directory</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Type</th>
<td>
<select>
<option selected="selected">Maven 2.x Repository</option>
<option>Maven 1.x Repository</option>
</select>
</td>
</tr>
<tr>
<th>Synced to</th>
<td>
<select>
<option selected="selected">Central Repository (central)</option>
<option>Snapshot Repository (central-snapshots)</option>
</select>
</td>
</tr>
<tr>
<th>Schedule</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th></th>
<td>

View File

@ -24,9 +24,20 @@
<div id="contentArea">
<h2>Add (Edit) Repository</h2>
<h3>NAME GOES HERE</h3>
<form action="sync.html">
<table>
<tr>
<th>Identifier</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Name</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Host</th>
<td>
@ -45,6 +56,30 @@
<input type="text"/>
</td>
</tr>
<tr>
<th>Type</th>
<td>
<select>
<option selected="selected">Maven 2.x Repository</option>
<option>Maven 1.x Repository</option>
</select>
</td>
</tr>
<tr>
<th>Synced to</th>
<td>
<select>
<option selected="selected">Central Repository (central)</option>
<option>Snapshot Repository (central-snapshots)</option>
</select>
</td>
</tr>
<tr>
<th>Schedule</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th></th>
<td>

View File

@ -24,9 +24,26 @@
<div id="contentArea">
<h2>Add (Edit) Repository</h2>
<h3>NAME GOES HERE</h3>
<form action="sync.html">
<table>
<tr>
<th>Identifier</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Name</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Host</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th>Subversion URL</th>
<td>
@ -39,6 +56,30 @@
<input type="text"/>
</td>
</tr>
<tr>
<th>Type</th>
<td>
<select>
<option selected="selected">Maven 2.x Repository</option>
<option>Maven 1.x Repository</option>
</select>
</td>
</tr>
<tr>
<th>Synced to</th>
<td>
<select>
<option selected="selected">Central Repository (central)</option>
<option>Snapshot Repository (central-snapshots)</option>
</select>
</td>
</tr>
<tr>
<th>Schedule</th>
<td>
<input type="text"/>
</td>
</tr>
<tr>
<th></th>
<td>

View File

@ -24,7 +24,7 @@
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<version>1.0-alpha-8</version>
<version>1.0-alpha-10</version>
<executions>
<execution>
<goals>

View File

@ -349,26 +349,9 @@
<class>
<superClass>AbstractRepositoryConfiguration</superClass>
<name>SyncedRepositoryConfiguration</name>
<abstract>true</abstract>
<version>1.0.0</version>
<fields>
<field>
<name>rsyncHost</name>
<version>1.0.0</version>
<type>String</type>
<required>true</required>
<description>
The host of the remote repository to synchronize.
</description>
</field>
<field>
<name>rsyncDirectory</name>
<version>1.0.0</version>
<type>String</type>
<required>true</required>
<description>
The location of the repository to synchronize on the remote host.
</description>
</field>
<!-- TODO: would be much easier to have an association here, as long as it could be specified as a reference -->
<field>
<name>managedRepository</name>
@ -386,62 +369,22 @@
<description>When to run the sync mechanism. Default is every hour on the hour.</description>
<defaultValue>0 0 * * * ?</defaultValue>
</field>
</fields>
</class>
<class>
<superClass>SyncedRepositoryConfiguration</superClass>
<name>RsyncSyncedRepositoryConfiguration</name>
<version>1.0.0</version>
<fields>
<field>
<name>rsyncHost</name>
<name>method</name>
<version>1.0.0</version>
<type>String</type>
<required>true</required>
<description>
The host of the remote repository to synchronize.
</description>
<description>The type of synchronization to use.</description>
<defaultValue>rsync</defaultValue>
</field>
<field>
<name>rsyncDirectory</name>
<name>properties</name>
<version>1.0.0</version>
<type>String</type>
<required>true</required>
<description>
The location of the repository to synchronize on the remote host.
</description>
</field>
</fields>
</class>
<class>
<superClass>SyncedRepositoryConfiguration</superClass>
<name>ScmSyncedRepositoryConfiguration</name>
<version>1.0.0</version>
<fields>
<field>
<name>scmUrl</name>
<version>1.0.0</version>
<type>String</type>
<required>true</required>
<description>
The SCM URL of the remote repository to synchronize.
</description>
</field>
</fields>
</class>
<class>
<superClass>SyncedRepositoryConfiguration</superClass>
<name>FileSyncedRepositoryConfiguration</name>
<version>1.0.0</version>
<fields>
<field>
<name>directory</name>
<version>1.0.0</version>
<type>String</type>
<required>true</required>
<description>
The location of the repository to synchronize on the filesystem.
</description>
<type>Properties</type>
<description>Configuration for the repository synchronization.</description>
<association xml.mapStyle="inline">
<type>String</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>

View File

@ -0,0 +1,18 @@
#
# 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.
#
Key_properties=java.lang.String
Element_properties=java.lang.String

View File

@ -107,6 +107,7 @@
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<contextPath>/</contextPath>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>9000</port>

View File

@ -16,7 +16,6 @@ package org.apache.maven.repository.manager.web.action.admin;
* limitations under the License.
*/
import com.opensymphony.webwork.interceptor.ParameterAware;
import com.opensymphony.xwork.ActionSupport;
import com.opensymphony.xwork.ModelDriven;
import com.opensymphony.xwork.Preparable;
@ -28,7 +27,6 @@ import org.apache.maven.repository.configuration.ConfigurationStoreException;
import org.apache.maven.repository.configuration.InvalidConfigurationException;
import java.io.IOException;
import java.util.Map;
/**
* Base action for repository configuration actions.
@ -37,7 +35,7 @@ import java.util.Map;
*/
public abstract class AbstractConfigureRepositoryAction
extends ActionSupport
implements ModelDriven, Preparable, ParameterAware
implements ModelDriven, Preparable
{
/**
* @plexus.requirement
@ -113,14 +111,6 @@ public abstract class AbstractConfigureRepositoryAction
public Object getModel()
{
if ( repository == null )
{
repository = getRepository( repoId );
}
if ( repository == null )
{
repository = createRepository();
}
return repository;
}
@ -131,8 +121,14 @@ public abstract class AbstractConfigureRepositoryAction
{
configuration = configurationStore.getConfigurationFromStore();
// initialises the repository if it is empty
getModel();
if ( repository == null )
{
repository = getRepository( repoId );
}
if ( repository == null )
{
repository = createRepository();
}
}
public String getRepoId()
@ -145,15 +141,6 @@ public abstract class AbstractConfigureRepositoryAction
this.repoId = repoId;
}
public void setParameters( Map map )
{
if ( map.containsKey( "repoId" ) )
{
String[] param = (String[]) map.get( "repoId" );
repoId = param[0];
}
}
protected AbstractRepositoryConfiguration getRepository()
{
return repository;

View File

@ -0,0 +1,54 @@
package org.apache.maven.repository.manager.web.action.admin;
/*
* 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.repository.configuration.AbstractRepositoryConfiguration;
import org.apache.maven.repository.configuration.SyncedRepositoryConfiguration;
import java.io.IOException;
/**
* Configures the application repositories.
*
* @plexus.component role="com.opensymphony.xwork.Action" role-hint="configureSyncedRepositoryAction"
*/
public class ConfigureSyncedRepositoryAction
extends AbstractConfigureRepositoryAction
{
protected void removeRepository( AbstractRepositoryConfiguration existingRepository )
{
configuration.removeSyncedRepository( (SyncedRepositoryConfiguration) existingRepository );
}
protected AbstractRepositoryConfiguration getRepository( String id )
{
return configuration.getSyncedRepositoryById( id );
}
protected void addRepository()
throws IOException
{
SyncedRepositoryConfiguration repository = (SyncedRepositoryConfiguration) getRepository();
configuration.addSyncedRepository( repository );
}
protected AbstractRepositoryConfiguration createRepository()
{
return new SyncedRepositoryConfiguration();
}
}

View File

@ -0,0 +1,48 @@
package org.apache.maven.repository.manager.web.action.admin;
/*
* 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.repository.configuration.AbstractRepositoryConfiguration;
import org.apache.maven.repository.configuration.SyncedRepositoryConfiguration;
import org.apache.maven.repository.configuration.Configuration;
import java.io.IOException;
/**
* Configures the application repositories.
*
* @plexus.component role="com.opensymphony.xwork.Action" role-hint="deleteSyncedRepositoryAction"
*/
public class DeleteSyncedRepositoryAction
extends AbstractDeleteRepositoryAction
{
protected AbstractRepositoryConfiguration getRepository( Configuration configuration )
{
return configuration.getSyncedRepositoryById( repoId );
}
protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository )
{
configuration.removeSyncedRepository( (SyncedRepositoryConfiguration) existingRepository );
}
protected void removeContents( AbstractRepositoryConfiguration existingRepository )
throws IOException
{
// TODO!
}
}

View File

@ -34,6 +34,7 @@
<message>You must enter the repository URL.</message>
</field-validator>
</field>
<!-- TODO: validate managed repository -->
<!-- TODO: validate layout -->
<!-- TODO: validate policies -->
<!-- TODO: validate that intervals are integers -->

View File

@ -0,0 +1,34 @@
<!--
~ 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.
-->
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="id">
<field-validator type="requiredstring">
<message>You must enter the repository identifier.</message>
</field-validator>
</field>
<field name="name">
<field-validator type="requiredstring">
<message>You must enter the repository name.</message>
</field-validator>
</field>
<!-- TODO: validate managed repository -->
<!-- TODO: validate layout -->
<!-- TODO: validate sync settings, depending on what method -->
</validators>

View File

@ -0,0 +1,27 @@
<!--
~ 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.
-->
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<!-- TODO: constrain more -->
<field name="method">
<field-validator type="requiredstring">
<message>You must enter the synchronization method.</message>
</field-validator>
</field>
</validators>

View File

@ -30,6 +30,10 @@
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="configuration"/>
</interceptor-stack>
<interceptor-stack name="configuredPrepareParamsStack">
<interceptor-ref name="paramsPrepareParamsStack"/>
<interceptor-ref name="configuration"/>
</interceptor-stack>
</interceptors>
<!-- Default interceptor stack. -->
@ -135,6 +139,7 @@
<action name="editRepository" class="configureRepositoryAction" method="edit">
<result name="input">/WEB-INF/jsp/admin/editRepository.jsp</result>
<result type="redirect-action">index</result>
<interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="deleteRepository" class="deleteRepositoryAction">
@ -154,6 +159,7 @@
<action name="editProxiedRepository" class="configureProxiedRepositoryAction" method="edit">
<result name="input">/WEB-INF/jsp/admin/editProxiedRepository.jsp</result>
<result type="redirect-action">proxiedRepositories</result>
<interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="deleteProxiedRepository" class="deleteProxiedRepositoryAction">
@ -161,6 +167,34 @@
<result type="redirect-action">proxiedRepositories</result>
</action>
<action name="syncedRepositories" class="configureAction" method="input">
<result name="input">/WEB-INF/jsp/admin/syncedRepositories.jsp</result>
</action>
<action name="addSyncedRepository" class="configureSyncedRepositoryAction">
<result name="input">/WEB-INF/jsp/admin/selectSyncedRepository.jsp</result>
<result type="chain">
<param name="actionName">addSelectedSyncedRepository</param>
<param name="method">input</param>
</result>
</action>
<action name="addSelectedSyncedRepository" class="configureSyncedRepositoryAction" method="add">
<result name="input">/WEB-INF/jsp/admin/addSyncedRepository.jsp</result>
<result type="redirect-action">syncedRepositories</result>
</action>
<action name="editSyncedRepository" class="configureSyncedRepositoryAction" method="edit">
<result name="input">/WEB-INF/jsp/admin/editSyncedRepository.jsp</result>
<result type="redirect-action">syncedRepositories</result>
<interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="deleteSyncedRepository" class="deleteSyncedRepositoryAction">
<result name="input">/WEB-INF/jsp/admin/deleteSyncedRepository.jsp</result>
<result type="redirect-action">syncedRepositories</result>
</action>
<action name="configure" class="configureAction" method="input">
<result name="input">/WEB-INF/jsp/admin/configure.jsp</result>
<interceptor-ref name="defaultStack"/>

View File

@ -33,25 +33,7 @@
<ww:actionmessage />
<ww:form method="post" action="addProxiedRepository" namespace="/admin" validate="true">
<ww:textfield name="id" label="Identifier" size="10" />
<ww:textfield name="name" label="Name" size="50" />
<ww:textfield name="url" label="URL" size="50" />
<ww:select list="#@java.util.LinkedHashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}"
name="layout" label="Type" />
<ww:select name="snapshotsPolicy" label="Snapshots" list="#@java.util.LinkedHashMap@{
'disabled' : 'Disabled',
'daily' : 'Enabled, updated daily',
'hourly' : 'Enabled, updated hourly',
'never' : 'Enabled, never updated',
'interval' : 'Enabled, updated on given interval'}" />
<ww:textfield label="Snapshot update interval" name="snapshotsInterval" size="4" />
<ww:select name="releasesPolicy" label="Releases" list="#@java.util.LinkedHashMap@{
'disabled' : 'Disabled',
'daily' : 'Enabled, updated daily',
'hourly' : 'Enabled, updated hourly',
'never' : 'Enabled, never updated',
'interval' : 'Enabled, updated on given interval'}" />
<ww:textfield label="Release update interval" name="releasesInterval" size="4" />
<ww:select list="configuration.repositoriesMap" name="managedRepository" label="Proxied through"/>
<%@ include file="/WEB-INF/jsp/admin/include/proxiedRepositoryForm.jspf" %>
<ww:submit value="Add Repository" />
</ww:form>

View File

@ -0,0 +1,44 @@
<%--
~ 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.
--%>
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Configuration</title>
<ww:head />
</head>
<body>
<h1>Configuration</h1>
<div id="contentArea">
<h2>Add Synced Repository</h2>
<ww:actionmessage />
<ww:form method="post" action="addSelectedSyncedRepository" namespace="/admin" validate="true">
<ww:textfield name="id" label="Identifier" size="10" />
<%@ include file="/WEB-INF/jsp/admin/include/syncedRepositoryForm.jspf" %>
<ww:submit value="Add Repository" />
</ww:form>
</div>
</body>
</html>

View File

@ -0,0 +1,48 @@
<%--
~ 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.
--%>
<%@ taglib prefix="ww" uri="/webwork" %>
<html>
<head>
<title>Configuration</title>
<ww:head />
</head>
<body>
<h1>Configuration</h1>
<div id="contentArea">
<h2>Delete Synced Repository</h2>
<blockquote>
<strong><span class="statusFailed">WARNING:</span> This operation can not be undone.</strong>
</blockquote>
<ww:form method="post" action="deleteSyncedRepository" namespace="/admin" validate="true">
<ww:hidden name="repoId" />
<ww:radio list="#@java.util.LinkedHashMap@{
'delete-contents' : 'Remove the repository and delete its contents from managed repositories',
'delete-entry' : 'Remove the repository from the available list, but leave the contents in the managed repositories',
'unmodified' : 'Leave the repository unmodified'}" name="operation" theme="repository-manager" />
<ww:submit value="Go" />
</ww:form>
</div>
</body>
</html>

View File

@ -33,26 +33,7 @@
<ww:actionmessage />
<ww:form method="post" action="editProxiedRepository" namespace="/admin" validate="true">
<ww:hidden name="id" />
<!-- TODO! share with add -->
<ww:textfield name="name" label="Name" size="50" />
<ww:textfield name="url" label="URL" size="50" />
<ww:select list="#@java.util.LinkedHashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}"
name="layout" label="Type" />
<ww:select name="snapshotsPolicy" label="Snapshots" list="#@java.util.LinkedHashMap@{
'disabled' : 'Disabled',
'daily' : 'Enabled, updated daily',
'hourly' : 'Enabled, updated hourly',
'never' : 'Enabled, never updated',
'interval' : 'Enabled, updated on given interval'}" />
<ww:textfield label="Snapshot update interval" name="snapshotsInterval" size="4" />
<ww:select name="releasesPolicy" label="Releases" list="#@java.util.LinkedHashMap@{
'disabled' : 'Disabled',
'daily' : 'Enabled, updated daily',
'hourly' : 'Enabled, updated hourly',
'never' : 'Enabled, never updated',
'interval' : 'Enabled, updated on given interval'}" />
<ww:textfield label="Release update interval" name="releasesInterval" size="4" />
<ww:select list="configuration.repositoriesMap" name="managedRepository" label="Proxied through"/>
<%@ include file="/WEB-INF/jsp/admin/include/proxiedRepositoryForm.jspf" %>
<ww:submit value="Change Repository" />
</ww:form>
</div>

View File

@ -0,0 +1,44 @@
<%--
~ 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.
--%>
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Configuration</title>
<ww:head />
</head>
<body>
<h1>Configuration</h1>
<div id="contentArea">
<h2>Edit Synced Repository</h2>
<ww:actionmessage />
<ww:form method="post" action="editSyncedRepository" namespace="/admin" validate="true">
<ww:hidden name="id" />
<%@ include file="/WEB-INF/jsp/admin/include/syncedRepositoryForm.jspf" %>
<ww:submit value="Update Repository" />
</ww:form>
</div>
</body>
</html>

View File

@ -0,0 +1,35 @@
<%--
~ 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.
--%>
<ww:textfield name="name" label="Name" size="50" />
<ww:textfield name="url" label="URL" size="50" />
<ww:select list="#@java.util.LinkedHashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}"
name="layout" label="Type" />
<ww:select name="snapshotsPolicy" label="Snapshots" list="#@java.util.LinkedHashMap@{
'disabled' : 'Disabled',
'daily' : 'Enabled, updated daily',
'hourly' : 'Enabled, updated hourly',
'never' : 'Enabled, never updated',
'interval' : 'Enabled, updated on given interval'}" />
<ww:textfield label="Snapshot update interval" name="snapshotsInterval" size="4" />
<ww:select name="releasesPolicy" label="Releases" list="#@java.util.LinkedHashMap@{
'disabled' : 'Disabled',
'daily' : 'Enabled, updated daily',
'hourly' : 'Enabled, updated hourly',
'never' : 'Enabled, never updated',
'interval' : 'Enabled, updated on given interval'}" />
<ww:textfield label="Release update interval" name="releasesInterval" size="4" />
<ww:select list="configuration.repositoriesMap" name="managedRepository" label="Proxied through"/>

View File

@ -0,0 +1,27 @@
<ww:hidden name="method" />
<ww:textfield name="name" label="Name" size="50" />
<ww:select list="#@java.util.LinkedHashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}"
name="layout" label="Type" />
<ww:select list="configuration.repositoriesMap" name="managedRepository" label="Synced to" />
<ww:textfield name="cronExpression" label="Schedule" />
<ww:set name="method" value="method" />
<c:choose>
<c:when test="${method == 'cvs'}">
<ww:textfield name="properties['cvsRoot']" label="CVS Root" size="100" />
</c:when>
<c:when test="${method == 'svn'}">
<ww:textfield name="properties['svnUrl']" label="Subversion URL" size="100" />
<ww:textfield name="properties['username']" label="Subversion Username" size="30" />
</c:when>
<c:when test="${method == 'rsync'}">
<ww:textfield name="properties['rsyncHost']" label="Rsync Host" />
<ww:textfield name="properties['rsyncDirectory']" label="Rsync Directory" size="100" />
<ww:select name="properties['rsyncMethod']" label="Rsync Method"
list="#@java.util.LinkedHashMap@{'rsync' : 'Anonymous', 'ssh' : 'SSH'}" />
<ww:textfield name="properties['username']" label="Rsync Username" size="30" />
</c:when>
<c:when test="${method == 'file'}">
<ww:textfield name="properties['directory']" label="Directory" size="100" />
</c:when>
</c:choose>

View File

@ -62,7 +62,7 @@
<c:forEach items="${repositories}" var="repository" varStatus="i">
<div>
<div style="float: right">
<%-- TODO! replace with icons --%>
<%-- TODO replace with icons --%>
<a href="<ww:url action="editRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Edit
Repository</a> | <a
href="<ww:url action="deleteRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Delete
@ -73,7 +73,6 @@
<tr>
<th>Identifier</th>
<td>
<%-- TODO! must be unique among managed repos --%>
<code>${repository.id}</code>
</td>
</tr>

View File

@ -37,7 +37,7 @@
<c:forEach items="${proxiedRepositories}" var="repository" varStatus="i">
<div>
<div style="float: right">
<%-- TODO! replace with icons --%>
<%-- TODO replace with icons --%>
<a href="<ww:url action="editProxiedRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Edit
Repository</a> | <a
href="<ww:url action="deleteProxiedRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Delete
@ -48,7 +48,6 @@
<tr>
<th>Identifier</th>
<td>
<%-- TODO! must be unique among managed repos --%>
<code>${repository.id}</code>
</td>
</tr>

View File

@ -0,0 +1,46 @@
<%--
~ 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.
--%>
<%@ taglib prefix="ww" uri="/webwork" %>
<html>
<head>
<title>Configuration</title>
<ww:head />
</head>
<body>
<h1>Configuration</h1>
<div id="contentArea">
<h2>Add Synced Repository</h2>
<ww:actionmessage />
<ww:form method="post" action="addSyncedRepository" namespace="/admin" validate="true">
<ww:select list="#@java.util.LinkedHashMap@{
'rsync' : 'Rsync',
'svn' : 'Subversion',
'cvs' : 'CVS',
'file': 'Local File System'}" name="method" label="Method" />
<ww:submit value="Continue" />
</ww:form>
</div>
</body>
</html>

View File

@ -0,0 +1,145 @@
<%--
~ 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.
--%>
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Administration</title>
<ww:head />
</head>
<body>
<h1>Administration</h1>
<div id="contentArea">
<h2>Synced Repositories</h2>
<ww:set name="syncedRepositories" value="syncedRepositories" />
<c:if test="${empty(syncedRepositories)}">
<strong>There are no synced repositories configured yet.</strong>
</c:if>
<c:forEach items="${syncedRepositories}" var="repository" varStatus="i">
<div>
<div style="float: right">
<%-- TODO replace with icons --%>
<a href="<ww:url action="editSyncedRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Edit
Repository</a> | <a
href="<ww:url action="deleteSyncedRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Delete
Repository</a>
</div>
<h3>${repository.name}</h3>
<table>
<tr>
<th>Identifier</th>
<td>
<code>${repository.id}</code>
</td>
</tr>
<tr>
<th>Method</th>
<td>${repository.method}</td>
</tr>
<c:choose>
<c:when test="${repository.method == 'cvs'}">
<tr>
<th>CVS Root</th>
<td>${repository.properties['cvsRoot']}</td>
</tr>
</c:when>
<c:when test="${repository.method == 'svn'}">
<tr>
<th>Subversion URL</th>
<td>${repository.properties['svnUrl']}</td>
</tr>
<tr>
<th>Subversion Username</th>
<td>${repository.properties['username']}</td>
</tr>
</c:when>
<c:when test="${repository.method == 'rsync'}">
<tr>
<th>Rsync Host</th>
<td>${repository.properties['rsyncHost']}</td>
</tr>
<tr>
<th>Rsync Directory</th>
<td>${repository.properties['rsyncDirectory']}</td>
</tr>
<tr>
<th>Rsync Method</th>
<td>
<c:choose>
<c:when test="${repository.properties['rsyncMethod'] == 'rsync'}">
Anonymous
</c:when>
<c:when test="${repository.properties['rsyncMethod'] == 'ssh'}">
SSH
</c:when>
</c:choose>
</td>
</tr>
<tr>
<th>Username</th>
<td>${repository.properties['username']}</td>
</tr>
</c:when>
<c:when test="${repository.method == 'file'}">
<tr>
<th>Directory</th>
<td>${repository.properties['directory']}</td>
</tr>
</c:when>
</c:choose>
<tr>
<th>Type</th>
<!-- TODO: can probably just use layout appended to a key prefix in i18n to simplify this -->
<td>
<c:choose>
<c:when test="${repository.layout == 'default'}">
Maven 2.x Repository
</c:when>
<c:otherwise>
Maven 1.x Repository
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<th>Synced to</th>
<td>
<!-- TODO: this is the hard way! would be nice if there was a ref in the model so it was directly linked -->
${repositoriesMap[repository.managedRepository].name}
(<code>${repositoriesMap[repository.managedRepository].id}</code>)
</td>
</tr>
<tr>
<th>Schedule</th>
<td>${repository.cronExpression}</td>
</tr>
</table>
</div>
</c:forEach>
<p>
<a href="<ww:url action="addSyncedRepository" method="input" />">Add Repository</a>
</p>
</div>
</body>
</html>

View File

@ -20,13 +20,6 @@
<display-name>Maven Repository Manager</display-name>
<!-- TODO: remove if we use the new xwork integration
<filter>
<filter-name>plexus</filter-name>
<filter-class>org.codehaus.plexus.xwork.PlexusFilter</filter-class>
</filter>
-->
<filter>
<filter-name>webwork-cleanup</filter-name>
<filter-class>com.opensymphony.webwork.dispatcher.ActionContextCleanUp</filter-class>
@ -42,14 +35,6 @@
<filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcher</filter-class>
</filter>
<!-- this must be before the webwork filter -->
<!-- TODO: remove if we use the new xwork integration
<filter-mapping>
<filter-name>plexus</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-->
<!-- this must be before the sitemesh filter -->
<filter-mapping>
<filter-name>webwork-cleanup</filter-name>