mirror of
https://github.com/apache/archiva.git
synced 2025-02-07 10:39:02 +00:00
remove old actions
git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@423739 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c4f50c7f10
commit
a266f21ec1
@ -1,92 +0,0 @@
|
||||
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.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.repository.configuration.Configuration;
|
||||
import org.apache.maven.repository.configuration.ConfiguredRepositoryFactory;
|
||||
import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
|
||||
import org.apache.maven.repository.indexing.RepositoryIndexException;
|
||||
import org.apache.maven.repository.indexing.RepositoryIndexSearchException;
|
||||
import org.apache.maven.repository.indexing.RepositoryIndexSearchLayer;
|
||||
import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Searches for searchString in all indexed fields.
|
||||
*
|
||||
* @plexus.component role="com.opensymphony.xwork.Action" role-hint="org.apache.maven.repository.manager.web.action.GeneralSearchAction"
|
||||
*/
|
||||
public class GeneralSearchAction
|
||||
implements Action
|
||||
{
|
||||
private String searchString;
|
||||
|
||||
private List searchResult;
|
||||
|
||||
/**
|
||||
* @plexus.requirement
|
||||
*/
|
||||
private RepositoryIndexingFactory factory;
|
||||
|
||||
/**
|
||||
* @plexus.requirement
|
||||
*/
|
||||
private RepositoryIndexSearchLayer searchLayer;
|
||||
|
||||
/**
|
||||
* @plexus.requirement
|
||||
*/
|
||||
private ConfiguredRepositoryFactory repositoryFactory;
|
||||
|
||||
public String execute()
|
||||
throws MalformedURLException, RepositoryIndexException, RepositoryIndexSearchException
|
||||
{
|
||||
if ( searchString != null && searchString.length() != 0 )
|
||||
{
|
||||
Configuration configuration = new Configuration(); // TODO!
|
||||
File indexPath = new File( configuration.getIndexPath() );
|
||||
|
||||
ArtifactRepository repository = repositoryFactory.createRepository( configuration );
|
||||
|
||||
ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath, repository );
|
||||
|
||||
searchResult = searchLayer.searchGeneral( searchString, index );
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
public void setSearchString( String searchString )
|
||||
{
|
||||
this.searchString = searchString;
|
||||
}
|
||||
|
||||
public List getSearchResult()
|
||||
{
|
||||
return searchResult;
|
||||
}
|
||||
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
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.webwork.interceptor.ParameterAware;
|
||||
import com.opensymphony.xwork.Action;
|
||||
import org.apache.maven.repository.manager.web.utils.ConfigurationManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
|
||||
* @plexus.component role="com.opensymphony.xwork.Action" role-hint="org.apache.maven.repository.manager.web.action.IndexConfigurationAction"
|
||||
*/
|
||||
public class IndexConfigurationAction
|
||||
implements Action, ParameterAware
|
||||
{
|
||||
private Map parameters;
|
||||
|
||||
/**
|
||||
* @plexus.requirement
|
||||
*/
|
||||
private ConfigurationManager configManager;
|
||||
|
||||
public Map getParameters()
|
||||
{
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public void setParameters( Map parameters )
|
||||
{
|
||||
this.parameters = parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method that is executed when the action is invoked.
|
||||
*
|
||||
* @return a String that specifies where to go to next
|
||||
* @throws IOException
|
||||
*/
|
||||
public String execute()
|
||||
throws IOException
|
||||
{
|
||||
String[] indexPath = (String[]) parameters.get( ConfigurationManager.INDEXPATH );
|
||||
Map map = new HashMap();
|
||||
|
||||
if ( indexPath != null && indexPath.length == 1 && indexPath[0] != null )
|
||||
{
|
||||
String[] discoverSnapshots = (String[]) parameters.get( ConfigurationManager.DISCOVER_SNAPSHOTS );
|
||||
String[] minimalIndexPath = (String[]) parameters.get( ConfigurationManager.MIN_INDEXPATH );
|
||||
if ( minimalIndexPath != null && minimalIndexPath.length == 1 && minimalIndexPath[0] != null )
|
||||
{
|
||||
map.put( ConfigurationManager.MIN_INDEXPATH, minimalIndexPath[0] );
|
||||
}
|
||||
|
||||
map.put( ConfigurationManager.INDEXPATH, indexPath[0] );
|
||||
map.put( ConfigurationManager.DISCOVER_SNAPSHOTS, discoverSnapshots[0] );
|
||||
|
||||
String[] blacklistPatterns = (String[]) parameters.get( ConfigurationManager.DISCOVERY_BLACKLIST_PATTERNS );
|
||||
if ( blacklistPatterns != null && blacklistPatterns.length == 1 && blacklistPatterns[0] != null )
|
||||
{
|
||||
map.put( ConfigurationManager.DISCOVERY_BLACKLIST_PATTERNS, blacklistPatterns[0] );
|
||||
}
|
||||
|
||||
configManager.updateConfiguration( map );
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
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.webwork.interceptor.ParameterAware;
|
||||
import com.opensymphony.xwork.Action;
|
||||
import org.apache.maven.repository.manager.web.utils.ConfigurationManager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:aramirez@apache.org">Allan Ramirez</a>
|
||||
* @plexus.component role="com.opensymphony.xwork.Action" role-hint="org.apache.maven.repository.manager.web.action.SchedulerConfigurationAction"
|
||||
*/
|
||||
public class SchedulerConfigurationAction
|
||||
implements Action, ParameterAware
|
||||
{
|
||||
/**
|
||||
* @plexus.requirement
|
||||
*/
|
||||
private ConfigurationManager plexusConfig;
|
||||
|
||||
private Map parameters;
|
||||
|
||||
public Map getParameters()
|
||||
{
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public void setParameters( Map parameters )
|
||||
{
|
||||
this.parameters = parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute this method if the action was invoked
|
||||
*
|
||||
* @return String success or error
|
||||
*/
|
||||
public String execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
Map map = new HashMap();
|
||||
|
||||
String[] cronExpression = (String[]) parameters.get( ConfigurationManager.DISCOVERY_CRON_EXPRESSION );
|
||||
|
||||
if ( cronExpression[0] != null )
|
||||
{
|
||||
map.put( ConfigurationManager.DISCOVERY_CRON_EXPRESSION, cronExpression[0] );
|
||||
|
||||
plexusConfig.updateConfiguration( map );
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
// TODO: fix error handling!
|
||||
e.printStackTrace();
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
}
|
@ -62,30 +62,14 @@
|
||||
<result name="proxyError" type="dispatcher">proxyError</result>
|
||||
</action>
|
||||
|
||||
<action name="searchg" class="org.apache.maven.repository.manager.web.action.GeneralSearchAction">
|
||||
<result name="success" type="dispatcher">/WEB-INF/jsp/generalresults.jsp</result>
|
||||
<result name="error" type="dispatcher">/WEB-INF/jsp/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="search" class="org.apache.maven.repository.manager.web.action.PackageSearchAction">
|
||||
<result name="success" type="dispatcher">/WEB-INF/jsp/results.jsp</result>
|
||||
<result name="error" type="dispatcher">/WEB-INF/jsp/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="browse" class="org.apache.maven.repository.manager.web.action.RepositoryBrowseAction">
|
||||
<result name="success" type="dispatcher">/WEB-INF/jsp/browse.jsp</result>
|
||||
<result name="error" type="dispatcher">/WEB-INF/jsp/browse.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="configureIndex" class="org.apache.maven.repository.manager.web.action.IndexConfigurationAction">
|
||||
<result name="success" type="dispatcher">/WEB-INF/jsp/indexConfigUpdateSuccess.jsp</result>
|
||||
<result name="error" type="dispatcher">/WEB-INF/jsp/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="configureScheduler" class="org.apache.maven.repository.manager.web.action.SchedulerConfigurationAction">
|
||||
<result name="success" type="dispatcher">/WEB-INF/jsp/indexConfigUpdateSuccess.jsp</result>
|
||||
<result name="error" type="dispatcher">/WEB-INF/jsp/index.jsp</result>
|
||||
</action>
|
||||
-->
|
||||
</package>
|
||||
|
||||
|
@ -1,67 +0,0 @@
|
||||
<%--
|
||||
~ 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 uri="webwork" prefix="ww" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Maven Repository Manager</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Maven Repository Manager</h1>
|
||||
|
||||
<%@ include file="form.jspf" %>
|
||||
|
||||
<table border="1px" cellspacing="0">
|
||||
<tr>
|
||||
<th>Group ID</th>
|
||||
<th>Artifact ID</th>
|
||||
<th>Version</th>
|
||||
<th>Hits</th>
|
||||
</tr>
|
||||
<ww:iterator value="searchResult">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<ww:property value="Artifact.getGroupId()"/>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<ww:property value="Artifact.getArtifactId()"/>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<ww:property value="Artifact.getVersion()"/>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<table border="1px" width="100%" cellspacing="0">
|
||||
<ww:iterator value="FieldMatchesEntrySet">
|
||||
<tr>
|
||||
<td valign="top" width="15%" align="right"><ww:property value="Key"/></td>
|
||||
<td valign="top">
|
||||
<ww:iterator value="Value">
|
||||
<ww:property/>
|
||||
</ww:iterator>
|
||||
<br/>
|
||||
</td>
|
||||
</tr>
|
||||
</ww:iterator>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</ww:iterator>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,37 +0,0 @@
|
||||
<%--
|
||||
~ 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 uri="/webwork" prefix="ww" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Maven Repository Manager</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Maven Repository Manager</h1>
|
||||
|
||||
<%@ include file="form.jspf" %>
|
||||
<p />
|
||||
<%@ include file="indexconfig.jsp" %>
|
||||
<p />
|
||||
|
||||
<p />
|
||||
<%@ include file="schedulerconfig.jsp" %>
|
||||
<p />
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,24 +0,0 @@
|
||||
<%@ taglib uri="webwork" prefix="ww" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Maven Repository Manager</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Index Configuration</h1>
|
||||
<br>
|
||||
Index configuration was updated successfully.
|
||||
<br>
|
||||
<%--
|
||||
Index Path: <ww:property value="parameters.indexPath"/>
|
||||
<br>
|
||||
Blacklist Patterns: <ww:property value="parameters.blacklistPatterns"/>
|
||||
<br>
|
||||
Include Snapshots: <ww:property value="parameters.includeSnapshots"/>
|
||||
<br>
|
||||
Convert Snapshots: <ww:property value="parameters.convertSnapshots"/>
|
||||
--%>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,40 +0,0 @@
|
||||
<%--
|
||||
~ Copyright 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 uri="/webwork" prefix="ww" %>
|
||||
|
||||
<br>
|
||||
|
||||
<p>
|
||||
<b>INDEX CONFIGURATION:</b>
|
||||
</p>
|
||||
|
||||
<form action="configureIndex.action" method="post">
|
||||
Index Path: <input type="text" name="indexPath" value="<ww:property value="parameters.indexPath"/>" />
|
||||
<br>
|
||||
Minimal Index Path: <input type="text" name="minimalIndexPath"
|
||||
value="<ww:property value="parameters.minimalIndexPath"/>" />
|
||||
<br>
|
||||
Blacklist Patterns: <input type="text" name="discoveryBlacklistPatterns"
|
||||
value="<ww:property value="parameters.discoveryBlacklistPatterns"/>" />
|
||||
<br>
|
||||
Discover Snapshots: <input type="text" name="discoverSnapshots"
|
||||
value="<ww:property value="parameters.discoverSnapshots"/>" />
|
||||
<input type="submit" value="Update" />
|
||||
</form>
|
||||
|
||||
|
@ -48,6 +48,21 @@
|
||||
<td><c:out value="${result.artifact.artifactId}" /></td>
|
||||
<td><c:out value="${result.artifact.version}" /></td>
|
||||
<%-- TODO: hits
|
||||
<td>
|
||||
<table border="1px" width="100%" cellspacing="0">
|
||||
<c:forEach items="${result.fieldMatchesEntrySet}" var="entry">
|
||||
<tr>
|
||||
<td valign="top" width="15%" align="right"><c:out value="${entry.key}"/></td>
|
||||
<td valign="top">
|
||||
<c:forEach items="${entry.value}" var="item">
|
||||
<c:out value="${item}" />
|
||||
</c:forEach>
|
||||
<br/>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<code>org.apache.maven</code>
|
||||
|
@ -1,32 +0,0 @@
|
||||
<%--
|
||||
~ Copyright 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 uri="/webwork" prefix="ww" %>
|
||||
|
||||
<br>
|
||||
|
||||
<p>
|
||||
<b>SCHEDULER CONFIGURATION:</b>
|
||||
</p>
|
||||
|
||||
<form action="configureScheduler.action" method="post">
|
||||
Cron Expression: <input type="text" name="discoveryCronExpression"
|
||||
value="<ww:property value="parameters.discoveryCronExpression"/>" />
|
||||
<input type="submit" value="Update" />
|
||||
</form>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user