Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SWITCHYARD-1152 update as7 console to 1.4.0.Final

  • Loading branch information...
commit 449331f4809450294d6bf9f45f07061f2db6b23f 1 parent 0a7550a
@rcernich rcernich authored
View
6 app/pom.xml
@@ -50,6 +50,12 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>console-spi</artifactId>
+ <classifier>sources</classifier>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
View
1  app/src/main/java/org/switchyard/console/application/App.gwt.xml
@@ -19,7 +19,6 @@
<module rename-to="app">
- <inherits name="org.jboss.as.console.App" />
<inherits name="org.switchyard.console.SwitchYard" />
<set-configuration-property name="gin.ginjector"
View
4 app/src/main/java/org/switchyard/console/application/client/AggregatedConsoleGinjector.java
@@ -18,7 +18,7 @@
*/
package org.switchyard.console.application.client;
-import org.jboss.as.console.client.core.gin.CoreUI;
+import org.jboss.as.console.client.core.gin.Composite;
import org.switchyard.console.client.gin.SwitchYardGinjector;
/**
@@ -29,6 +29,6 @@
*
* @author Rob Cernich
*/
-public interface AggregatedConsoleGinjector extends CoreUI, SwitchYardGinjector {
+public interface AggregatedConsoleGinjector extends Composite, SwitchYardGinjector {
}
View
6 app/src/main/java/org/switchyard/console/application/client/AggregatedConsoleSingleton.java
@@ -18,7 +18,7 @@
*/
package org.switchyard.console.application.client;
-import org.jboss.as.console.client.core.gin.CoreUI;
+import org.jboss.as.console.client.core.gin.Composite;
import org.jboss.as.console.client.core.gin.GinjectorSingleton;
import com.google.gwt.core.client.GWT;
@@ -32,10 +32,10 @@
*/
public class AggregatedConsoleSingleton implements GinjectorSingleton {
- private static final CoreUI INSTANCE = GWT.create(AggregatedConsoleGinjector.class);
+ private static final Composite INSTANCE = GWT.create(AggregatedConsoleGinjector.class);
@Override
- public CoreUI getCoreUI() {
+ public Composite getCoreUI() {
return INSTANCE;
}
View
6 as7-core/pom.xml
@@ -37,6 +37,10 @@
</properties>
<dependencies>
<dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>console-spi</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.ballroom</groupId>
<artifactId>widgets</artifactId>
</dependency>
@@ -101,7 +105,7 @@
<version>${version.jbossas.console}</version>
<classifier>sources</classifier>
<type>jar</type>
- <excludes>org/jboss/as/console/client/Console.java,org/jboss/as/console/client/shared/SubsystemMetaData.java,org/jboss/as/console/client/domain/runtime/DomainRuntimeNavigation.java,org/jboss/as/console/client/standalone/runtime/StandaloneRuntimeNavigation.java,org/jboss/dmr/client/DataInput.java,org/jboss/dmr/client/IEEE754.java,org/jboss/as/console/client/shared/runtime/plain/PlainColumnView.java,META-INF/*.SF,META-INF/*.RSA,META-INF/*.DSA</excludes>
+ <excludes>org/jboss/as/console/client/Console.java,org/jboss/as/console/client/shared/SubsystemMetaData.java,org/jboss/as/console/client/domain/runtime/DomainRuntimeNavigation.java,org/jboss/as/console/client/standalone/runtime/StandaloneRuntimeNavigation.java,org/jboss/dmr/client/DataInput.java,org/jboss/dmr/client/IEEE754.java,org/jboss/as/console/client/shared/runtime/plain/PlainColumnView.java,META-INF/*.SF,META-INF/*.RSA,META-INF/*.DSA,apt/**</excludes>
<outputDirectory>${asConsoleIncludesDirectory}/java</outputDirectory>
</artifactItem>
</artifactItems>
View
116 as7-core/src/main/java/org/jboss/as/console/client/Console.java
@@ -24,14 +24,16 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.RunAsyncCallback;
import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
import com.gwtplatform.mvp.client.DelayedBindRegistry;
+import com.gwtplatform.mvp.client.proxy.PlaceManager;
+import org.jboss.as.console.client.core.BootstrapContext;
import org.jboss.as.console.client.core.LoadingPanel;
import org.jboss.as.console.client.core.UIConstants;
import org.jboss.as.console.client.core.UIDebugConstants;
@@ -41,13 +43,16 @@
import org.jboss.as.console.client.core.bootstrap.EagerLoadProfiles;
import org.jboss.as.console.client.core.bootstrap.ExecutionMode;
import org.jboss.as.console.client.core.bootstrap.LoadMainApp;
+import org.jboss.as.console.client.core.bootstrap.RegisterSubsystems;
import org.jboss.as.console.client.core.bootstrap.RemoveLoadingPanel;
-import org.jboss.as.console.client.core.gin.CoreUI;
+import org.jboss.as.console.client.core.gin.Composite;
import org.jboss.as.console.client.core.gin.GinjectorSingleton;
import org.jboss.as.console.client.core.message.Message;
+import org.jboss.as.console.client.core.message.MessageCenter;
+import org.jboss.as.console.client.plugins.SubsystemRegistry;
+import org.jboss.as.console.client.shared.help.HelpSystem;
import java.util.EnumSet;
-
/**
* Main application entry point.
* Executes a two phased init process:
@@ -60,15 +65,11 @@
*/
public class Console implements EntryPoint {
- /** The MODULES. */
- public final static CoreUI MODULES = GWT.<GinjectorSingleton>create(GinjectorSingleton.class).getCoreUI();
- /** The CONSTANTS. */
+ public final static Composite MODULES = GWT.<GinjectorSingleton>create(GinjectorSingleton.class).getCoreUI();
public final static UIConstants CONSTANTS = GWT.create(UIConstants.class);
- /** The MESSAGES. */
public final static UIDebugConstants DEBUG_CONSTANTS = GWT.create(UIDebugConstants.class);
public final static UIMessages MESSAGES = GWT.create(UIMessages.class);
- @Override
public void onModuleLoad() {
// Defer all application initialisation code to onModuleLoad2() so that the
// UncaughtExceptionHandler can catch any unexpected exceptions.
@@ -82,10 +83,11 @@ public void execute() {
});
}
- /**
- */
public void onModuleLoad2() {
+ // load console css bundle
+ ConsoleResources.INSTANCE.css().ensureInjected();
+
// display the loading panel
final Widget loadingPanel = new LoadingPanel().asWidget();
RootLayoutPanel.get().add(loadingPanel);
@@ -99,11 +101,12 @@ public void onSuccess() {
DelayedBindRegistry.bind(MODULES);
// ordered bootstrap
- BootstrapProcess bootstrap = new BootstrapProcess();
+ final BootstrapProcess bootstrap = new BootstrapProcess();
bootstrap.addHook(new ExecutionMode(MODULES.getBootstrapContext(), MODULES.getDispatchAsync()));
+ bootstrap.addHook(new RegisterSubsystems(MODULES.getSubsystemRegistry()));
bootstrap.addHook(new ChoseProcessor(MODULES.getBootstrapContext()));
- bootstrap.addHook(new EagerLoadProfiles());
+ bootstrap.addHook(new EagerLoadProfiles(MODULES.getProfileStore(), MODULES.getCurrentSelectedProfile()));
bootstrap.addHook(new RemoveLoadingPanel(loadingPanel));
bootstrap.addHook(new LoadMainApp(MODULES.getBootstrapContext(), MODULES.getPlaceManager(), MODULES.getTokenFormatter()));
@@ -123,7 +126,11 @@ public void onSuccess(Boolean wasSuccessfull) {
// currently we only deal with authentication errors
RootLayoutPanel.get().remove(loadingPanel);
- HTMLPanel explanation = new HTMLPanel("<center><div style='padding-top:150px;'>The web console could not be loaded. Please refresh this page to start over.</div></center>");
+ String cause = "";
+ if(MODULES.getBootstrapContext().getLastError()!=null)
+ cause = MODULES.getBootstrapContext().getLastError().getMessage();
+
+ HTMLPanel explanation = new HTMLPanel("<center><div style='padding-top:150px;'><h2>The web console could not be loaded.</h2>"+cause+"</div></center>");
RootLayoutPanel.get().add(explanation);
}
@@ -134,82 +141,53 @@ public void onSuccess(Boolean wasSuccessfull) {
});
}
- /**
- * @param message the message
- */
public static void info(String message) {
- MODULES.getMessageCenter().notify(
+ getMessageCenter().notify(
new Message(message, Message.Severity.Info)
);
}
- /**
- * @param message the message
- */
public static void error(String message) {
- MODULES.getMessageCenter().notify(
+ getMessageCenter().notify(
new Message(message, Message.Severity.Error)
);
}
- /**
- * @param message the message
- * @param detail details
- */
public static void error(String message, String detail) {
- MODULES.getMessageCenter().notify(
+ getMessageCenter().notify(
new Message(message, detail, Message.Severity.Error)
);
}
- /**
- * @param message the message
- */
public static void warning(String message) {
- MODULES.getMessageCenter().notify(
+ getMessageCenter().notify(
new Message(message, Message.Severity.Warning)
);
}
- /**
- * @param message the message
- * @param sticky is it sticky
- */
public static void warning(String message, boolean sticky) {
Message msg = sticky ?
new Message(message, Message.Severity.Warning, EnumSet.of(Message.Option.Sticky)) :
new Message(message, Message.Severity.Warning);
- MODULES.getMessageCenter().notify(msg);
+ getMessageCenter().notify(msg);
}
- /**
- * @param message the message
- * @param detail details
- * @param sticky is it sticky
- */
public static void warning(String message, String detail, boolean sticky) {
Message msg = sticky ?
new Message(message, detail, Message.Severity.Warning, EnumSet.of(Message.Option.Sticky)) :
new Message(message, detail, Message.Severity.Warning);
- MODULES.getMessageCenter().notify(msg);
+ getMessageCenter().notify(msg);
}
- /**
- * @param message the message
- * @param detail details
- */
public static void warning(String message, String detail) {
- MODULES.getMessageCenter().notify(
+ getMessageCenter().notify(
new Message(message, detail, Message.Severity.Warning)
);
}
- /**
- * @param cmd the command
- */
public static void schedule(final Command cmd)
{
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@@ -220,14 +198,38 @@ public void execute() {
});
}
- /**
- * @return true if vis api is loaded.
- */
+ public static EventBus getEventBus() {
+ return MODULES.getEventBus();
+ }
+
+ public static MessageCenter getMessageCenter() {
+ return MODULES.getMessageCenter();
+ }
+
+ public static PlaceManager getPlaceManager() {
+ return MODULES.getPlaceManager();
+ }
+
+ public static BootstrapContext getBootstrapContext()
+ {
+ return MODULES.getBootstrapContext();
+ }
+
+ public static HelpSystem getHelpSystem() {
+ return MODULES.getHelpSystem();
+ }
+
+
+ @Deprecated
public static native boolean visAPILoaded() /*-{
-if ($wnd['google'] && $wnd.google['load']) {
-return true;
-}
-return false;
-}-*/;
+ if ($wnd['google'] && $wnd.google['load']) {
+ return true;
+ }
+ return false;
+ }-*/;
+
+ public static SubsystemRegistry getSubsystemRegistry() {
+ return MODULES.getSubsystemRegistry();
+ }
}
View
4 as7-core/src/main/java/org/jboss/as/console/client/core/gin/CoreUISingleton.java
@@ -30,10 +30,10 @@
*/
public class CoreUISingleton implements GinjectorSingleton {
- private static final CoreUI INSTANCE = GWT.create(CoreUI.class);
+ private static final Composite INSTANCE = GWT.create(Composite.class);
@Override
- public CoreUI getCoreUI() {
+ public Composite getCoreUI() {
return INSTANCE;
}
View
2  as7-core/src/main/java/org/jboss/as/console/client/core/gin/GinjectorSingleton.java
@@ -47,5 +47,5 @@
/**
* @return the CoreUI Ginjector.
*/
- CoreUI getCoreUI();
+ Composite getCoreUI();
}
View
96 as7-core/src/main/java/org/jboss/as/console/client/domain/runtime/DomainRuntimeNavigation.java
@@ -1,8 +1,7 @@
package org.jboss.as.console.client.domain.runtime;
-import com.google.gwt.user.client.ui.DisclosurePanel;
+import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import org.jboss.as.console.client.Console;
@@ -15,9 +14,11 @@
import org.jboss.as.console.client.widgets.nav.Predicate;
import org.jboss.ballroom.client.layout.LHSNavTree;
import org.jboss.ballroom.client.layout.LHSNavTreeItem;
-import org.jboss.ballroom.client.widgets.stack.DisclosureStackPanel;
+import org.jboss.ballroom.client.layout.LHSTreeSection;
+import org.jboss.ballroom.client.widgets.forms.ComboBox;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
/**
@@ -34,10 +35,10 @@
private List<Predicate> metricPredicates = new ArrayList<Predicate>();
private List<Predicate> runtimePredicates = new ArrayList<Predicate>();
- private LHSNavTree metricTree;
- private LHSNavTree runtimeTree;
-
private ScrollPanel scroll;
+ private LHSNavTree navigation;
+ private LHSTreeSection metricLeaf;
+ private LHSTreeSection runtimeLeaf;
public Widget asWidget()
{
@@ -55,74 +56,72 @@ public Widget asWidget()
// ----------------------------------------------------
+ navigation = new LHSNavTree("domain-runtime");
+ navigation.getElement().setAttribute("aria-label", "Profile Tasks");
+
+ //Tree statusTree = new LHSNavTree("domain-runtime");
+
+ LHSTreeSection domainLeaf = new LHSTreeSection("Domain");
+ navigation.addItem(domainLeaf);
- Tree statusTree = new LHSNavTree("domain-runtime");
- LHSNavTreeItem serverInstances=
- new LHSNavTreeItem(Console.CONSTANTS.common_label_serverInstances(), NameTokens.InstancesPresenter);
+ //domainLeaf.addItem(new LHSNavTreeItem("Overview", ""));
+ LHSNavTreeItem serverInstances= new LHSNavTreeItem(Console.CONSTANTS.common_label_serverInstances(), NameTokens.InstancesPresenter);
+ domainLeaf.addItem(serverInstances);
+ domainLeaf.addItem(serverInstances);
- LHSNavTreeItem jvm = new LHSNavTreeItem("JVM Status", NameTokens.HostVMMetricPresenter);
+ domainLeaf.addItem(new LHSNavTreeItem("Manage Deployments", NameTokens.DeploymentsPresenter));
- statusTree.addItem(serverInstances);
- statusTree.addItem(jvm);
- DisclosurePanel statusPanel = new DisclosureStackPanel("Domain Status").asWidget();
- statusPanel.setContent(statusTree);
- stack.add(statusPanel);
+ //DisclosurePanel statusPanel = new DisclosureStackPanel("Domain Status").asWidget();
+ //statusPanel.setContent(statusTree);
+ //stack.add(statusPanel);
// -------------
- metricTree = new LHSNavTree("domain-runtime");
+ metricLeaf = new LHSTreeSection("Server Status");
+ navigation.addItem(metricLeaf);
LHSNavTreeItem datasources = new LHSNavTreeItem("Datasources", NameTokens.DataSourceMetricPresenter);
LHSNavTreeItem jmsQueues = new LHSNavTreeItem("JMS Destinations", NameTokens.JmsMetricPresenter);
LHSNavTreeItem web = new LHSNavTreeItem("Web", NameTokens.WebMetricPresenter);
LHSNavTreeItem tx = new LHSNavTreeItem("Transactions", NameTokens.TXMetrics);
LHSNavTreeItem jpa = new LHSNavTreeItem("JPA", NameTokens.JPAMetricPresenter);
+ LHSNavTreeItem naming = new LHSNavTreeItem("JNDI View", NameTokens.JndiPresenter);
+
metricPredicates.add(new Predicate("datasources", datasources));
metricPredicates.add(new Predicate("messaging", jmsQueues));
metricPredicates.add(new Predicate("web", web));
metricPredicates.add(new Predicate("transactions", tx));
metricPredicates.add(new Predicate("jpa", jpa));
-
- metricPredicates.addAll(SubsystemMetaData.getRuntimeMetricsExtensions());
+ metricPredicates.add(new Predicate("naming", naming));
- DisclosurePanel metricPanel = new DisclosureStackPanel("Subsystem Metrics").asWidget();
- metricPanel.setContent(metricTree);
- stack.add(metricPanel);
+ // BEGIN: SwitchYard additions
+ metricPredicates.addAll(SubsystemMetaData.getRuntimeMetricsExtensions());
+ // END: SwitchYard additions
// ---
- runtimeTree = new LHSNavTree("domain-runtime");
-
+ runtimeLeaf = new LHSTreeSection("Runtime Operations");
+ navigation.addItem(runtimeLeaf);
LHSNavTreeItem osgi = new LHSNavTreeItem("OSGi", NameTokens.OSGiRuntimePresenter);
-
runtimePredicates.add(new Predicate("osgi", osgi));
+ // BEGIN: SwitchYard additions
runtimePredicates.addAll(SubsystemMetaData.getRuntimeOperationsExtensions());
-
- DisclosurePanel runtimeOpPanel = new DisclosureStackPanel("Runtime Operations").asWidget();
- runtimeOpPanel.setContent(runtimeTree);
- stack.add(runtimeOpPanel);
-
+ // END: SwitchYard additions
// ----------------------------------------------------
- Tree deploymentTree = new LHSNavTree("domain-runtime");
- DisclosurePanel deploymentPanel = new DisclosureStackPanel("Deployments").asWidget();
- deploymentPanel.setContent(deploymentTree);
-
- deploymentTree.addItem(new LHSNavTreeItem("Manage Deployments", NameTokens.DeploymentsPresenter));
- deploymentTree.addItem(new LHSNavTreeItem("Webservices", NameTokens.WebServiceRuntimePresenter));
+ navigation.expandTopLevel();
- stack.add(deploymentPanel);
+ stack.add(navigation);
layout.add(stack);
-
scroll = new ScrollPanel(layout);
return scroll;
@@ -142,37 +141,34 @@ public void setServer(List<ServerInstance> server) {
public void setSubsystems(List<SubsystemRecord> subsystems) {
- metricTree.removeItems();
- runtimeTree.removeItems();
+ metricLeaf.removeItems();
+ runtimeLeaf.removeItems();
+
+ LHSNavTreeItem jvm = new LHSNavTreeItem("JVM", NameTokens.HostVMMetricPresenter);
+ metricLeaf.addItem(jvm);
// match subsystems
for(SubsystemRecord subsys : subsystems)
{
- //System.out.println(subsys.getKey());
-
for(Predicate predicate : metricPredicates)
{
if(predicate.matches(subsys.getKey()))
- metricTree.addItem(predicate.getNavItem());
+ metricLeaf.addItem(predicate.getNavItem());
}
for(Predicate predicate : runtimePredicates)
{
if(predicate.matches(subsys.getKey()))
- runtimeTree.addItem(predicate.getNavItem());
+ runtimeLeaf.addItem(predicate.getNavItem());
}
}
- }
-
+ final LHSNavTreeItem webservices = new LHSNavTreeItem("Webservices", NameTokens.WebServiceRuntimePresenter);
+ metricLeaf.addItem(webservices);
- public void clearSelection() {
- serverPicker.clearSelection();
- }
+ navigation.expandTopLevel();
- public void setSelectedServer(String hostName, ServerInstance server) {
- serverPicker.setSelected(server, true);
}
}
View
65 as7-core/src/main/java/org/jboss/as/console/client/shared/SubsystemMetaData.java
@@ -19,21 +19,25 @@
package org.jboss.as.console.client.shared;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
import org.jboss.as.console.client.Console;
import org.jboss.as.console.client.core.NameTokens;
+import org.jboss.as.console.client.plugins.SubsystemExtension;
+import org.jboss.as.console.client.plugins.SubsystemRegistry;
import org.jboss.as.console.client.shared.model.SubsystemRecord;
import org.jboss.as.console.client.widgets.nav.Predicate;
import com.google.gwt.core.client.GWT;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
/**
* @author Heiko Braun
* @date 3/29/11
*/
+@Deprecated
public class SubsystemMetaData {
static Map<String, SubsystemGroup> groups = new LinkedHashMap<String, SubsystemGroup>();
@@ -48,14 +52,10 @@
private static final String CONTAINER = "Container";
- private static final String EJB = "EJB";
-
private static final String OSGI = "OSGi";
private static final String INFINISPAN = "Infinispan";
- private static final String MODCLUSTER = "Modcluster";
-
private static final String SECURITY = "Security";
private static final String WEB = "Web";
@@ -85,9 +85,9 @@
groups.get(WEB).getItems().add(new SubsystemGroupItem("Servlet/HTTP", "web"));
groups.get(WEB).getItems().add(new SubsystemGroupItem("Web Services", "webservices"));
groups.get(WEB).getItems().add(new SubsystemGroupItem("JAXRS", "jaxrs",Boolean.TRUE));
- groups.get(WEB).getItems().add(new SubsystemGroupItem("Modcluster", "modcluster",NameTokens.ModclusterPresenter));
+ groups.get(WEB).getItems().add(new SubsystemGroupItem("mod_cluster", "modcluster", NameTokens.ModclusterPresenter));
- groups.get(MESSAGING).getItems().add(new SubsystemGroupItem("Messaging Provider", "messaging"));
+ groups.get(MESSAGING).getItems().add(new SubsystemGroupItem("Destinations", "messaging"));
groups.get(CORE).getItems().add(new SubsystemGroupItem("Threads", "threads", Boolean.TRUE));
groups.get(CORE).getItems().add(new SubsystemGroupItem("Logging", "logging"));
@@ -95,13 +95,13 @@
groups.get(CORE).getItems().add(new SubsystemGroupItem("Remoting", "remoting",Boolean.TRUE));
groups.get(CORE).getItems().add(new SubsystemGroupItem("Threads", NameTokens.BoundedQueueThreadPoolPresenter));
groups.get(CORE).getItems().add(new SubsystemGroupItem("JMX", "jmx"));
- groups.get(CORE).getItems().add(new SubsystemGroupItem("Config Admin Service", NameTokens.ConfigAdminPresenter));
+ groups.get(CORE).getItems().add(new SubsystemGroupItem("Config Admin", NameTokens.ConfigAdminPresenter));
groups.get(CORE).getItems().add(new SubsystemGroupItem("JGroups", NameTokens.JGroupsPresenter));
- groups.get(CONTAINER).getItems().add(new SubsystemGroupItem("Naming", "naming", !Console.MODULES.getBootstrapContext().isStandalone()));
+ groups.get(CONTAINER).getItems().add(new SubsystemGroupItem("Naming", "naming", !Console.getBootstrapContext().isStandalone()));
groups.get(CONTAINER).getItems().add(new SubsystemGroupItem("EJB 3", "ejb3"));
groups.get(CONTAINER).getItems().add(new SubsystemGroupItem("EE", "ee"));
- groups.get(CONTAINER).getItems().add(new SubsystemGroupItem("Transactions", "transactions"));
+ //groups.get(CONTAINER).getItems().add(new SubsystemGroupItem("Transactions", "transactions"));
groups.get(CONTAINER).getItems().add(new SubsystemGroupItem("Weld", "weld",Boolean.TRUE));
groups.get(CONTAINER).getItems().add(new SubsystemGroupItem("JPA", "jpa"));
groups.get(CONTAINER).getItems().add(new SubsystemGroupItem("JacORB", "jacorb"));
@@ -120,12 +120,36 @@
groups.get(OTHER).getItems().add(new SubsystemGroupItem("SAR", "sar",Boolean.TRUE));
groups.get(OTHER).getItems().add(new SubsystemGroupItem("Arquillian", "arquillian",Boolean.TRUE));
+
SubsystemExtensionProcessor extensionProcessor = GWT.create(SubsystemExtensionProcessor.class);
extensionProcessor.processProfileExtensions(groups);
runtimeMetricsExtensions = extensionProcessor.getRuntimeMetricsExtensions();
runtimeOperationsExtensions = extensionProcessor.getRuntimeOperationsExtensions();
}
+ public static void bootstrap(SubsystemRegistry registry) {
+
+ List<SubsystemExtension> defaults = new ArrayList<SubsystemExtension>();
+
+ for(String groupName : groups.keySet())
+ {
+ SubsystemGroup group = groups.get(groupName);
+ for(SubsystemGroupItem item : group.getItems())
+ {
+ if(!item.isDisabled())
+ {
+ defaults.add(new SubsystemExtension(
+ item.getName(), item.getPresenter(),
+ group.getName(), item.getKey())
+ );
+ }
+ }
+ }
+
+ registry.getExtensions().addAll(defaults);
+
+ }
+
public static Map<String, SubsystemGroup> getGroups() {
return groups;
}
@@ -197,7 +221,18 @@ public static SubsystemGroup getGroupForKey(String subsysKey)
public static String[] resolveTokens(String key) {
String[] token = new String[2];
- for(String groupName : groups.keySet())
+ final SubsystemRegistry subsystemRegistry = Console.MODULES.getSubsystemRegistry();
+ for(SubsystemExtension ext : subsystemRegistry.getExtensions())
+ {
+ if(ext.getKey().equals(key))
+ {
+ token[0] = ext.getName();
+ token[1] = ext.getToken();
+ break;
+ }
+ }
+
+ /*for(String groupName : groups.keySet())
{
SubsystemGroup group = groups.get(groupName);
for(SubsystemGroupItem item : group.getItems())
@@ -210,7 +245,7 @@ public static SubsystemGroup getGroupForKey(String subsysKey)
break;
}
}
- }
+ } */
return token;
}
View
4 as7-core/src/main/java/org/jboss/as/console/client/shared/runtime/plain/PlainColumnView.java
@@ -117,8 +117,6 @@ public Widget asWidget() {
grid.getCellFormatter().setWidth(0, 2, "50%");
- layout.add(grid);
-
if(null==staticHelp && address!=null)
{
MetricHelpPanel helpPanel = new MetricHelpPanel(address, this.columns);
@@ -130,6 +128,8 @@ else if(staticHelp!=null)
layout.add(staticHelp.asWidget());
}
+ layout.add(grid);
+
return layout;
}
View
83 as7-core/src/main/java/org/jboss/as/console/client/standalone/runtime/StandaloneRuntimeNavigation.java
@@ -1,17 +1,16 @@
package org.jboss.as.console.client.standalone.runtime;
-import com.google.gwt.user.client.ui.DisclosurePanel;
import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import org.jboss.as.console.client.core.NameTokens;
import org.jboss.as.console.client.shared.SubsystemMetaData;
import org.jboss.as.console.client.shared.model.SubsystemRecord;
import org.jboss.as.console.client.widgets.nav.Predicate;
+import org.jboss.ballroom.client.layout.LHSTreeSection;
import org.jboss.ballroom.client.layout.LHSNavTree;
import org.jboss.ballroom.client.layout.LHSNavTreeItem;
-import org.jboss.ballroom.client.widgets.stack.DisclosureStackPanel;
import java.util.ArrayList;
import java.util.List;
@@ -24,17 +23,16 @@
private VerticalPanel stack;
private VerticalPanel layout;
- private LHSNavTree subsysTree;
- private List<SubsystemRecord> subsystems;
+ private List<SubsystemRecord> subsystems;
private List<Predicate> metricPredicates = new ArrayList<Predicate>();
private List<Predicate> runtimePredicates = new ArrayList<Predicate>();
- private LHSNavTree metricTree;
- private LHSNavTree runtimeOpTree;
-
private ScrollPanel scroll;
+ private TreeItem metricLeaf;
+ private TreeItem runtimeLeaf;
+ private LHSNavTree navigation;
public Widget asWidget()
{
@@ -46,105 +44,106 @@ public Widget asWidget()
// ----------------------------------------------------
- subsysTree = new LHSNavTree("standalone-runtime");
+ navigation = new LHSNavTree("standalone-runtime");
+ navigation.getElement().setAttribute("aria-label", "Runtime Tasks");
// ----------------------------------------------------
- LHSNavTree statusTree = new LHSNavTree("standalone-runtime");
-
-
+ TreeItem serverLeaf = new LHSTreeSection("Server", true);
LHSNavTreeItem server = new LHSNavTreeItem("Configuration", NameTokens.StandaloneServerPresenter);
- LHSNavTreeItem jvmItem = new LHSNavTreeItem("JVM", NameTokens.VirtualMachine);
- statusTree.addItem(server);
- statusTree.addItem(jvmItem);
- DisclosurePanel serverPanel = new DisclosureStackPanel("Server Status", true).asWidget();
- serverPanel.setContent(statusTree);
- stack.add(serverPanel);
+ serverLeaf.addItem(server);
+ serverLeaf.addItem(new LHSNavTreeItem("Manage Deployments", NameTokens.DeploymentListPresenter));
+ navigation.addItem(serverLeaf);
// -------------
- metricTree = new LHSNavTree("standalone-runtime");
+ metricLeaf = new LHSTreeSection("Status");
+
LHSNavTreeItem datasources = new LHSNavTreeItem("Datasources", "ds-metrics");
LHSNavTreeItem jmsQueues = new LHSNavTreeItem("JMS Destinations", "jms-metrics");
LHSNavTreeItem web = new LHSNavTreeItem("Web", "web-metrics");
LHSNavTreeItem tx = new LHSNavTreeItem("Transactions", "tx-metrics");
LHSNavTreeItem jpa = new LHSNavTreeItem("JPA", NameTokens.JPAMetricPresenter);
+ LHSNavTreeItem ws = new LHSNavTreeItem("Webservices", NameTokens.WebServiceRuntimePresenter);
+ LHSNavTreeItem naming = new LHSNavTreeItem("JNDI View", NameTokens.JndiPresenter);
metricPredicates.add(new Predicate("datasources", datasources));
metricPredicates.add(new Predicate("messaging", jmsQueues));
metricPredicates.add(new Predicate("web", web));
metricPredicates.add(new Predicate("transactions", tx));
metricPredicates.add(new Predicate("jpa", jpa));
+ metricPredicates.add(new Predicate("webservices", ws));
+ metricPredicates.add(new Predicate("naming", naming));
+ // BEGIN: SwitchYard additions
metricPredicates.addAll(SubsystemMetaData.getRuntimeMetricsExtensions());
+ // END: SwitchYard additions
+
+ navigation.addItem(metricLeaf);
- DisclosurePanel metricPanel = new DisclosureStackPanel("Subsystem Metrics").asWidget();
- metricPanel.setContent(metricTree);
- stack.add(metricPanel);
// ---
- runtimeOpTree = new LHSNavTree("standalone-runtime");
+ runtimeLeaf = new LHSTreeSection("Runtime Operations");
+
LHSNavTreeItem osgi = new LHSNavTreeItem("OSGi", NameTokens.OSGiRuntimePresenter);
runtimePredicates.add(new Predicate("osgi", osgi));
+ // BEGIN: SwitchYard additions
runtimePredicates.addAll(SubsystemMetaData.getRuntimeOperationsExtensions());
+ // END: SwitchYard additions
- DisclosurePanel runtimeOpPanel = new DisclosureStackPanel("Runtime Operations").asWidget();
- runtimeOpPanel.setContent(runtimeOpTree);
- stack.add(runtimeOpPanel);
+ navigation.addItem(runtimeLeaf);
// ----------------------------------------------------
- Tree deploymentTree = new LHSNavTree("standalone-runtime");
- DisclosurePanel deploymentPanel = new DisclosureStackPanel("Deployments").asWidget();
- deploymentPanel.setContent(deploymentTree);
-
- deploymentTree.addItem(new LHSNavTreeItem("Manage Deployments", NameTokens.DeploymentListPresenter));
- deploymentTree.addItem(new LHSNavTreeItem("Webservices", NameTokens.WebServiceRuntimePresenter));
-
- stack.add(deploymentPanel);
-
// ---
-
+ stack.add(navigation);
layout.add(stack);
scroll = new ScrollPanel(layout);
+ navigation.expandTopLevel();
+
return scroll;
}
+
+
public void setSubsystems(List<SubsystemRecord> subsystems) {
- metricTree.removeItems();
- runtimeOpTree.removeItems();
+ metricLeaf.removeItems();
+ runtimeLeaf.removeItems();
+ metricLeaf.addItem( new LHSNavTreeItem("JVM", NameTokens.VirtualMachine));
// match subsystems
for(SubsystemRecord subsys : subsystems)
{
- //System.out.println(subsys.getKey());
-
for(Predicate predicate : metricPredicates)
{
if(predicate.matches(subsys.getKey()))
- metricTree.addItem(predicate.getNavItem());
+ metricLeaf.addItem(predicate.getNavItem());
}
for(Predicate predicate : runtimePredicates)
{
if(predicate.matches(subsys.getKey()))
- runtimeOpTree.addItem(predicate.getNavItem());
+ runtimeLeaf.addItem(predicate.getNavItem());
}
}
+ navigation.expandTopLevel();
+
}
+
+
}
View
2  gwt/src/main/java/org/switchyard/console/SwitchYard.gwt.xml
@@ -19,8 +19,8 @@
<module rename-to="SwitchYard">
- <inherits name="org.jboss.as.console.App" />
<inherits name="org.switchyard.console.Extensions" />
+ <inherits name="org.jboss.as.console.App" />
<!-- Specify the paths for translatable code -->
<source path='client' />
Please sign in to comment.
Something went wrong with that request. Please try again.