You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2008/01/19 22:46:40 UTC
svn commit: r613462 - in /geronimo/server/trunk:
framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/
framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/
framework/modules...
Author: djencks
Date: Sat Jan 19 13:46:39 2008
New Revision: 613462
URL: http://svn.apache.org/viewvc?rev=613462&view=rev
Log:
GERONIMO-3607 Console pages to export a server.
Added:
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AbstractListHandler.java (with props)
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyListHandler.java
- copied, changed from r613263, geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java
- copied, changed from r613304, geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblylist.jsp
- copied, changed from r613304, geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/list.jsp
Modified:
geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java
geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstaller.java
geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java
geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerInstanceData.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/BaseImportExportHandler.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/index.jsp
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java Sat Jan 19 13:46:39 2008
@@ -23,7 +23,6 @@
import java.net.NetworkInterface;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Enumeration;
import java.util.List;
@@ -56,7 +55,6 @@
import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.kernel.repository.Dependency;
import org.apache.geronimo.kernel.repository.MissingDependencyException;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
import org.apache.geronimo.system.jmx.KernelDelegate;
import org.apache.geronimo.system.plugin.DownloadPoller;
import org.apache.geronimo.system.plugin.DownloadResults;
@@ -341,10 +339,10 @@
return null;
}
- public void installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList, DownloadResults downloadPoller) throws Exception {
+ public DownloadResults installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList) throws Exception {
PluginInstaller installer = getPluginInstaller();
try {
- installer.installPluginList(targetRepositoryPath, relativeTargetServerPath, pluginList, downloadPoller);
+ return installer.installPluginList(targetRepositoryPath, relativeTargetServerPath, pluginList);
} finally {
kernel.getProxyManager().destroyProxy(installer);
}
Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java Sat Jan 19 13:46:39 2008
@@ -30,11 +30,9 @@
import javax.security.auth.login.FailedLoginException;
import jline.ConsoleReader;
-import org.apache.geronimo.cli.deployer.BaseCommandArgs;
import org.apache.geronimo.cli.deployer.CommandArgs;
import org.apache.geronimo.common.DeploymentException;
import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
-import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.kernel.config.NoSuchStoreException;
import org.apache.geronimo.system.plugin.DownloadResults;
import org.apache.geronimo.system.plugin.PluginInstallerGBean;
@@ -227,9 +225,8 @@
}
public void assembleServer(GeronimoDeploymentManager mgr, PluginListType list, String repositoryPath, String relativeServerPath, ConsoleReader consoleReader) throws Exception {
- DownloadResults results = new DownloadResults();
long start = System.currentTimeMillis();
- mgr.installPluginList(repositoryPath, relativeServerPath, list, results);
+ DownloadResults results = mgr.installPluginList(repositoryPath, relativeServerPath, list);
int time = (int) (System.currentTimeMillis() - start) / 1000;
CommandInstallCAR.printResults(consoleReader, results, time);
}
Modified: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstaller.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstaller.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstaller.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstaller.java Sat Jan 19 13:46:39 2008
@@ -32,7 +32,7 @@
/**
* Knows how to import and export configurations
*
- * @version $Rev$ $Date$
+ * @version $Rev: 601152 $ $Date: 2007-12-04 15:49:03 -0800 (Tue, 04 Dec 2007) $
*/
public interface PluginInstaller {
/**
@@ -188,5 +188,5 @@
public Artifact installLibrary(File libFile, String groupId) throws IOException;
- void installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList, DownloadResults downloadPoller) throws Exception;
+ DownloadResults installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList) throws Exception;
}
Modified: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java Sat Jan 19 13:46:39 2008
@@ -129,15 +129,15 @@
/**
* GBean constructor. Supply an existing ConfigurationManager. Use for adding to the current server.
*
- * @param configManager Configuration Manager for this server
- * @param repository repository to install into
- * @param configStore configuration store to install into
- * @param serverInstanceDatas set of server "layouts" to install config info into
- * @param serverInfo location of server
- * @param threadPool thread pool for async operations
- * @param artifactManager artifact manager to resolve existing artifacts
+ * @param configManager Configuration Manager for this server
+ * @param repository repository to install into
+ * @param configStore configuration store to install into
+ * @param serverInstanceDatas set of server "layouts" to install config info into
+ * @param serverInfo location of server
+ * @param threadPool thread pool for async operations
+ * @param artifactManager artifact manager to resolve existing artifacts
* @param persistentConfigurationLists used to start new plugins in a running server
- * @param classLoader classLoader @throws IOException exception if server instance cannot be loaded
+ * @param classLoader classLoader @throws IOException exception if server instance cannot be loaded
* @throws java.io.IOException from bad ServerInstance
*/
public PluginInstallerGBean(ConfigurationManager configManager,
@@ -155,44 +155,24 @@
this.threadPool = threadPool;
asyncKeys = Collections.synchronizedMap(new HashMap<Object, DownloadResults>());
this.serverInstanceDatas = serverInstanceDatas;
- this.persistentConfigurationLists = persistentConfigurationLists == null? Collections.<PersistentConfigurationList>emptyList(): persistentConfigurationLists;
+ this.persistentConfigurationLists = persistentConfigurationLists == null ? Collections.<PersistentConfigurationList>emptyList() : persistentConfigurationLists;
this.classLoader = classLoader;
- for (ServerInstanceData instance : serverInstanceDatas) {
- addServerInstance(instance, artifactManager, writeableRepo, serverInfo, servers, true);
- }
if (configManager == null) {
throw new IllegalArgumentException("No default server instance set up");
}
this.configManager = configManager;
localSourceRepository = new GeronimoSourceRepository(configManager.getRepositories(), configManager.getArtifactResolver());
- if (serverInstanceDatas instanceof ReferenceCollection) {
- ((ReferenceCollection) serverInstanceDatas).addReferenceCollectionListener(new ReferenceCollectionListener() {
-
- public void memberAdded(ReferenceCollectionEvent event) {
- ServerInstanceData instance = (ServerInstanceData) event.getMember();
- try {
- addServerInstance(instance, artifactManager, writeableRepo, serverInfo, servers, true);
- } catch (IOException e) {
- //nothing to do?? log???
- }
- }
-
- public void memberRemoved(ReferenceCollectionEvent event) {
- ServerInstanceData instance = (ServerInstanceData) event.getMember();
- PluginInstallerGBean.this.servers.remove(instance.getName());
- }
- });
- }
+ setUpServerInstances(serverInstanceDatas, serverInfo, artifactManager, servers, writeableRepo, true);
}
/**
* Constructor for use in assembling a new server.
*
- * @param serverInstanceDatas set of server layouts
- * @param kernel kernel for current server
- * @param classLoader classLoader
+ * @param serverInstanceDatas set of server layouts
+ * @param kernel kernel for current server
+ * @param classLoader classLoader
* @param targetRepositoryPath location of repo to install into (not in current server)
- * @param targetServerPath location of server to install into (not current server
+ * @param targetServerPath location of server to install into (not current server
* @throws IOException if layouts can't be loaded
*/
public PluginInstallerGBean(String targetRepositoryPath,
@@ -213,18 +193,40 @@
this.serverInstanceDatas = serverInstanceDatas;
this.persistentConfigurationLists = Collections.emptyList();
this.classLoader = classLoader;
- for (ServerInstanceData instance : serverInstanceDatas) {
- addServerInstance(instance, artifactManager, writeableRepo, serverInfo, servers, false);
- }
+ setUpServerInstances(serverInstanceDatas, serverInfo, artifactManager, servers, writeableRepo, false);
this.configManager = buildConfigurationManager(artifactManager, writeableRepo, kernel, configStore, classLoader, servers);
localSourceRepository = new GeronimoSourceRepository(configManager.getRepositories(), configManager.getArtifactResolver());
+ }
+
+ private static void setUpServerInstances(Collection<? extends ServerInstanceData> serverInstanceDatas,
+ final ServerInfo serverInfo, final ArtifactManager artifactManager,
+ final Map<String, ServerInstance> servers,
+ final WritableListableRepository writeableRepo,
+ final boolean live) throws IOException {
+ List<ServerInstanceData> datas = new ArrayList<ServerInstanceData>(serverInstanceDatas);
+ boolean shrank = true;
+ while (shrank) {
+ shrank = false;
+ for (Iterator<ServerInstanceData> it = datas.iterator(); it.hasNext();) {
+ ServerInstanceData instance = it.next();
+ String dependsOn = instance.getAttributeManagerFrom();
+ if (dependsOn == null || servers.containsKey(dependsOn)) {
+ addServerInstance(instance, artifactManager, writeableRepo, serverInfo, servers, live);
+ it.remove();
+ shrank = true;
+ }
+ }
+ }
+ if (!datas.isEmpty()) {
+ throw new IllegalStateException("Cannot resolve ServerInstanceDatas: " + datas);
+ }
if (serverInstanceDatas instanceof ReferenceCollection) {
((ReferenceCollection) serverInstanceDatas).addReferenceCollectionListener(new ReferenceCollectionListener() {
public void memberAdded(ReferenceCollectionEvent event) {
ServerInstanceData instance = (ServerInstanceData) event.getMember();
try {
- addServerInstance(instance, artifactManager, writeableRepo, serverInfo, servers, false);
+ addServerInstance(instance, artifactManager, writeableRepo, serverInfo, servers, live);
} catch (IOException e) {
//nothing to do?? log???
}
@@ -232,7 +234,7 @@
public void memberRemoved(ReferenceCollectionEvent event) {
ServerInstanceData instance = (ServerInstanceData) event.getMember();
- PluginInstallerGBean.this.servers.remove(instance.getName());
+ servers.remove(instance.getName());
}
});
}
@@ -311,11 +313,11 @@
*
* @param targetRepositoryPath location of repository in new server (normally "repository")
* @param relativeTargetServerPath Location of server to assemble relative to current server
- * @param pluginList list of plugins to install
- * @param downloadPoller monitor for results
+ * @param pluginList list of plugins to install
* @throws Exception if something goes wrong
*/
- public void installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList, DownloadResults downloadPoller) throws Exception {
+ public DownloadResults installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList) throws Exception {
+ DownloadResults downloadPoller = new DownloadResults();
String targetServerPath = serverInfo.resolveServer(relativeTargetServerPath).getAbsolutePath();
Kernel kernel = new BasicKernel("assembly");
@@ -332,6 +334,7 @@
} finally {
kernel.shutdown();
}
+ return downloadPoller;
}
@@ -552,7 +555,7 @@
if (restrictToDefaultRepository && defaultRepository == null) {
throw new IllegalArgumentException("You must supply a default repository if you want to restrict to it");
}
- SourceRepository defaultSourceRepository = defaultRepository == null ? null: SourceRepositoryFactory.getSourceRepository(defaultRepository);
+ SourceRepository defaultSourceRepository = defaultRepository == null ? null : SourceRepositoryFactory.getSourceRepository(defaultRepository);
install(pluginsToInstall, defaultSourceRepository, restrictToDefaultRepository, username, password, poller);
}
@@ -621,9 +624,9 @@
// Step 3: Start anything that's marked accordingly
if (configManager.isOnline()) {
poller.setCurrentFilePercent(-1);
- for (PersistentConfigurationList persistentConfigurationList: persistentConfigurationLists) {
+ for (PersistentConfigurationList persistentConfigurationList : persistentConfigurationLists) {
List<Artifact> artifacts = persistentConfigurationList.restore();
- for (Artifact artifact: artifacts) {
+ for (Artifact artifact : artifacts) {
if (!configManager.isRunning(artifact)) {
poller.setCurrentMessage("Starting " + artifact);
if (!configManager.isLoaded(artifact)) {
@@ -658,7 +661,7 @@
} else {
repoLocations = pluginsToInstall.getDefaultRepository();
}
- for (String repoLocation: repoLocations) {
+ for (String repoLocation : repoLocations) {
SourceRepository repo = SourceRepositoryFactory.getSourceRepository(repoLocation);
repos.add(repo);
}
@@ -878,28 +881,28 @@
throw new RuntimeException("Invalid setup, no default server instance registered");
}
}
- return missingPrereqs;
+ return missingPrereqs;
}
-
+
private void verifyPrerequisites(PluginType plugin) throws MissingDependencyException {
- List<Dependency> missingPrereqs = getMissingPrerequisites(plugin);
+ List<Dependency> missingPrereqs = getMissingPrerequisites(plugin);
if (!missingPrereqs.isEmpty()) {
PluginArtifactType metadata = plugin.getPluginArtifact().get(0);
Artifact moduleId = toArtifact(metadata.getModuleId());
StringBuffer buf = new StringBuffer();
buf.append(moduleId.toString()).append(" requires ");
Iterator<Dependency> iter = missingPrereqs.iterator();
- while(iter.hasNext()) {
+ while (iter.hasNext()) {
buf.append(iter.next().getArtifact().toString());
if (iter.hasNext()) {
buf.append(", ");
- }
+ }
}
- buf.append(" to be installed");
- throw new MissingDependencyException(buf.toString(), null, (Artifact)null);
+ buf.append(" to be installed");
+ throw new MissingDependencyException(buf.toString(), null, (Artifact) null);
}
}
-
+
public Artifact installLibrary(File libFile, String groupId) throws IOException {
Matcher matcher = MAVEN_1_PATTERN_PART.matcher("");
matcher.reset(libFile.getName());
@@ -920,16 +923,16 @@
* be just a JAR. For each artifact processed, all its dependencies will be
* processed as well.
*
- * @param configID Identifies the artifact to install
- * @param metadata name to plugin map
- * @param repos The URLs to contact the repositories (in order of preference)
- * @param username The username used for repositories secured with HTTP Basic authentication
- * @param password The password used for repositories secured with HTTP Basic authentication
- * @param monitor The ongoing results of the download operations, with some monitoring logic
- * @param soFar The set of dependencies already downloaded.
- * @param parentStack chain of modules that led to this dependency
- * @param dependency Is this a dependency or the original artifact?
- * @param servers server layouts to install config info into
+ * @param configID Identifies the artifact to install
+ * @param metadata name to plugin map
+ * @param repos The URLs to contact the repositories (in order of preference)
+ * @param username The username used for repositories secured with HTTP Basic authentication
+ * @param password The password used for repositories secured with HTTP Basic authentication
+ * @param monitor The ongoing results of the download operations, with some monitoring logic
+ * @param soFar The set of dependencies already downloaded.
+ * @param parentStack chain of modules that led to this dependency
+ * @param dependency Is this a dependency or the original artifact?
+ * @param servers server layouts to install config info into
* @param loadOverride If false prevents setting load="true" in server instances (recursively through dependencies)
* @throws FailedLoginException When a repository requires authentication and either no username
* and password are supplied or the username and password supplied
@@ -953,7 +956,7 @@
monitor.getResults().setCurrentMessage("Downloading " + configID);
monitor.getResults().setCurrentFilePercent(-1);
OpenResult result = null;
- for (SourceRepository repository: repos) {
+ for (SourceRepository repository : repos) {
result = repository.open(configID, monitor);
if (result != null) {
break;
@@ -1076,7 +1079,7 @@
} else {
//rely on plugin metadata if present.
List<DependencyType> deps = instance.getDependency();
- for (DependencyType dep: deps) {
+ for (DependencyType dep : deps) {
Artifact artifact = toArtifact(dep);
log.debug("Attempting to download dependency=" + artifact + " for configuration=" + configID);
downloadArtifact(artifact, metadata, repos, username, password, monitor, soFar, parentStack, true, servers, loadOverride & dep.isStart());
@@ -1228,7 +1231,8 @@
/**
* Used to get dependencies for a JAR
- * @param repo repository containing jar
+ *
+ * @param repo repository containing jar
* @param artifact artifact to find dependencies of
* @return dependencies of artifact in repository
*/
@@ -1535,12 +1539,14 @@
/**
* If a plugin includes config.xml content, copy it into the attribute
* store.
- * @param configID artifact we are installing
- * @param pluginData metadata for plugin
- * @param servers server metadata that might be modified
+ *
+ * @param configID artifact we are installing
+ * @param pluginData metadata for plugin
+ * @param servers server metadata that might be modified
* @param loadOverride overrides the load setting from plugin metadata in a config.xml module.
- * @throws java.io.IOException if IO problem occurs
- * @throws org.apache.geronimo.kernel.InvalidGBeanException if an invalid gbean configuration is encountered
+ * @throws java.io.IOException if IO problem occurs
+ * @throws org.apache.geronimo.kernel.InvalidGBeanException
+ * if an invalid gbean configuration is encountered
* @throws NoServerInstanceException if the plugin expects a server metadata that is not present
*/
private void installConfigXMLData(Artifact configID, PluginArtifactType pluginData, Map<String, ServerInstance> servers, boolean loadOverride) throws InvalidGBeanException, IOException, NoServerInstanceException {
@@ -1601,6 +1607,7 @@
/**
* Gets a token unique to this run of the server, used to track asynchronous
* downloads.
+ *
* @return unique (for this server) key
*/
private static Object getNextKey() {
Modified: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java Sat Jan 19 13:46:39 2008
@@ -78,6 +78,19 @@
return super.getServerInstance(artifactManager, targetRepo, serverInfo, serverInstances, live);
}
}
+
+ @Override
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("ReferenceServerInstanceData:\n");
+ buf.append(" Name: ").append(getName()).append("\n");
+ buf.append(" ConfigFile: ").append(getConfigFile()).append("\n");
+ buf.append(" ConfigSubstitutionsFile: ").append(getConfigSubstitutionsFile()).append("\n");
+ buf.append(" ConfigSubstitutionsPrefix: ").append(getConfigSubstitutionsPrefix()).append("\n");
+ buf.append(" ArtifactAliasesFile: ").append(getArtifactAliasesFile()).append("\n");
+ return buf.toString();
+ }
+
public static final GBeanInfo GBEAN_INFO;
static {
Modified: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerInstanceData.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerInstanceData.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerInstanceData.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerInstanceData.java Sat Jan 19 13:46:39 2008
@@ -119,6 +119,18 @@
return new ServerInstance(name, attributeStore, geronimoArtifactResolver);
}
+ @Override
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("ServerInstanceData:\n");
+ buf.append(" Name: ").append(getName()).append("\n");
+ buf.append(" AttributeManagerFrom: ").append(getAttributeManagerFrom()).append("\n");
+ buf.append(" ConfigFile: ").append(getConfigFile()).append("\n");
+ buf.append(" ConfigSubstitutionsFile: ").append(getConfigSubstitutionsFile()).append("\n");
+ buf.append(" ConfigSubstitutionsPrefix: ").append(getConfigSubstitutionsPrefix()).append("\n");
+ buf.append(" ArtifactAliasesFile: ").append(getArtifactAliasesFile()).append("\n");
+ return buf.toString();
+ }
public static final GBeanInfo GBEAN_INFO;
Added: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AbstractListHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AbstractListHandler.java?rev=613462&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AbstractListHandler.java (added)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AbstractListHandler.java Sat Jan 19 13:46:39 2008
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.console.car;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+
+import javax.portlet.RenderRequest;
+
+import org.apache.geronimo.system.plugin.PluginInstaller;
+import org.apache.geronimo.system.plugin.PluginInstallerGBean;
+import org.apache.geronimo.system.plugin.model.PluginListType;
+import org.apache.geronimo.system.plugin.model.PluginType;
+import org.apache.geronimo.system.plugin.model.PluginArtifactType;
+import org.apache.geronimo.kernel.repository.Dependency;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public abstract class AbstractListHandler extends BaseImportExportHandler {
+ public AbstractListHandler(String mode, String viewName) {
+ super(mode, viewName);
+ }
+
+ protected void listPlugins(RenderRequest request, PluginInstaller pluginInstaller, PluginListType data, boolean validate) {
+ List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
+
+ for (PluginType metadata: data.getPlugin()) {
+
+ // ignore plugins which have no artifacts defined
+ if (metadata.getPluginArtifact().isEmpty()) {
+ continue;
+ }
+
+ if (metadata.getCategory() == null) {
+ metadata.setCategory("Unspecified");
+ }
+
+ for (PluginArtifactType artifact : metadata.getPluginArtifact()) {
+ PluginInfoBean plugin = new PluginInfoBean();
+ plugin.setPlugin(metadata);
+ plugin.setPluginArtifact(artifact);
+
+ if (validate) {
+ // determine if the plugin is installable
+ PluginType holder = PluginInstallerGBean.copy(metadata, artifact);
+ try {
+ pluginInstaller.validatePlugin(holder);
+ } catch (Exception e) {
+ plugin.setInstallable(false);
+ }
+ Dependency[] missingPrereqs = pluginInstaller.checkPrerequisites(holder);
+ if (missingPrereqs.length > 0) {
+ plugin.setInstallable(false);
+ }
+ }
+ plugins.add(plugin);
+ }
+ }
+
+ // sort the plugin list based on the selected table column
+ final String column = request.getParameter("column");
+ Collections.sort(plugins, new Comparator<PluginInfoBean>() {
+ public int compare(PluginInfoBean o1, PluginInfoBean o2) {
+ if ("Category".equals(column)) {
+ String category1 = o1.getCategory();
+ String category2 = o2.getCategory();
+ if (category1.equals(category2)) {
+ return o1.getName().compareTo(o2.getName());
+ }
+ return category1.compareTo(category2);
+ }
+ else if ("Version".equals(column)) {
+ String version1 = o1.getPluginArtifact().getModuleId().getVersion();
+ String version2 = o2.getPluginArtifact().getModuleId().getVersion();
+ if (version1.equals(version2)) {
+ return o1.getName().compareTo(o2.getName());
+ }
+ return version1.compareTo(version2);
+ }
+ else if ("Installable".equals(column)) {
+ if (o1.isInstallable() == o2.isInstallable()) {
+ return o1.getName().compareTo(o2.getName());
+ }
+ return o1.isInstallable() ? -1 : 1 ;
+ }
+ else { // default sort column is Name
+ return o1.getName().compareTo(o2.getName());
+ }
+ }
+ });
+
+ // save everything in the request
+ request.setAttribute("plugins", plugins);
+ }
+}
Propchange: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AbstractListHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AbstractListHandler.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AbstractListHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Copied: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyListHandler.java (from r613263, geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyListHandler.java?p2=geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyListHandler.java&p1=geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java&r1=613263&r2=613462&rev=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyListHandler.java Sat Jan 19 13:46:39 2008
@@ -17,66 +17,40 @@
package org.apache.geronimo.console.car;
import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
-import javax.security.auth.login.FailedLoginException;
import org.apache.geronimo.console.MultiPageModel;
-import org.apache.geronimo.console.util.PortletManager;
-import org.apache.geronimo.kernel.repository.Dependency;
import org.apache.geronimo.system.plugin.PluginInstaller;
-import org.apache.geronimo.system.plugin.PluginInstallerGBean;
-import org.apache.geronimo.system.plugin.model.PluginArtifactType;
import org.apache.geronimo.system.plugin.model.PluginListType;
-import org.apache.geronimo.system.plugin.model.PluginType;
/**
* Handler for the import export list screen.
*
* @version $Rev$ $Date$
*/
-public class ListHandler extends BaseImportExportHandler {
-
- public ListHandler() {
- super(LIST_MODE, "/WEB-INF/view/car/list.jsp");
+public class AssemblyListHandler extends AbstractListHandler {
+
+ public AssemblyListHandler() {
+ super(LIST_SERVER_MODE, "/WEB-INF/view/car/assemblylist.jsp");
}
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
- String repository = (String) request.getAttribute("repository");
- if(repository == null || repository.equals("")) {
- return INDEX_MODE+BEFORE_ACTION;
- }
- response.setRenderParameter("repository", repository);
- String user = (String) request.getAttribute("repo-user");
- String pass = (String) request.getAttribute("repo-pass");
String column = (String) request.getAttribute("column");
- if(!isEmpty(user)) response.setRenderParameter("repo-user", user);
- if(!isEmpty(pass)) response.setRenderParameter("repo-pass", pass);
if(!isEmpty(column)) response.setRenderParameter("column", column);
return getMode();
}
public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
- String repository = request.getParameter("repository");
- String user = request.getParameter("repo-user");
- String pass = request.getParameter("repo-pass");
String column = request.getParameter("column");
- if(!loadFromRepository(request, repository, user, pass)) {
+ if(!loadFromServer(request)) {
//todo: loading failed -- do something!
}
- request.setAttribute("repository", repository);
- request.setAttribute("repouser", user);
- request.setAttribute("repopass", pass);
request.setAttribute("column", column);
}
@@ -84,92 +58,20 @@
return getMode()+BEFORE_ACTION;
}
- private boolean loadFromRepository(RenderRequest request, String repository, String username, String password) throws IOException, PortletException {
-
+ private boolean loadFromServer(RenderRequest request) throws IOException, PortletException {
+
PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
// try to reuse the catalog data if it was already downloaded
- PluginListType data = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
- if (data==null) {
- try {
- data = pluginInstaller.listPlugins(new URL(repository), username, password);
- } catch (FailedLoginException e) {
- throw new PortletException("Invalid login for Maven repository '"+repository+"'", e);
- }
- }
-
+ PluginListType data = getServerPluginList(request, pluginInstaller);
+
if(data == null || data.getPlugin() == null) {
return false;
}
-
- List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
-
- for (PluginType metadata: data.getPlugin()) {
-
- // ignore plugins which have no artifacts defined
- if (metadata.getPluginArtifact().isEmpty()) {
- continue;
- }
-
- if (metadata.getCategory() == null) {
- metadata.setCategory("Unspecified");
- }
-
- for (PluginArtifactType artifact : metadata.getPluginArtifact()) {
- PluginInfoBean plugin = new PluginInfoBean();
- plugin.setPlugin(metadata);
- plugin.setPluginArtifact(artifact);
-
- // determine if the plugin is installable
- PluginType holder = PluginInstallerGBean.copy(metadata, artifact);
- try {
- pluginInstaller.validatePlugin(holder);
- } catch (Exception e) {
- plugin.setInstallable(false);
- }
- Dependency[] missingPrereqs = pluginInstaller.checkPrerequisites(holder);
- if (missingPrereqs.length > 0) {
- plugin.setInstallable(false);
- }
- plugins.add(plugin);
- }
- }
- // sort the plugin list based on the selected table column
- final String column = request.getParameter("column");
- Collections.sort(plugins, new Comparator<PluginInfoBean>() {
- public int compare(PluginInfoBean o1, PluginInfoBean o2) {
- if ("Category".equals(column)) {
- String category1 = o1.getCategory();
- String category2 = o2.getCategory();
- if (category1.equals(category2)) {
- return o1.getName().compareTo(o2.getName());
- }
- return category1.compareTo(category2);
- }
- else if ("Version".equals(column)) {
- String version1 = o1.getPluginArtifact().getModuleId().getVersion();
- String version2 = o2.getPluginArtifact().getModuleId().getVersion();
- if (version1.equals(version2)) {
- return o1.getName().compareTo(o2.getName());
- }
- return version1.compareTo(version2);
- }
- else if ("Installable".equals(column)) {
- if (o1.isInstallable() == o2.isInstallable()) {
- return o1.getName().compareTo(o2.getName());
- }
- return o1.isInstallable() ? -1 : 1 ;
- }
- else { // default sort column is Name
- return o1.getName().compareTo(o2.getName());
- }
- }
- });
-
- // save everything in the request
- request.setAttribute("plugins", plugins);
- request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, data);
+ listPlugins(request, pluginInstaller, data, false);
+ request.getPortletSession(true).setAttribute(SERVER_CONFIG_LIST_SESSION_KEY, data);
return true;
}
-}
+
+}
\ No newline at end of file
Copied: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java (from r613304, geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java?p2=geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java&p1=geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java&r1=613304&r2=613462&rev=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java Sat Jan 19 13:46:39 2008
@@ -17,7 +17,6 @@
package org.apache.geronimo.console.car;
import java.io.IOException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -26,14 +25,12 @@
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
-import javax.security.auth.login.FailedLoginException;
import org.apache.geronimo.console.MultiPageModel;
-import org.apache.geronimo.kernel.repository.Dependency;
+import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.system.plugin.DownloadResults;
import org.apache.geronimo.system.plugin.PluginInstaller;
-import org.apache.geronimo.system.plugin.PluginInstallerGBean;
-import org.apache.geronimo.system.plugin.model.PluginArtifactType;
+import org.apache.geronimo.system.plugin.ServerArchiver;
import org.apache.geronimo.system.plugin.model.PluginListType;
import org.apache.geronimo.system.plugin.model.PluginType;
@@ -43,25 +40,15 @@
*
* @version $Rev$ $Date$
*/
-public class ViewPluginDownloadHandler extends BaseImportExportHandler {
+public class AssemblyViewHandler extends BaseImportExportHandler {
- public ViewPluginDownloadHandler() {
- super(VIEW_FOR_DOWNLOAD_MODE, "/WEB-INF/view/car/viewForDownload.jsp");
+ public AssemblyViewHandler() {
+ super(ASSEMBLY_VIEW_MODE, "/WEB-INF/view/car/viewForDownload.jsp");
}
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
- String configId = request.getParameter("configId");
String[] pluginIds = request.getParameterValues("plugin");
- if (configId != null) {
- pluginIds = new String[]{configId};
- }
- String repo = request.getParameter("repository");
- String user = request.getParameter("repo-user");
- String pass = request.getParameter("repo-pass");
response.setRenderParameter("pluginIds", pluginIds);
- response.setRenderParameter("repository", repo);
- if (!isEmpty(user)) response.setRenderParameter("repo-user", user);
- if (!isEmpty(pass)) response.setRenderParameter("repo-pass", pass);
return getMode();
}
@@ -70,115 +57,43 @@
PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
String[] configIds = request.getParameterValues("pluginIds");
- String repo = request.getParameter("repository");
- String user = request.getParameter("repo-user");
- String pass = request.getParameter("repo-pass");
- List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
- try {
- PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
- if (list == null) {
- list = pluginInstaller.listPlugins(new URL(repo), user, pass);
- request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
- }
- for (String configId : configIds) {
- PluginInfoBean plugin = new PluginInfoBean();
- for (PluginType metadata : list.getPlugin()) {
- for (PluginArtifactType testInstance : metadata.getPluginArtifact()) {
- if (PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId)) {
- plugin.setPlugin(metadata);
- plugin.setPluginArtifact(testInstance);
- plugins.add(plugin);
- break;
- }
- }
- }
- if (plugin.getPluginArtifact() == null) {
- throw new PortletException("No configuration found for '" + configId + "'");
- }
- }
- } catch (FailedLoginException e) {
- throw new PortletException("Invalid login for Maven repository '" + repo + "'", e);
+ PluginListType list = getServerPluginList(request, pluginInstaller);
+ PluginListType installList = getPluginsFromIds(configIds, list);
+ List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
+ for (PluginType pluginType: installList.getPlugin()) {
+ PluginInfoBean infoBean = new PluginInfoBean();
+ infoBean.setPlugin(pluginType);
+ infoBean.setPluginArtifact(pluginType.getPluginArtifact().get(0));
+ plugins.add(infoBean);
}
- boolean allInstallable = true;
- // see if the plugin is installable. if not then provide the details
- String validationOk = "All requirements for this plugin have been met.";
- for (PluginInfoBean plugin : plugins) {
- StringBuffer validationNotOk = new StringBuffer();
- PluginType holder = PluginInstallerGBean.copy(plugin.getPlugin(), plugin.getPluginArtifact());
- try {
- pluginInstaller.validatePlugin(holder);
- } catch (Exception e) {
- plugin.setInstallable(false);
- validationNotOk.append(e.getMessage());
- validationNotOk.append("<BR>\n");
- }
- Dependency[] missingPrereqs = pluginInstaller.checkPrerequisites(holder);
- if (missingPrereqs.length > 0) {
- plugin.setInstallable(false);
- for (Dependency dep : missingPrereqs) {
- validationNotOk.append(" Missing prerequisite ");
- validationNotOk.append(dep.getArtifact().toString());
- validationNotOk.append("<BR>\n");
- }
- }
- if (plugin.isInstallable()) {
- plugin.setValidationMessage(validationOk);
- } else {
- plugin.setValidationMessage(validationNotOk.toString());
- allInstallable = false;
- }
- }
request.setAttribute("plugins", plugins);
- request.setAttribute("repository", repo);
- request.setAttribute("repouser", user);
- request.setAttribute("repopass", pass);
- request.setAttribute("allInstallable", allInstallable);
+ request.setAttribute("allInstallable", true);
+ request.setAttribute("mode", ASSEMBLY_VIEW_MODE + "-after");
}
public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
- PluginInstaller configInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
- PluginListType installList = new PluginListType();
- String repo = request.getParameter("repository");
- String user = request.getParameter("repo-user");
- String pass = request.getParameter("repo-pass");
+ String relativeServerPath = "var/temp/assembly";
+ String group = "test";
+ String artifact = "testserver";
+ String version = "1.0";
+ String format = "tar.gz";
+
+ PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
+ ServerArchiver archiver = ManagementHelper.getManagementHelper(request).getArchiver();
String[] configIds = request.getParameterValues("configId");
+ PluginListType list = getServerPluginList(request, pluginInstaller);
+ PluginListType installList = getPluginsFromIds(configIds, list);
+
try {
- PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
- if (list == null) {
- list = configInstaller.listPlugins(new URL(repo), user, pass);
- request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
- }
- for (String configId : configIds) {
- PluginType plugin = null;
- for (PluginType metadata : list.getPlugin()) {
- for (PluginArtifactType testInstance : metadata.getPluginArtifact()) {
- if (PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId)) {
- plugin = PluginInstallerGBean.copy(metadata, testInstance);
- installList.getPlugin().add(plugin);
- break;
- }
- }
- }
- if (plugin == null) {
- throw new PortletException("No configuration found for '" + configId + "'");
- }
- }
- } catch (FailedLoginException e) {
- throw new PortletException("Invalid login for Maven repository '" + repo + "'", e);
+ DownloadResults downloadResults = pluginInstaller.installPluginList("repository", relativeServerPath, installList);
+ archiver.archive(relativeServerPath, "var/temp", new Artifact(group, artifact, version, format));
+ } catch (Exception e) {
+ throw new PortletException("Could not assemble server", e);
}
-
- Object downloadKey = configInstaller.startInstall(installList, repo, false, user, pass);
- DownloadResults results = configInstaller.checkOnInstall(downloadKey);
- request.getPortletSession(true).setAttribute(DOWNLOAD_RESULTS_SESSION_KEY, results);
- response.setRenderParameter("configIds", configIds);
- response.setRenderParameter("repository", repo);
- response.setRenderParameter("downloadKey", downloadKey.toString());
-
- if (!isEmpty(user)) response.setRenderParameter("repo-user", user);
- if (!isEmpty(pass)) response.setRenderParameter("repo-pass", pass);
- return DOWNLOAD_STATUS_MODE + BEFORE_ACTION;
+ return INDEX_MODE;
}
-}
+
+}
\ No newline at end of file
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/BaseImportExportHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/BaseImportExportHandler.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/BaseImportExportHandler.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/BaseImportExportHandler.java Sat Jan 19 13:46:39 2008
@@ -16,7 +16,21 @@
*/
package org.apache.geronimo.console.car;
+import java.io.IOException;
+import java.net.URL;
+
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.security.auth.login.FailedLoginException;
+
import org.apache.geronimo.console.MultiPageAbstractHandler;
+import org.apache.geronimo.system.plugin.model.PluginListType;
+import org.apache.geronimo.system.plugin.model.PluginType;
+import org.apache.geronimo.system.plugin.model.PluginArtifactType;
+import org.apache.geronimo.system.plugin.PluginInstaller;
+import org.apache.geronimo.system.plugin.PluginInstallerGBean;
+import org.apache.geronimo.kernel.config.NoSuchStoreException;
/**
* The base class for all handlers for this portlet
@@ -25,6 +39,7 @@
*/
public abstract class BaseImportExportHandler extends MultiPageAbstractHandler {
protected static final String CONFIG_LIST_SESSION_KEY = "console.plugins.ConfigurationList";
+ protected static final String SERVER_CONFIG_LIST_SESSION_KEY = "console.plugins.ServerConfigurationList";
public static final String DOWNLOAD_RESULTS_SESSION_KEY = "console.plugins.DownloadResults";
protected static final String INDEX_MODE = "index";
protected static final String ADD_REPO_MODE = "addRepository";
@@ -37,7 +52,55 @@
protected static final String CONFIRM_EXPORT_MODE = "confirm";
protected static final String UPDATE_REPOS_MODE = "updateList";
+ protected static final String LIST_SERVER_MODE = "listServer";
+ protected static final String ASSEMBLY_VIEW_MODE = "assemblyView";
+
protected BaseImportExportHandler(String mode, String viewName) {
super(mode, viewName);
+ }
+
+ protected PluginListType getRepoPluginList(PortletRequest request, PluginInstaller pluginInstaller, String repo, String user, String pass) throws IOException, PortletException {
+ PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
+ if (list == null) {
+ try {
+ list = pluginInstaller.listPlugins(new URL(repo), user, pass);
+ } catch (FailedLoginException e) {
+ throw new PortletException("Invalid login for repository '" + repo + "'", e);
+ }
+ request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
+ }
+ return list;
+ }
+
+ protected PluginListType getServerPluginList(PortletRequest request, PluginInstaller pluginInstaller) throws PortletException {
+ PluginListType data = (PluginListType) request.getPortletSession(true).getAttribute(SERVER_CONFIG_LIST_SESSION_KEY);
+ if (data==null) {
+ try {
+ data = pluginInstaller.createPluginListForRepositories(null);
+ } catch (NoSuchStoreException e) {
+ throw new PortletException("Server in unknown state", e);
+ }
+ }
+ return data;
+ }
+
+ protected PluginListType getPluginsFromIds(String[] configIds, PluginListType list) throws PortletException {
+ PluginListType installList = new PluginListType();
+ for (String configId : configIds) {
+ PluginType plugin = null;
+ for (PluginType metadata : list.getPlugin()) {
+ for (PluginArtifactType testInstance : metadata.getPluginArtifact()) {
+ if (PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId)) {
+ plugin = PluginInstallerGBean.copy(metadata, testInstance);
+ installList.getPlugin().add(plugin);
+ break;
+ }
+ }
+ }
+ if (plugin == null) {
+ throw new PortletException("No configuration found for '" + configId + "'");
+ }
+ }
+ return installList;
}
}
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java Sat Jan 19 13:46:39 2008
@@ -36,6 +36,7 @@
import org.apache.geronimo.kernel.repository.Dependency;
import org.apache.geronimo.kernel.repository.ImportType;
import org.apache.geronimo.system.plugin.PluginInstallerGBean;
+import org.apache.geronimo.system.plugin.PluginInstaller;
import org.apache.geronimo.system.plugin.model.ArtifactType;
import org.apache.geronimo.system.plugin.model.DependencyType;
import org.apache.geronimo.system.plugin.model.LicenseType;
@@ -104,15 +105,15 @@
request.setAttribute(prefix + "desc", prereq.getDescription());
}
if (reqs.size() > 3) {
- log.warn(
- "Unable to edit plugin metadata containing more than three prerequisites! Additional prereqs will not be editable.");
+ log.warn("Unable to edit plugin metadata containing more than three prerequisites! Additional prereqs will not be editable.");
}
}
}
public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
String configId = request.getParameter("configId");
- PluginType metadata = ManagementHelper.getManagementHelper(request).getPluginInstaller().getPluginMetadata(Artifact.create(configId));
+ PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
+ PluginType metadata = pluginInstaller.getPluginMetadata(Artifact.create(configId));
PluginArtifactType instance = metadata.getPluginArtifact().get(0);
String name = request.getParameter("name");
@@ -179,7 +180,7 @@
}
// Save updated metadata
- ManagementHelper.getManagementHelper(request).getPluginInstaller().updatePluginMetadata(metadata);
+ pluginInstaller.updatePluginMetadata(metadata);
response.setRenderParameter("configId", configId);
response.setRenderParameter("name", name);
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java Sat Jan 19 13:46:39 2008
@@ -40,6 +40,9 @@
addHelper(new UpdateListHandler(), config);
addHelper(new AddRepositoryHandler(), config);
addHelper(new ViewPluginDownloadHandler(), config);
+
+ addHelper(new AssemblyListHandler(), config);
+ addHelper(new AssemblyViewHandler(), config);
}
protected String getModelJSPVariableName() {
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java Sat Jan 19 13:46:39 2008
@@ -18,10 +18,6 @@
import java.io.IOException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
@@ -31,20 +27,15 @@
import javax.security.auth.login.FailedLoginException;
import org.apache.geronimo.console.MultiPageModel;
-import org.apache.geronimo.console.util.PortletManager;
-import org.apache.geronimo.kernel.repository.Dependency;
import org.apache.geronimo.system.plugin.PluginInstaller;
-import org.apache.geronimo.system.plugin.PluginInstallerGBean;
-import org.apache.geronimo.system.plugin.model.PluginArtifactType;
import org.apache.geronimo.system.plugin.model.PluginListType;
-import org.apache.geronimo.system.plugin.model.PluginType;
/**
* Handler for the import export list screen.
*
* @version $Rev$ $Date$
*/
-public class ListHandler extends BaseImportExportHandler {
+public class ListHandler extends AbstractListHandler {
public ListHandler() {
super(LIST_MODE, "/WEB-INF/view/car/list.jsp");
@@ -89,87 +80,15 @@
PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
// try to reuse the catalog data if it was already downloaded
- PluginListType data = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
- if (data==null) {
- try {
- data = pluginInstaller.listPlugins(new URL(repository), username, password);
- } catch (FailedLoginException e) {
- throw new PortletException("Invalid login for Maven repository '"+repository+"'", e);
- }
- }
+ PluginListType data = getRepoPluginList(request, pluginInstaller, repository, username, password);
if(data == null || data.getPlugin() == null) {
return false;
}
-
- List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
-
- for (PluginType metadata: data.getPlugin()) {
-
- // ignore plugins which have no artifacts defined
- if (metadata.getPluginArtifact().isEmpty()) {
- continue;
- }
-
- if (metadata.getCategory() == null) {
- metadata.setCategory("Unspecified");
- }
-
- for (PluginArtifactType artifact : metadata.getPluginArtifact()) {
- PluginInfoBean plugin = new PluginInfoBean();
- plugin.setPlugin(metadata);
- plugin.setPluginArtifact(artifact);
-
- // determine if the plugin is installable
- PluginType holder = PluginInstallerGBean.copy(metadata, artifact);
- try {
- pluginInstaller.validatePlugin(holder);
- } catch (Exception e) {
- plugin.setInstallable(false);
- }
- Dependency[] missingPrereqs = pluginInstaller.checkPrerequisites(holder);
- if (missingPrereqs.length > 0) {
- plugin.setInstallable(false);
- }
- plugins.add(plugin);
- }
- }
- // sort the plugin list based on the selected table column
- final String column = request.getParameter("column");
- Collections.sort(plugins, new Comparator<PluginInfoBean>() {
- public int compare(PluginInfoBean o1, PluginInfoBean o2) {
- if ("Category".equals(column)) {
- String category1 = o1.getCategory();
- String category2 = o2.getCategory();
- if (category1.equals(category2)) {
- return o1.getName().compareTo(o2.getName());
- }
- return category1.compareTo(category2);
- }
- else if ("Version".equals(column)) {
- String version1 = o1.getPluginArtifact().getModuleId().getVersion();
- String version2 = o2.getPluginArtifact().getModuleId().getVersion();
- if (version1.equals(version2)) {
- return o1.getName().compareTo(o2.getName());
- }
- return version1.compareTo(version2);
- }
- else if ("Installable".equals(column)) {
- if (o1.isInstallable() == o2.isInstallable()) {
- return o1.getName().compareTo(o2.getName());
- }
- return o1.isInstallable() ? -1 : 1 ;
- }
- else { // default sort column is Name
- return o1.getName().compareTo(o2.getName());
- }
- }
- });
-
- // save everything in the request
- request.setAttribute("plugins", plugins);
+ listPlugins(request, pluginInstaller, data, true);
request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, data);
return true;
}
+
}
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java Sat Jan 19 13:46:39 2008
@@ -38,6 +38,7 @@
import org.apache.geronimo.kernel.Kernel;
import org.apache.geronimo.system.plugin.PluginInstaller;
import org.apache.geronimo.system.plugin.PluginRepositoryList;
+import org.apache.geronimo.system.plugin.ServerArchiver;
/**
* @version $Rev$ $Date$
@@ -47,6 +48,7 @@
private final static String PLUGIN_HELPER_KEY = "org.apache.geronimo.console.PluginManagementHelper";
private final Kernel kernel;
private PluginInstaller pluginInstaller;
+ private ServerArchiver archiver;
private List<PluginRepositoryList> pluginRepositoryLists;
public static ManagementHelper getManagementHelper(PortletRequest request) {
@@ -76,6 +78,21 @@
}
}
return pluginInstaller;
+ }
+
+ public ServerArchiver getArchiver() {
+ if (archiver == null) {
+ Set<AbstractName> archivers = kernel.listGBeans(new AbstractNameQuery(ServerArchiver.class.getName()));
+ if (archivers.size() == 0) {
+ throw new IllegalStateException("No plugin installer registered");
+ }
+ try {
+ archiver = (ServerArchiver) kernel.getGBean(archivers.iterator().next());
+ } catch (GBeanNotFoundException e) {
+ throw new IllegalStateException("Plugin installer cannot be retrieved from kernel");
+ }
+ }
+ return archiver;
}
public List<PluginRepositoryList> getPluginRepositoryLists() {
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java Sat Jan 19 13:46:39 2008
@@ -17,7 +17,6 @@
package org.apache.geronimo.console.car;
import java.io.IOException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -26,7 +25,6 @@
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
-import javax.security.auth.login.FailedLoginException;
import org.apache.geronimo.console.MultiPageModel;
import org.apache.geronimo.kernel.repository.Dependency;
@@ -73,32 +71,15 @@
String repo = request.getParameter("repository");
String user = request.getParameter("repo-user");
String pass = request.getParameter("repo-pass");
- List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
- try {
- PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
- if (list == null) {
- list = pluginInstaller.listPlugins(new URL(repo), user, pass);
- request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
- }
- for (String configId : configIds) {
- PluginInfoBean plugin = new PluginInfoBean();
- for (PluginType metadata : list.getPlugin()) {
- for (PluginArtifactType testInstance : metadata.getPluginArtifact()) {
- if (PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId)) {
- plugin.setPlugin(metadata);
- plugin.setPluginArtifact(testInstance);
- plugins.add(plugin);
- break;
- }
- }
- }
- if (plugin.getPluginArtifact() == null) {
- throw new PortletException("No configuration found for '" + configId + "'");
- }
- }
- } catch (FailedLoginException e) {
- throw new PortletException("Invalid login for Maven repository '" + repo + "'", e);
+ PluginListType list = getRepoPluginList(request, pluginInstaller, repo, user, pass);
+ PluginListType installList = getPluginsFromIds(configIds, list);
+ List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
+ for (PluginType pluginType: installList.getPlugin()) {
+ PluginInfoBean infoBean = new PluginInfoBean();
+ infoBean.setPlugin(pluginType);
+ infoBean.setPluginArtifact(pluginType.getPluginArtifact().get(0));
+ plugins.add(infoBean);
}
boolean allInstallable = true;
@@ -135,43 +116,21 @@
request.setAttribute("repouser", user);
request.setAttribute("repopass", pass);
request.setAttribute("allInstallable", allInstallable);
+ request.setAttribute("mode", "viewForDownload-after");
}
public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
- PluginInstaller configInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
- PluginListType installList = new PluginListType();
+ PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
String repo = request.getParameter("repository");
String user = request.getParameter("repo-user");
String pass = request.getParameter("repo-pass");
String[] configIds = request.getParameterValues("configId");
- try {
- PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
- if (list == null) {
- list = configInstaller.listPlugins(new URL(repo), user, pass);
- request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
- }
- for (String configId : configIds) {
- PluginType plugin = null;
- for (PluginType metadata : list.getPlugin()) {
- for (PluginArtifactType testInstance : metadata.getPluginArtifact()) {
- if (PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId)) {
- plugin = PluginInstallerGBean.copy(metadata, testInstance);
- installList.getPlugin().add(plugin);
- break;
- }
- }
- }
- if (plugin == null) {
- throw new PortletException("No configuration found for '" + configId + "'");
- }
- }
- } catch (FailedLoginException e) {
- throw new PortletException("Invalid login for Maven repository '" + repo + "'", e);
- }
+ PluginListType list = getRepoPluginList(request, pluginInstaller, repo, user, pass);
+ PluginListType installList = getPluginsFromIds(configIds, list);
- Object downloadKey = configInstaller.startInstall(installList, repo, false, user, pass);
- DownloadResults results = configInstaller.checkOnInstall(downloadKey);
+ Object downloadKey = pluginInstaller.startInstall(installList, repo, false, user, pass);
+ DownloadResults results = pluginInstaller.checkOnInstall(downloadKey);
request.getPortletSession(true).setAttribute(DOWNLOAD_RESULTS_SESSION_KEY, results);
response.setRenderParameter("configIds", configIds);
response.setRenderParameter("repository", repo);
@@ -181,4 +140,5 @@
if (!isEmpty(pass)) response.setRenderParameter("repo-pass", pass);
return DOWNLOAD_STATUS_MODE + BEFORE_ACTION;
}
+
}
Copied: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblylist.jsp (from r613304, geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/list.jsp)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblylist.jsp?p2=geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblylist.jsp&p1=geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/list.jsp&r1=613304&r2=613462&rev=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/list.jsp (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblylist.jsp Sat Jan 19 13:46:39 2008
@@ -29,26 +29,15 @@
</c:when>
<c:otherwise>
<form action="<portlet:actionURL/>">
-<input type="hidden" name="repository" value="${repository}"/>
-<input type="hidden" name="repo-user" value="${repouser}"/>
-<input type="hidden" name="repo-pass" value="${repopass}"/>
-<input id="mode" type="hidden" name="mode" value="viewForDownload-before"/>
-<!--
-<input id="viewButton" type="submit" value="View" disabled
-onclick="document.getElementById('mode').value='viewForDownload-before'">
-<input id="installButton" type="submit" value="Install" disabled
-onclick="document.getElementById('mode').value='viewForDownload-after'">
--->
+<input id="mode" type="hidden" name="mode" value="assemblyView-before"/>
+
<table border="0" cellpadding="3">
<tr>
<th class="DarkBackground"> </th>
- <c:forEach var="column" items="Name,Version,Category,Installable">
+ <c:forEach var="column" items="Name,Version,Category">
<th class="DarkBackground"><a href='<portlet:actionURL>
- <portlet:param name="repository" value="${repository}"/>
- <portlet:param name="repo-user" value="${repouser}"/>
- <portlet:param name="repo-pass" value="${repopass}"/>
<portlet:param name="column" value="${column}"/>
- <portlet:param name="mode" value="index-after"/>
+ <portlet:param name="mode" value="listServer-after"/>
</portlet:actionURL>'>${column}</a></th>
</c:forEach>
</tr>
@@ -56,41 +45,18 @@
<c:set var="style" value="${status.index % 2 == 0 ? 'MediumBackground' : 'LightBackground'}"/>
<c:set var="artifact" value="${plugin.pluginArtifact.moduleId}"/>
<tr>
-<!--
- <td class="${style}">
- <input type="radio" name="configId"
- <c:choose>
- <c:when test="${plugin.installable}">
- onclick="document.getElementById('viewButton').disabled=false; document.getElementById('installButton').disabled=false;"
- </c:when>
- <c:otherwise>
- onclick="document.getElementById('viewButton').disabled=false; document.getElementById('installButton').disabled=true;"
- </c:otherwise>
- </c:choose>
- value='<c:out escapeXml="true" value="${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}"/>' />
- </td>
--->
<td class="${style}">
- <input type="checkbox" name="plugin" value="${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}" ${plugin.installable ? "": "disabled='true'"}/>
+ <input type="checkbox" name="plugin" value="${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}"/>
</td>
<td class="${style}">
- <a href='<portlet:actionURL>
- <portlet:param name="repository" value="${repository}"/>
- <portlet:param name="repo-user" value="${repouser}"/>
- <portlet:param name="repo-pass" value="${repopass}"/>
- <portlet:param name="configId" value="${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}"/>
- <portlet:param name="mode" value="viewForDownload-before"/>
- </portlet:actionURL>'>${plugin.name}</a>
+ ${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}
</td>
<td class="${style}">${artifact.version}</td>
<td class="${style}">${plugin.category}</td>
- <td align="center" class="${style}">
- ${plugin.installable ? "<img alt='check' src='/console/images/checkmark._16_green.png' />" : "<strong><font color='red'>X</font></strong>"}
- </td>
</tr>
</c:forEach>
</table>
- <input type="submit" value="Install"/>
+ <input type="submit" value="Assemble"/>
</form>
</c:otherwise>
</c:choose>
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/index.jsp?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/index.jsp (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/index.jsp Sat Jan 19 13:46:39 2008
@@ -47,8 +47,6 @@
<h2><fmt:message key="car.common.createGeronimoPlugin" /></h2>
<p><fmt:message key="car.index.createGeronimoPluginExp" /></p>
-
-
<form name="<portlet:namespace/>ExportForm" action="<portlet:actionURL/>" method="POST">
<input type="hidden" name="mode" value="configure-before" />
<select name="configId">
@@ -58,5 +56,12 @@
</c:forEach>
</select>
<input type="submit" value='<fmt:message key="car.common.exportPlugin" />' />
+</form>
+
+<h2>Assemble a server from plugins in this one</h2>
+
+<form name="<portlet:namespace/>AssemblyForm" action="<portlet:actionURL/>" method="POST">
+ <input type="hidden" name="mode" value="listServer-before" />
+ <input type="submit" value='Assemble a server' />
</form>
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp?rev=613462&r1=613461&r2=613462&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp Sat Jan 19 13:46:39 2008
@@ -145,7 +145,7 @@
<td valign="top">
<input type="submit" value="<fmt:message key="consolebase.common.install" />" />
<%--<input type="hidden" name="configIds" value="${configIds}" />--%>
- <input type="hidden" name="mode" value="viewForDownload-after" />
+ <input type="hidden" name="mode" value="${mode}" />
<input type="hidden" name="repository" value="${repository}" />
<input type="hidden" name="repo-user" value="${repouser}" />
<input type="hidden" name="repo-pass" value="${repopass}" />