[embjopr-commits] EMBJOPR SVN: r321 - in trunk/core/src/main: java/org/jboss/on/embedded/bean/history/operation and 7 other directories.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Thu Apr 23 10:17:53 EDT 2009


Author: ips
Date: 2009-04-23 10:17:52 -0400 (Thu, 23 Apr 2009)
New Revision: 321

Added:
   trunk/core/src/main/java/org/jboss/on/embedded/ui/BootstrapAction.java
Removed:
   trunk/core/src/main/java/org/jboss/on/embedded/BootstrapAction.java
Modified:
   trunk/core/src/main/java/org/jboss/on/embedded/bean/history/operation/OperationHistoryManagerBean.java
   trunk/core/src/main/java/org/jboss/on/embedded/manager/history/operation/OperationHistoryManager.java
   trunk/core/src/main/java/org/jboss/on/embedded/manager/pc/PluginContainerResourceManager.java
   trunk/core/src/main/java/org/jboss/on/embedded/ui/DiscoveryAction.java
   trunk/core/src/main/java/org/jboss/on/embedded/ui/SingleResourceOperationAction.java
   trunk/core/src/main/java/org/jboss/on/embedded/ui/SummaryAction.java
   trunk/core/src/main/java/org/jboss/on/embedded/ui/content/AbstractFileUploadAction.java
   trunk/core/src/main/webapp/WEB-INF/classes/messages.properties
   trunk/core/src/main/webapp/css/console-style.css
   trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml
Log:
fix operations page, i.e Control tab (https://jira.jboss.org/jira/browse/EMBJOPR-87); move BootstrapAction to ui package

Deleted: trunk/core/src/main/java/org/jboss/on/embedded/BootstrapAction.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/BootstrapAction.java	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/java/org/jboss/on/embedded/BootstrapAction.java	2009-04-23 14:17:52 UTC (rev 321)
@@ -1,275 +0,0 @@
-/*
- * Embedded Jopr Project
- * Copyright (C) 2006-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.jboss.on.embedded;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.on.embedded.bean.history.content.ContentServerServiceImpl;
-import org.jboss.on.embedded.bean.history.content.ContentHistoryManagerBean;
-import org.jboss.on.embedded.bean.history.operation.OperationServerServiceImpl;
-import org.jboss.on.embedded.manager.history.operation.OperationHistoryManager;
-import org.jboss.on.embedded.manager.ResourceManagerFactory;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.security.Identity;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Startup;
-import org.jboss.seam.annotations.Destroy;
-import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.contexts.ServletLifecycle;
-import org.jetbrains.annotations.Nullable;
-import org.rhq.core.pc.PluginContainer;
-import org.rhq.core.pc.PluginContainerConfiguration;
-import org.rhq.core.pc.ServerServices;
-import org.rhq.core.pc.plugin.PluginEnvironment;
-import org.rhq.core.pc.plugin.SimplePluginFinder;
-
-import javax.servlet.ServletContext;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.Collection;
-import java.util.Set;
-import java.util.jar.Manifest;
-import java.util.jar.Attributes;
-import java.util.logging.Logger;
-import java.util.logging.Level;
-
-/**
- * A Seam component that is in charge of initializing and shutting down the Admin Console.
- *
- * @author Ian Springer
- */
- at Name("bootstrapAction")
- at Scope(ScopeType.APPLICATION)
- at Startup
-public class BootstrapAction
-{
-    private static final Log LOG = LogFactory.getLog(BootstrapAction.class);
-
-    private static final String FACES_API_LOGGER_NAME = "javax.faces";
-    private static final String FACES_RI_LOGGER_NAME = "javax.enterprise.resource.webcontainer.jsf";
-    private static final String FACELETS_LOGGER_NAME = "facelets";
-
-    @In(value = "historyManager", create = true)
-    private OperationHistoryManager historyManager;
-
-    @In(value = "contentHistoryManager", create = true)
-    private ContentHistoryManagerBean contentHistoryManager;
-
-    @In(value = "inventoryEventListener", create = true)
-    private EmbeddedInventoryEventListener inventoryEventListener;
-
-    private boolean initialized;
-
-    private File tempDir;
-
-    /**
-     * Initializes the Admin Console after the first user logs in.
-     */
-    @Observer(Identity.EVENT_LOGIN_SUCCESSFUL)
-    public void init()
-    {
-        if (!this.initialized) {
-            try
-            {
-                String version = getVersion();
-                LOG.info("Initializing Administration Console" + ((version != null) ? (" v" + version) : "") + "...");
-                long startTime = System.currentTimeMillis();
-                reconfigureJdkLogging();
-                initPluginContainer();
-                ResourceManagerFactory.resourceManager().discoverResources();
-                long elapsedTime = System.currentTimeMillis() - startTime;
-                LOG.debug("Done initializing Administration Console (" + elapsedTime + " ms elapsed).");
-                this.initialized = true;
-            }
-            catch (Exception e)
-            {
-                LOG.error("*** Failed to initialize Administration Console. ***", e);
-            }
-        }
-    }
-
-    /**
-     * Shuts down the Admin Console when the webapp is stopped.
-     */
-    @Destroy
-    public void shutdown()
-    {
-        if (this.initialized) {
-            try
-            {
-                LOG.info("Shutting down Administration Console...");
-                PluginContainer.getInstance().shutdown();
-            }
-            catch (RuntimeException e)
-            {
-                LOG.error("*** Failed to shutdown Administration Console. ***", e);
-            }
-        }
-    }
-
-    public boolean isInitialized()
-    {
-        return this.initialized;
-    }
-
-    public File getTempDir()
-    {
-        return this.tempDir;
-    }
-
-    private void initPluginContainer()
-            throws MalformedURLException
-    {
-        PluginContainerConfiguration pluginContainerConfig = createPluginContainerConfiguration();
-        PluginContainer pluginContainer = PluginContainer.getInstance();
-        pluginContainer.setConfiguration(pluginContainerConfig);
-        configureMockScenarioLoader();
-        pluginContainer.initialize();
-        logLoadedPlugins(pluginContainer);
-        pluginContainer.getInventoryManager().addInventoryEventListener(this.inventoryEventListener);
-        pluginContainer.getInventoryManager().addInventoryEventListener(new LoggingInventoryEventListener());
-    }
-
-    @Nullable
-    private String getVersion() {
-        String version = null;
-        try {
-            version = this.getClass().getPackage().getImplementationVersion();
-            if (version == null) {
-                ServletContext servletContext = ServletLifecycle.getServletContext();
-                String manifestPath = servletContext.getRealPath("/META-INF/MANIFEST.MF");
-                Manifest manifest = new Manifest(new FileInputStream(manifestPath));
-                version = (String)manifest.getMainAttributes().get(Attributes.Name.IMPLEMENTATION_VERSION);
-                if (version == null) {
-                    throw new IllegalStateException(Attributes.Name.IMPLEMENTATION_VERSION + " attribute is not set in WAR's manifest.");
-                }
-            }
-        }
-        catch (Exception e) {
-            LOG.error("Could not determine Administration Console version.", e);
-        }
-        return version;
-    }
-
-    private static void reconfigureJdkLogging() {
-        try {
-            LOG.trace("Reconfiguring JDK logging...");
-            setJdkLoggerLevel(FACES_API_LOGGER_NAME, Level.WARNING);
-            setJdkLoggerLevel(FACES_RI_LOGGER_NAME, Level.WARNING);
-            setJdkLoggerLevel(FACELETS_LOGGER_NAME, Level.WARNING);
-        } catch (Exception e) {
-            LOG.warn("Failed to reconfigure JDK logging.", e);
-        }
-    }
-
-    private PluginContainerConfiguration createPluginContainerConfiguration() throws MalformedURLException {
-        PluginContainerConfiguration config = new PluginContainerConfiguration();
-        config.setPluginFinder(createPluginFinder());
-        setPluginContainerDataDirectory(config);
-        config.setTemporaryDirectory(initTempDir());
-        config.setContentDiscoveryPeriod(0);
-        ServerServices services = new ServerServices();
-
-        // Create operation listener
-        OperationServerServiceImpl callbackListener = new OperationServerServiceImpl();
-        callbackListener.setHistoryBean(this.historyManager);
-
-        // Create content listener
-        ContentServerServiceImpl contentListener = new ContentServerServiceImpl();
-        contentListener.setHistoryBean(this.contentHistoryManager);
-
-        // Add listeners to ServerServices
-        services.setOperationServerService(callbackListener);
-        services.setContentServerService(contentListener);
-        config.setServerServices(services);
-        return config;
-    }
-
-    private static SimplePluginFinder createPluginFinder() throws MalformedURLException {
-        ServletContext servletContext = ServletLifecycle.getServletContext();
-        SimplePluginFinder pluginFinder = new SimplePluginFinder();
-        Set<String> pluginStringSet = servletContext.getResourcePaths("/plugins/");
-        for (String pluginString : pluginStringSet)
-        {
-            if (pluginString.endsWith(".jar"))
-            {
-                URL pluginUrl = servletContext.getResource(pluginString);
-                pluginFinder.addUrl(pluginUrl);
-            }
-        }
-        return pluginFinder;
-    }
-
-    private static void configureMockScenarioLoader() {
-        LOG.trace("Configuring Mock Scenario Loader...");
-        System.setProperty("on.mock.jboss.scenario", "scenario2.xml");
-    }
-
-    private static void logLoadedPlugins(PluginContainer pluginContainer) {
-        Collection<PluginEnvironment> pluginEnvironments = pluginContainer.getPluginManager().getPlugins();
-        for (PluginEnvironment pluginEnvironment : pluginEnvironments)
-            LOG.debug("Loaded RHQ plugin [" + pluginEnvironment.getPluginName() + "].");        
-    }
-
-    private static void setJdkLoggerLevel(String name, Level level) {
-        Logger facesApiLogger = Logger.getLogger(name);
-        facesApiLogger.setLevel(level);
-    }
-
-    private static void setPluginContainerDataDirectory(PluginContainerConfiguration config)
-    {
-        File dataDirectory = getDirectory("jboss.server.data.dir");
-        if (dataDirectory != null)
-        {
-            config.setDataDirectory(dataDirectory);
-        }
-    }
-
-    private File initTempDir()
-    {
-        String jbasTempDir = System.getProperty("jboss.server.temp.dir");
-        String javaTempDir = System.getProperty("java.io.tmpdir");
-        String baseTempDir = (jbasTempDir != null) ? jbasTempDir : javaTempDir;
-        if (baseTempDir == null)
-            baseTempDir = File.separatorChar == '/' ? "/tmp" : "C:/tmp";
-        this.tempDir = new File(baseTempDir, "embjopr");
-        //noinspection ResultOfMethodCallIgnored
-        this.tempDir.mkdirs();
-        if (!this.tempDir.exists())
-            throw new IllegalStateException("Failed to initialize temporary directory: " + this.tempDir);
-        return this.tempDir;
-    }
-
-    @Nullable
-    private static File getDirectory(String systemProperty)
-    {
-        File directory = null;
-        String directoryPath = System.getProperty(systemProperty);
-        if (directoryPath != null)
-            directory = new File(directoryPath);
-        return directory;
-    }
-}

Modified: trunk/core/src/main/java/org/jboss/on/embedded/bean/history/operation/OperationHistoryManagerBean.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/bean/history/operation/OperationHistoryManagerBean.java	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/java/org/jboss/on/embedded/bean/history/operation/OperationHistoryManagerBean.java	2009-04-23 14:17:52 UTC (rev 321)
@@ -51,10 +51,10 @@
     {
         OperationHistory operationHistory = null;
         OperationDefinition operationDefinition = getOperationDefinition(operationName, resourceType);
-
         if (operationDefinition != null)
         {
-            String jobName = String.valueOf(jobNameId.incrementAndGet());
+            int id = jobNameId.incrementAndGet();
+            String jobName = operationDefinition.getName() + "-" + id;
             operationHistory =
                     new ResourceOperationHistory(jobName,
                             "",
@@ -63,10 +63,9 @@
                             parameters,
                             resource,
                             null); //GroupOperationHistory
-            operationHistory.setId(operationHistory.getJobId().hashCode());
+            operationHistory.setId(id);
             addToMaps(operationHistory, resource, resourceType);
         }
-
         return operationHistory;
     }
 

Modified: trunk/core/src/main/java/org/jboss/on/embedded/manager/history/operation/OperationHistoryManager.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/manager/history/operation/OperationHistoryManager.java	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/java/org/jboss/on/embedded/manager/history/operation/OperationHistoryManager.java	2009-04-23 14:17:52 UTC (rev 321)
@@ -30,8 +30,9 @@
  */
 public interface OperationHistoryManager extends HistoryManager<OperationHistory>
 {
+    // TODO: Isn't passing the ResourceType here redundant?
     public OperationHistory addOperationHistory(String operationName,
-                                                Configuration configuration,
+                                                Configuration operationParameters,
                                                 Resource resource,
                                                 ResourceType resourceType);
 

Modified: trunk/core/src/main/java/org/jboss/on/embedded/manager/pc/PluginContainerResourceManager.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/manager/pc/PluginContainerResourceManager.java	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/java/org/jboss/on/embedded/manager/pc/PluginContainerResourceManager.java	2009-04-23 14:17:52 UTC (rev 321)
@@ -20,7 +20,6 @@
 package org.jboss.on.embedded.manager.pc;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
@@ -332,18 +331,15 @@
         return getInventoryService().getCurrentAvailability(resource);
     }
 
+    @NotNull
     public List<OperationDefinition> getOperationsForResource(Resource resource)
     {
-        List<OperationDefinition> operationDefinitions;
+        List<OperationDefinition> operationDefinitions = new ArrayList();
         if (resource != null)
         {
             ResourceType resourceType = resource.getResourceType();
-            operationDefinitions = new ArrayList(resourceType.getOperationDefinitions());
+            operationDefinitions.addAll(resourceType.getOperationDefinitions());
         }
-        else
-        {
-            operationDefinitions = Collections.emptyList();
-        }
         return operationDefinitions;
     }
 

Added: trunk/core/src/main/java/org/jboss/on/embedded/ui/BootstrapAction.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/BootstrapAction.java	                        (rev 0)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/BootstrapAction.java	2009-04-23 14:17:52 UTC (rev 321)
@@ -0,0 +1,277 @@
+/*
+ * Embedded Jopr Project
+ * Copyright (C) 2006-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.jboss.on.embedded.ui;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.on.embedded.bean.history.content.ContentServerServiceImpl;
+import org.jboss.on.embedded.bean.history.content.ContentHistoryManagerBean;
+import org.jboss.on.embedded.bean.history.operation.OperationServerServiceImpl;
+import org.jboss.on.embedded.manager.history.operation.OperationHistoryManager;
+import org.jboss.on.embedded.manager.ResourceManagerFactory;
+import org.jboss.on.embedded.EmbeddedInventoryEventListener;
+import org.jboss.on.embedded.LoggingInventoryEventListener;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.security.Identity;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Startup;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.contexts.ServletLifecycle;
+import org.jetbrains.annotations.Nullable;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.core.pc.PluginContainerConfiguration;
+import org.rhq.core.pc.ServerServices;
+import org.rhq.core.pc.plugin.PluginEnvironment;
+import org.rhq.core.pc.plugin.SimplePluginFinder;
+
+import javax.servlet.ServletContext;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.util.Collection;
+import java.util.Set;
+import java.util.jar.Manifest;
+import java.util.jar.Attributes;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A Seam component that is in charge of initializing and shutting down the Admin Console.
+ *
+ * @author Ian Springer
+ */
+ at Name("bootstrapAction")
+ at Scope(ScopeType.APPLICATION)
+ at Startup
+public class BootstrapAction
+{
+    private static final Log LOG = LogFactory.getLog(BootstrapAction.class);
+
+    private static final String FACES_API_LOGGER_NAME = "javax.faces";
+    private static final String FACES_RI_LOGGER_NAME = "javax.enterprise.resource.webcontainer.jsf";
+    private static final String FACELETS_LOGGER_NAME = "facelets";
+
+    @In(value = "historyManager", create = true)
+    private OperationHistoryManager historyManager;
+
+    @In(value = "contentHistoryManager", create = true)
+    private ContentHistoryManagerBean contentHistoryManager;
+
+    @In(value = "inventoryEventListener", create = true)
+    private EmbeddedInventoryEventListener inventoryEventListener;
+
+    private boolean initialized;
+
+    private File tempDir;
+
+    /**
+     * Initializes the Admin Console after the first user logs in.
+     */
+    @Observer(Identity.EVENT_LOGIN_SUCCESSFUL)
+    public void init()
+    {
+        if (!this.initialized) {
+            try
+            {
+                String version = getVersion();
+                LOG.info("Initializing Administration Console" + ((version != null) ? (" v" + version) : "") + "...");
+                long startTime = System.currentTimeMillis();
+                reconfigureJdkLogging();
+                initPluginContainer();
+                ResourceManagerFactory.resourceManager().discoverResources();
+                long elapsedTime = System.currentTimeMillis() - startTime;
+                LOG.debug("Done initializing Administration Console (" + elapsedTime + " ms elapsed).");
+                this.initialized = true;
+            }
+            catch (Exception e)
+            {
+                LOG.error("*** Failed to initialize Administration Console. ***", e);
+            }
+        }
+    }
+
+    /**
+     * Shuts down the Admin Console when the webapp is stopped.
+     */
+    @Destroy
+    public void shutdown()
+    {
+        if (this.initialized) {
+            try
+            {
+                LOG.info("Shutting down Administration Console...");
+                PluginContainer.getInstance().shutdown();
+            }
+            catch (RuntimeException e)
+            {
+                LOG.error("*** Failed to shutdown Administration Console. ***", e);
+            }
+        }
+    }
+
+    public boolean isInitialized()
+    {
+        return this.initialized;
+    }
+
+    public File getTempDir()
+    {
+        return this.tempDir;
+    }
+
+    private void initPluginContainer()
+            throws MalformedURLException
+    {
+        PluginContainerConfiguration pluginContainerConfig = createPluginContainerConfiguration();
+        PluginContainer pluginContainer = PluginContainer.getInstance();
+        pluginContainer.setConfiguration(pluginContainerConfig);
+        configureMockScenarioLoader();
+        pluginContainer.initialize();
+        logLoadedPlugins(pluginContainer);
+        pluginContainer.getInventoryManager().addInventoryEventListener(this.inventoryEventListener);
+        pluginContainer.getInventoryManager().addInventoryEventListener(new LoggingInventoryEventListener());
+    }
+
+    @Nullable
+    private String getVersion() {
+        String version = null;
+        try {
+            version = this.getClass().getPackage().getImplementationVersion();
+            if (version == null) {
+                ServletContext servletContext = ServletLifecycle.getServletContext();
+                String manifestPath = servletContext.getRealPath("/META-INF/MANIFEST.MF");
+                Manifest manifest = new Manifest(new FileInputStream(manifestPath));
+                version = (String)manifest.getMainAttributes().get(Attributes.Name.IMPLEMENTATION_VERSION);
+                if (version == null) {
+                    throw new IllegalStateException(Attributes.Name.IMPLEMENTATION_VERSION + " attribute is not set in WAR's manifest.");
+                }
+            }
+        }
+        catch (Exception e) {
+            LOG.error("Could not determine Administration Console version.", e);
+        }
+        return version;
+    }
+
+    private static void reconfigureJdkLogging() {
+        try {
+            LOG.trace("Reconfiguring JDK logging...");
+            setJdkLoggerLevel(FACES_API_LOGGER_NAME, Level.WARNING);
+            setJdkLoggerLevel(FACES_RI_LOGGER_NAME, Level.WARNING);
+            setJdkLoggerLevel(FACELETS_LOGGER_NAME, Level.WARNING);
+        } catch (Exception e) {
+            LOG.warn("Failed to reconfigure JDK logging.", e);
+        }
+    }
+
+    private PluginContainerConfiguration createPluginContainerConfiguration() throws MalformedURLException {
+        PluginContainerConfiguration config = new PluginContainerConfiguration();
+        config.setPluginFinder(createPluginFinder());
+        setPluginContainerDataDirectory(config);
+        config.setTemporaryDirectory(initTempDir());
+        config.setContentDiscoveryPeriod(0);
+        ServerServices services = new ServerServices();
+
+        // Create operation listener
+        OperationServerServiceImpl callbackListener = new OperationServerServiceImpl();
+        callbackListener.setHistoryBean(this.historyManager);
+
+        // Create content listener
+        ContentServerServiceImpl contentListener = new ContentServerServiceImpl();
+        contentListener.setHistoryBean(this.contentHistoryManager);
+
+        // Add listeners to ServerServices
+        services.setOperationServerService(callbackListener);
+        services.setContentServerService(contentListener);
+        config.setServerServices(services);
+        return config;
+    }
+
+    private static SimplePluginFinder createPluginFinder() throws MalformedURLException {
+        ServletContext servletContext = ServletLifecycle.getServletContext();
+        SimplePluginFinder pluginFinder = new SimplePluginFinder();
+        Set<String> pluginStringSet = servletContext.getResourcePaths("/plugins/");
+        for (String pluginString : pluginStringSet)
+        {
+            if (pluginString.endsWith(".jar"))
+            {
+                URL pluginUrl = servletContext.getResource(pluginString);
+                pluginFinder.addUrl(pluginUrl);
+            }
+        }
+        return pluginFinder;
+    }
+
+    private static void configureMockScenarioLoader() {
+        LOG.trace("Configuring Mock Scenario Loader...");
+        System.setProperty("on.mock.jboss.scenario", "scenario2.xml");
+    }
+
+    private static void logLoadedPlugins(PluginContainer pluginContainer) {
+        Collection<PluginEnvironment> pluginEnvironments = pluginContainer.getPluginManager().getPlugins();
+        for (PluginEnvironment pluginEnvironment : pluginEnvironments)
+            LOG.debug("Loaded RHQ plugin [" + pluginEnvironment.getPluginName() + "].");        
+    }
+
+    private static void setJdkLoggerLevel(String name, Level level) {
+        Logger facesApiLogger = Logger.getLogger(name);
+        facesApiLogger.setLevel(level);
+    }
+
+    private static void setPluginContainerDataDirectory(PluginContainerConfiguration config)
+    {
+        File dataDirectory = getDirectory("jboss.server.data.dir");
+        if (dataDirectory != null)
+        {
+            config.setDataDirectory(dataDirectory);
+        }
+    }
+
+    private File initTempDir()
+    {
+        String jbasTempDir = System.getProperty("jboss.server.temp.dir");
+        String javaTempDir = System.getProperty("java.io.tmpdir");
+        String baseTempDir = (jbasTempDir != null) ? jbasTempDir : javaTempDir;
+        if (baseTempDir == null)
+            baseTempDir = File.separatorChar == '/' ? "/tmp" : "C:/tmp";
+        this.tempDir = new File(baseTempDir, "embjopr");
+        //noinspection ResultOfMethodCallIgnored
+        this.tempDir.mkdirs();
+        if (!this.tempDir.exists())
+            throw new IllegalStateException("Failed to initialize temporary directory: " + this.tempDir);
+        return this.tempDir;
+    }
+
+    @Nullable
+    private static File getDirectory(String systemProperty)
+    {
+        File directory = null;
+        String directoryPath = System.getProperty(systemProperty);
+        if (directoryPath != null)
+            directory = new File(directoryPath);
+        return directory;
+    }
+}


Property changes on: trunk/core/src/main/java/org/jboss/on/embedded/ui/BootstrapAction.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Author Id Revision HeadURL
Name: svn:eol-style
   + LF

Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/DiscoveryAction.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/DiscoveryAction.java	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/DiscoveryAction.java	2009-04-23 14:17:52 UTC (rev 321)
@@ -22,7 +22,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.on.embedded.manager.ResourceManagerFactory;
-import org.jboss.on.embedded.BootstrapAction;
 
 import org.jboss.seam.ScopeType;
 import org.jboss.seam.annotations.Name;
@@ -42,36 +41,38 @@
 public class DiscoveryAction {
 	private final Log log = LogFactory.getLog(this.getClass());
 
+    // the minimum length of time (in milliseconds) between consecutive discoveries
+	private static final int DEFAULT_MINIMUM_SCAN_INTERVAL = 60000; // 1 minute
+
     @In
     private BootstrapAction bootstrapAction;
 
 	private volatile long lastDiscoveryTime;
 
-	// the minimum length of time (in milliseconds) between consecutive discoveries
-	private int scanPeriod = 60000;
+    private int scanPeriod = DEFAULT_MINIMUM_SCAN_INTERVAL;
 
-	public int getScanPeriod() {
+    public int getScanPeriod() {
 		return this.scanPeriod;
 	}
 
-	public void setScanPeriod(int n) {
-		this.scanPeriod = n;
+	public void setScanPeriod(int scanPeriod) {
+		this.scanPeriod = scanPeriod;
 	}
 	
 	public void checkAutodiscovery() {		
-		if (this.bootstrapAction.isInitialized() && (System.currentTimeMillis() - lastDiscoveryTime) > scanPeriod) {
-			// try the timestamp check in a synchronized block
+		if (this.bootstrapAction.isInitialized() && (System.currentTimeMillis() - lastDiscoveryTime) > DEFAULT_MINIMUM_SCAN_INTERVAL) {
+			// Try the timestamp check in a synchronized block.
 			tryAutodiscovery();
 		}
 	}
 
 	synchronized private void tryAutodiscovery() {
 		log.trace("Checking if service discovery scan is needed...");
-		if ((System.currentTimeMillis() - lastDiscoveryTime) > scanPeriod) {
+		if ((System.currentTimeMillis() - lastDiscoveryTime) > DEFAULT_MINIMUM_SCAN_INTERVAL) {
 			// Put the timestamp updating above the call to discoverServicesAsync(), so we don't continuously
 			// retry on failure, and so we don't block subsequent requests waiting to get into tryAutodiscovery().
 			lastDiscoveryTime = System.currentTimeMillis();
-			log.debug("Performing service discovery scan...");
+			log.trace("Performing service discovery scan...");
 		    ResourceManagerFactory.resourceManager().discoverServicesAsync();
 		}
 	}

Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/SingleResourceOperationAction.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/SingleResourceOperationAction.java	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/SingleResourceOperationAction.java	2009-04-23 14:17:52 UTC (rev 321)
@@ -28,7 +28,6 @@
 import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.Out;
 import org.jboss.seam.annotations.Begin;
-import org.jboss.seam.annotations.End;
 import org.jboss.seam.annotations.Scope;
 import org.jboss.seam.annotations.web.RequestParameter;
 import org.rhq.core.domain.operation.OperationDefinition;
@@ -67,7 +66,7 @@
     @In
     private OperationHistoryManager historyManager;
 
-    @In(required = false)
+    @Out(required = false)
     private OperationHistory selectedHistory;
 
     @In(create = true)
@@ -80,7 +79,7 @@
     private List<OperationDefinition> operations = new ArrayList<OperationDefinition>();
 
     @Out(required = false)
-    private List<ResourceOperationHistory> operationHistory;
+    private List<ResourceOperationHistory> operationHistories;
 
     Map<Integer, ResourceOperationHistory> operationHistoryMap = new HashMap<Integer, ResourceOperationHistory>();
 
@@ -98,7 +97,7 @@
     {
         this.currentResource = this.commonActionUtil.getCurrentResource();
         initOperations();
-        initHistory();
+        initHistories();
     }
 
     /**
@@ -106,7 +105,6 @@
      *
      * @return a JSF outcome string
      */
-    @End(ifOutcome={"success"}, beforeRedirect = true)
     public String invokeOperation()
     {
         //this.facesMessages.clear();
@@ -117,30 +115,33 @@
             initSelectedOperationInfo();
             return "missingParams";
         } else {
-            OperationHistory newOperationHistory = this.historyManager.addOperationHistory(operationDef.getName(), null,
-                    this.currentResource, resourceType);
-            newOperationHistory.setParameters(this.selectedOperationParameters);
+            OperationHistory newOperationHistory = this.historyManager.addOperationHistory(operationDef.getName(), 
+                    this.selectedOperationParameters, this.currentResource, resourceType);
+            // Null this out as soon as we're done with it, so it won't carry over to the next request.
+            this.selectedOperationParameters = null;
             ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
             String jobId = newOperationHistory.getJobId().toString();
             try {
-                resourceManager.invokeOperation(this.currentResource, operationDef, this.selectedOperationParameters, jobId);
-                this.facesMessages.add("Operation invoked. See history below for results once the operation completes.");
+                resourceManager.invokeOperation(this.currentResource, operationDef, newOperationHistory.getParameters(),
+                        jobId);
+                this.facesMessages.add("The #0 operation has been invoked. See the operation history below for the results once the operation has completed.", operationDef.getName());
             }
             catch (RuntimeException e) {
                 newOperationHistory.setStatus(OperationRequestStatus.FAILURE);
                 newOperationHistory.setErrorMessageFromThrowable(e);
                 this.facesMessages.add(FacesMessage.SEVERITY_FATAL, "Failed to invoke operation: #0", e);
             }
-            initHistory();
+            initHistories();
+            // Auto-select the operation history, so its results will be displayed in the
+            // "Selected Operation History Item" panel.
+            selectOperationHistory(newOperationHistory.getId());
             return "success";
         }
     }
 
-    // if later we want the error column to hold a link instead of
-    // showing the message, which it does now.
-    public String getHistoryError()
+    public void selectOperationHistory(int id)
     {
-        return selectedHistory.getErrorMessage();
+        this.selectedHistory = this.getOperationHistory(id);
     }
 
     /**
@@ -163,25 +164,20 @@
     }
 
     /**
-     * Make the first row be bolded, so it needs a different style class
-     * @param history the history of the Operations
-     * @return name of the style class to return to add to the tag
+     * Return the CSS style class that should be used for the specified history item.
+     *
+     * @param history a history item
+     * @return name of the style class to return to add to the 'tr' tag
      */
-    public String getResultsRowStyleClass(OperationHistory history)
+    public String getHistoriesTableRowStyleClass(OperationHistory history)
     {
-        String styleClass = "";
-        if (history != null && operationHistory != null)
-        {
-            if (operationHistory.indexOf(history) == 0)
-            {
-                styleClass = "operation-first-row";
-            }
-        }
+        @SuppressWarnings({"UnnecessaryLocalVariable"}) 
+        String styleClass = (history.equals(this.selectedHistory)) ? "selectedRow" : "";
         return styleClass;
     }
 
-    public ResourceOperationHistory getOperationHistory(int jobId) {
-        return this.operationHistoryMap.get(jobId);
+    public ResourceOperationHistory getOperationHistory(int opHistoryId) {
+        return this.operationHistoryMap.get(opHistoryId);
     }
 
     private ResourceType getResourceType() {
@@ -197,20 +193,20 @@
         operations = resourceManager.getOperationsForResource(currentResource);
     }
 
-    private void initHistory()
+    private void initHistories()
     {
         Collection<OperationHistory> opHistories = historyManager.getHistoryForResource(currentResource);
 
         if (opHistories != null)
         {
-            operationHistory = new ArrayList<ResourceOperationHistory>();
+            this.operationHistories = new ArrayList<ResourceOperationHistory>();
             for (OperationHistory opHistory : opHistories) {
                 ResourceOperationHistory resourceOpHistory = (ResourceOperationHistory)opHistory;
-                this.operationHistory.add(resourceOpHistory);
+                this.operationHistories.add(resourceOpHistory);
                 this.operationHistoryMap.put(resourceOpHistory.getId(), resourceOpHistory);
             }
 
-            Collections.sort(operationHistory, new Comparator<OperationHistory>()
+            Collections.sort(operationHistories, new Comparator<OperationHistory>()
             {
                 public int compare(OperationHistory a, OperationHistory b)
                 {
@@ -232,13 +228,12 @@
         }
         else
         {
-            operationHistory = null;
+            operationHistories = null;
         }
     }
 
     public Map<Integer, ResourceOperationHistory> getOperationHistoryMap()
     {
-
         return operationHistoryMap;
     }
 

Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/SummaryAction.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/SummaryAction.java	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/SummaryAction.java	2009-04-23 14:17:52 UTC (rev 321)
@@ -42,7 +42,6 @@
 import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.Out;
 import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Outcome;
 
 import org.jetbrains.annotations.NotNull;
 

Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/content/AbstractFileUploadAction.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/content/AbstractFileUploadAction.java	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/content/AbstractFileUploadAction.java	2009-04-23 14:17:52 UTC (rev 321)
@@ -31,7 +31,7 @@
 import org.jboss.seam.faces.FacesMessages;
 
 import org.jboss.on.embedded.ui.NavigationAction;
-import org.jboss.on.embedded.BootstrapAction;
+import org.jboss.on.embedded.ui.BootstrapAction;
 
 /**
  * @author Ian Springer

Modified: trunk/core/src/main/webapp/WEB-INF/classes/messages.properties
===================================================================
--- trunk/core/src/main/webapp/WEB-INF/classes/messages.properties	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/webapp/WEB-INF/classes/messages.properties	2009-04-23 14:17:52 UTC (rev 321)
@@ -122,8 +122,8 @@
 control.resourceInstance.error.noOperations=No control operations for this resource
 control.resourceInstance.select=Select from the available control operations for this resource.
 control.resourceInstance.button.execute=Execute
-control.resourceInstance.previous=Previous Operations
-control.resourceInstance.error.noPrevious=No previous operations for this resource
+control.resourceInstance.operationHistory=Operation History
+control.resourceInstance.error.noPrevious=No operations have been executed on this Resource since this JBoss AS instance was last started.
 control.resourceInstance.previous.executedAt=Executed At
 control.resourceInstance.previous.operation=Operation Name
 control.resourceInstance.previous.status=Status

Modified: trunk/core/src/main/webapp/css/console-style.css
===================================================================
--- trunk/core/src/main/webapp/css/console-style.css	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/webapp/css/console-style.css	2009-04-23 14:17:52 UTC (rev 321)
@@ -519,6 +519,11 @@
     background-color: #d2e1ea;
 }
 
+.selectedRow {
+    border: medium solid #FFF;
+    background-color: #777;
+}
+
 .detailPanel {
     border-top-width: 0;
     border-bottom-width: 0;

Modified: trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml
===================================================================
--- trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml	2009-04-22 17:25:09 UTC (rev 320)
+++ trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml	2009-04-23 14:17:52 UTC (rev 321)
@@ -47,9 +47,11 @@
 <div class="tabmenubox">
 <ui:include src="../include/displayGlobalMessages.xhtml"/>
 
-<h:outputText value="#{messages['control.resourceInstance.error.noOperations']}" rendered="#{operations eq null}"/>
+<h:outputText value="#{messages['control.resourceInstance.error.noOperations']}"
+              rendered="#{empty operations}"/>
 
-<h:form id="operation_form" rendered="#{operations ne null}">
+<h:form id="operationsForm"
+        rendered="#{!empty operations}">
     <div class="instructionalText">
         #{messages['control.resourceInstance.select']}
     </div>
@@ -82,135 +84,151 @@
     </div>
 </h:form>
 
-<h2>#{messages['control.resourceInstance.previous']}</h2>
+<rich:panel id="historiesPanel" rendered="#{!empty operationHistories}" style="margin-top: 12px;">
 
-<!-- NOTE: This is a workaround for JBMANCON-370. This can be removed once 
-     JBMANCON-370 is resolved. -->
-<div class="instructionalText">
-    <h:outputText rendered="#{operationHistory ne null}"> 
-        #{messages['control.resourceInstance.status.details1a']}
-        <a id="refreshLink" href="javascript:window.location.reload(true)">#{messages['control.resourceInstance.status.details1b']}</a>
-    </h:outputText>
-</div>
-                  
-<h:outputText value="#{messages['control.resourceInstance.error.noPrevious']}" rendered="#{operationHistory eq null}"/>
+    <f:facet name="header">
+        #{messages['control.resourceInstance.operationHistory']}
+    </f:facet>
 
-<h:form id="operationHistoryForm" rendered="#{operationHistory ne null}">
-    <ui:remove>
-        <!-- NOTE: The below causes the results/error toggle panels to not display properly. Uncomment when RichFaces
-                   fixes whatever the problem is. (ips, 08/20/08) -->
-        <a4j:poll id="refreshId" reRender="dataTable" interval="15000"/>
-    </ui:remove>
+    <h:outputText value="#{messages['control.resourceInstance.error.noPrevious']}" rendered="#{empty operationHistories}"/>
 
-    <rich:dataTable
-            styleClass="properties-table"
-            id="dataTable"
-            rows="#{tableManager.numRows}"
-            rowClasses="DarkRow"
-            var="selectedHistory"
-            value="#{operationHistory}">
+    <h:form id="historiesForm" rendered="#{!empty operationHistories}">
+        <ui:remove>
+        <a4j:poll id="poller" reRender="poller, historiesForm, historyDetailsPanel" interval="10000" limitToList="true"/>
+        </ui:remove>
+        
+        <rich:dataTable
+                styleClass="properties-table"
+                id="dataTable"
+                rows="#{tableManager.numRows}"
+                rowClasses="DarkRow"
+                var="operationHistory"
+                value="#{operationHistories}">
 
-        <f:facet name="header">
-            <rich:columnGroup>
-                <rich:column styleClass="properties-table-header-cell">
-                    <h:outputText value="#{messages['control.resourceInstance.previous.executedAt']}"/>
+            <f:facet name="header">
+                <rich:columnGroup>
+                    <rich:column styleClass="properties-table-header-cell">
+                        <h:outputText value="#{messages['control.resourceInstance.previous.executedAt']}"/>
+                    </rich:column>
+                    <rich:column styleClass="properties-table-header-cell">
+                        <h:outputText value="#{messages['control.resourceInstance.previous.operation']}"/>
+                    </rich:column>
+                    <rich:column styleClass="properties-table-header-cell">
+                        <h:outputText value="#{messages['control.resourceInstance.previous.status']}"/>
+                    </rich:column>
+                    <rich:column styleClass="properties-table-header-cell">
+                        <h:outputText value="Actions"/>
+                    </rich:column>
+                </rich:columnGroup>
+            </f:facet>
+
+            <rich:columnGroup styleClass="#{operationAction.getHistoriesTableRowStyleClass(operationHistory)}">
+
+                <rich:column styleClass="operationTimeColumn">
+                    <h:outputText value="#{operationHistory.createdTime}">
+                        <s:convertDateTime type="both" pattern="MMMMM d, yyyy '-' h:mm a"/>
+                    </h:outputText>
                 </rich:column>
-                <rich:column styleClass="properties-table-header-cell">
-                    <h:outputText value="#{messages['control.resourceInstance.previous.operation']}"/>
+
+                <rich:column styleClass="operationNameColumn">
+                    <h:outputText value="#{operationHistory.operationDefinition.displayName}"/>
                 </rich:column>
-                <rich:column styleClass="properties-table-header-cell">
-                    <h:outputText value="#{messages['control.resourceInstance.previous.status']}"/>
+
+                <rich:column styleClass="operationStatusColumn">
+                    <h:panelGroup>
+                        <h:outputText value="#{messages['control.resourceInstance.previous.success']}"
+                                      rendered="#{operationHistory.status eq 'SUCCESS'}" styleClass="operationSuccess"/>
+                        <h:outputText value="#{messages['control.resourceInstance.previous.inProgress']}"
+                                      rendered="#{operationHistory.status eq 'INPROGRESS'}" styleClass="operationInProgress"/>
+                        <h:outputText value="#{messages['control.resourceInstance.previous.failure']}"
+                                      rendered="#{operationHistory.status eq 'FAILURE'}" styleClass="operationFailure"/>
+                        <h:outputLabel value=" "/>
+                    </h:panelGroup>
                 </rich:column>
+
+                <rich:column styleClass="actionsColumn">
+                    <a4j:commandButton value="Show Details Below..."
+                                       action="#{operationAction.selectOperationHistory(operationHistory.id)}"
+                                       reRender="historiesPanel, historyDetailsPanel"
+                                       styleClass="buttonsmall"/>
+                </rich:column>
+
             </rich:columnGroup>
-        </f:facet>
+        </rich:dataTable>
 
-        <rich:columnGroup styleClass="#{operationAction.getResultsRowStyleClass(selectedHistory)}">
-            <rich:column styleClass="operationTimeColumn">
-                <h:outputText value="#{selectedHistory.createdTime}">
-                    <s:convertDateTime type="both" pattern="MMMMM d, yyyy '-' h:mm a"/>
-                </h:outputText>
-            </rich:column>
-            <rich:column styleClass="operationNameColumn">
-                <h:outputText value="#{selectedHistory.operationDefinition.displayName}"/>
-            </rich:column>
-            <rich:column styleClass="operationStatusColumn">
-                <h:panelGroup>
-                    <h:outputText value="#{messages['control.resourceInstance.previous.success']}"
-                                  rendered="#{selectedHistory.status eq 'SUCCESS'}" styleClass="operationSuccess"/>
-                    <h:outputText value="#{messages['control.resourceInstance.previous.inProgress']}"
-                                  rendered="#{selectedHistory.status eq 'INPROGRESS'}" styleClass="operationInProgress"/>
-                    <h:outputText value="#{messages['control.resourceInstance.previous.failure']}"
-                                  rendered="#{selectedHistory.status eq 'FAILURE'}" styleClass="operationFailure"/>
-                    <h:outputLabel value=" "/>
-                    <rich:toggleControl for="history_details"
-                                        value="#{messages['control.resourceInstance.previous.showHideDetails']}"
-                                        rendered="#{selectedHistory.status ne 'INPROGRESS'}"/>
-                </h:panelGroup>
-            </rich:column>
-            <rich:column colspan="3" breakBefore="true" styleClass="detailPanel" style="padding-left: 20px; padding-right: 20px;">
-                <h:outputLabel value=""/>
-                <rich:togglePanel id="history_details" switchType="client" stateOrder="empty, b"
-                                  rendered="#{selectedHistory.status ne 'INPROGRESS'}">
-                    <f:facet name="empty">
-                        <h:panelGroup>
-                            <h:outputLabel value=""/> <!--styleClass="historyErrorEmpty"/-->
-                        </h:panelGroup>
-                    </f:facet>
-                    <f:facet name="b">
-                        <h:panelGroup layout="block" style="margin-top: 6px; margin-bottom: 6px">
-                            <!-- Parameters -->
-                            <h3>#{messages['control.resourceInstance.previous.parameters']}</h3>
-                            <h:panelGroup rendered="#{selectedHistory.parameters ne null}">
-                                <onc:config configurationDefinition="#{selectedHistory.operationDefinition.parametersConfigurationDefinition}"
-                                            configuration="#{selectedHistory.parameters}"
-                                            readOnly="true"
-                                            nullConfigurationDefinitionMessage="null config def!"
-                                            nullConfigurationMessage="null config!"
-                                            nullConfigurationStyle="InfoBlock"/>
-                            </h:panelGroup>
-                            <h:panelGroup id="noParameters" rendered="#{selectedHistory.parameters eq null}">
-                                <i>None</i>
-                            </h:panelGroup>
+        <ui:include src="../include/resourceDataScroller.xhtml">
+            <ui:param name="paginationDataModel" value="#{operationHistories}"/>
+            <ui:param name="paginationDataTableName" value="dataTable"/>
+        </ui:include>
 
-                            <!-- Results -->
-                            <h:panelGroup layout="block" rendered="#{selectedHistory.status eq 'SUCCESS'}">
-                                <h3>#{messages['control.resourceInstance.previous.results']}</h3>
-                                <h:panelGroup id="operationResults" rendered="#{selectedHistory.results ne null and selectedHistory.operationDefinition.resultsConfigurationDefinition ne null}">
-                                    <onc:config configurationDefinition="#{selectedHistory.operationDefinition.resultsConfigurationDefinition}"
-                                                configuration="#{selectedHistory.results}"
-                                                readOnly="true"
-                                                nullConfigurationDefinitionMessage="null config def!"
-                                                nullConfigurationMessage="null config!"
-                                                nullConfigurationStyle="InfoBlock"/>
-                                </h:panelGroup>
-                                <h:panelGroup id="noResults" rendered="#{selectedHistory.results eq null or selectedHistory.operationDefinition.resultsConfigurationDefinition eq null}">
-                                    <i>None</i>
-                                </h:panelGroup>
-                            </h:panelGroup>
+    </h:form>
+</rich:panel>
 
-                            <!-- Error -->
-                            <h:panelGroup layout="block" rendered="#{selectedHistory.status eq 'FAILURE'}">
-                                <h3>#{messages['control.resourceInstance.previous.error']}</h3>
-                                <h:inputTextarea value="#{selectedHistory.errorMessage}" readonly="true"
-                                                 rendered="#{selectedHistory.errorMessage ne null}"
-                                                 style="width: 100%;" rows="7"/>
-                                <h:panelGroup rendered="#{selectedHistory.errorMessage eq null}">
-                                    <i>Unknown</i>
-                                </h:panelGroup>
-                            </h:panelGroup>
-                        </h:panelGroup>
-                    </f:facet>
-                </rich:togglePanel>
-            </rich:column>
-        </rich:columnGroup>
-    </rich:dataTable>
+<rich:panel id="historyDetailsPanel" rendered="#{!empty operationHistories}" style="margin-top: 12px;">
 
-    <ui:include src="../include/resourceDataScroller.xhtml">
-        <ui:param name="paginationDataModel" value="#{operationHistory}"/>
-        <ui:param name="paginationDataTableName" value="dataTable"/>
-    </ui:include>
-</h:form>
+    <f:facet name="header">
+        <h:outputText value="Selected Operation History Item"/>
+    </f:facet>
 
+    <h:panelGroup layout="block" rendered="#{empty selectedHistory}"
+                  style="margin-top: 6px; margin-bottom: 6px">
+        No operation history is selected. Please select one above.
+    </h:panelGroup>
+
+    <!-- TODO: Enclose params and results in separate forms, so that drilling down on a list of maps is possible. -->
+
+    <h:panelGroup layout="block" rendered="#{!empty selectedHistory}"
+                  style="margin-top: 6px; margin-bottom: 6px">
+        <!-- Parameters -->
+        <h3>#{messages['control.resourceInstance.previous.parameters']}</h3>
+        <h:panelGroup rendered="#{selectedHistory.parameters ne null}">
+            <onc:config configurationDefinition="#{selectedHistory.operationDefinition.parametersConfigurationDefinition}"
+                        configuration="#{selectedHistory.parameters}"
+                        readOnly="true"
+                        nullConfigurationDefinitionMessage="null config def!"
+                        nullConfigurationMessage="null config!"
+                        nullConfigurationStyle="InfoBlock"/>
+        </h:panelGroup>
+        <h:panelGroup id="noParameters" rendered="#{selectedHistory.parameters eq null or empty selectedHistory.parameters.map}">
+            <i>This operation does not take any parameters.</i>
+        </h:panelGroup>
+
+        <!-- Results -->
+        <h:panelGroup layout="block" rendered="#{selectedHistory.status eq 'INPROGRESS' or selectedHistory.status eq 'SUCCESS'}">
+            <h3>#{messages['control.resourceInstance.previous.results']}</h3>
+            <h:panelGroup layout="block"
+                          rendered="#{selectedHistory.status eq 'INPROGRESS'}">
+                <i>The operation has not completed yet.</i>
+            </h:panelGroup>
+            <h:panelGroup layout="block"
+                          rendered="#{selectedHistory.status eq 'SUCCESS' and selectedHistory.results ne null and selectedHistory.operationDefinition.resultsConfigurationDefinition ne null}">
+                <onc:config configurationDefinition="#{selectedHistory.operationDefinition.resultsConfigurationDefinition}"
+                            configuration="#{selectedHistory.results}"
+                            readOnly="true"
+                            nullConfigurationDefinitionMessage="null config def!"
+                            nullConfigurationMessage="null config!"
+                            nullConfigurationStyle="InfoBlock"/>
+            </h:panelGroup>
+            <h:panelGroup layout="block"
+                          rendered="#{selectedHistory.status eq 'SUCCESS' and (selectedHistory.results eq null or empty selectedHistory.results.map)}">
+                <i>The operation did not return any results.</i>
+            </h:panelGroup>
+        </h:panelGroup>
+
+        <!-- Error -->
+        <h:panelGroup layout="block" rendered="#{operationHistory.status eq 'FAILURE'}">
+            <h3>#{messages['control.resourceInstance.previous.error']}</h3>
+            <h:inputTextarea value="#{operationHistory.errorMessage}" readonly="true"
+                             rendered="#{operationHistory.errorMessage ne null}"
+                             style="width: 100%;" rows="7"/>
+            <h:panelGroup rendered="#{operationHistory.errorMessage eq null}">
+                <i>The operation failed for an unknown reason.</i>
+            </h:panelGroup>
+        </h:panelGroup>
+    </h:panelGroup>
+
+</rich:panel>
+
 </div>
 </ui:define>
 




More information about the embjopr-commits mailing list