[jboss-svn-commits] JBL Code SVN: r7710 - in labs/jbossesb/trunk/product/console: src/org/jboss/soa/esb/admin/console src/org/jboss/soa/esb/admin/console/transform view/transform

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Nov 19 11:33:11 EST 2006


Author: tfennelly
Date: 2006-11-19 11:33:08 -0500 (Sun, 19 Nov 2006)
New Revision: 7710

Added:
   labs/jbossesb/trunk/product/console/src/org/jboss/soa/esb/admin/console/Toggle.java
Modified:
   labs/jbossesb/trunk/product/console/src/org/jboss/soa/esb/admin/console/transform/ManageResources.java
   labs/jbossesb/trunk/product/console/view/transform/list-resources.xhtml
Log:
Added "Show All" and "Narrow List" functionality on the Manage Resources screen.  This makes it a lot easier to understand what resources are targeted directly at the message flow.

Added: labs/jbossesb/trunk/product/console/src/org/jboss/soa/esb/admin/console/Toggle.java
===================================================================
--- labs/jbossesb/trunk/product/console/src/org/jboss/soa/esb/admin/console/Toggle.java	2006-11-19 16:10:57 UTC (rev 7709)
+++ labs/jbossesb/trunk/product/console/src/org/jboss/soa/esb/admin/console/Toggle.java	2006-11-19 16:33:08 UTC (rev 7710)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.admin.console;
+
+import org.jboss.seam.annotations.Name;
+
+/**
+ * Simple toggle component.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+ at Name("toggle")
+public class Toggle {
+
+	private boolean on;
+
+	/**
+	 * Is the toggle on/off.
+	 * @return Returns the on.
+	 */
+	public boolean isOn() {
+		return on;
+	}
+
+	/**
+	 * Set the toggle on/off.
+	 * @param on The on to set.
+	 */
+	public void setOn(boolean on) {
+		this.on = on;
+	}
+}

Modified: labs/jbossesb/trunk/product/console/src/org/jboss/soa/esb/admin/console/transform/ManageResources.java
===================================================================
--- labs/jbossesb/trunk/product/console/src/org/jboss/soa/esb/admin/console/transform/ManageResources.java	2006-11-19 16:10:57 UTC (rev 7709)
+++ labs/jbossesb/trunk/product/console/src/org/jboss/soa/esb/admin/console/transform/ManageResources.java	2006-11-19 16:33:08 UTC (rev 7710)
@@ -22,10 +22,9 @@
 package org.jboss.soa.esb.admin.console.transform;
 
 import static org.jboss.seam.ScopeType.CONVERSATION;
-import static org.jboss.seam.ScopeType.EVENT;
 
 import java.io.Serializable;
-import java.util.Arrays;
+import java.util.Iterator;
 import java.util.List;
 
 import org.hibernate.Session;
@@ -38,6 +37,7 @@
 import org.jboss.seam.annotations.Scope;
 import org.jboss.seam.annotations.datamodel.DataModel;
 import org.jboss.seam.annotations.datamodel.DataModelSelectionIndex;
+import org.jboss.soa.esb.admin.console.Toggle;
 import org.jboss.soa.esb.admin.console.transform.flow.MessageFlow;
 import org.jboss.soa.esb.admin.console.transform.flow.MessageFlowSelected;
 
@@ -62,6 +62,9 @@
 	@DataModelSelectionIndex("messageFlowConfigs")
 	int messageFlowConfigIndex = 0;
 	
+	@In(required=false) @Out(scope=CONVERSATION)
+	private Toggle showAll;
+	
 	@In(required=false) @Out(required=false,scope=CONVERSATION)
 	private TransformationResource selectedConfig;
 	
@@ -70,10 +73,18 @@
 	
 	@Begin(join=true)
 	public String list() {
+		if(showAll == null) {
+			showAll = new Toggle();
+		}
 		initialise();
 		
 		return "list-resources";
 	}
+	
+	public void toggleShowAll() {
+		showAll.setOn(!showAll.isOn());
+		initialise();
+	}
 
 	public String viewConfiguration() {
 		selectedConfig = messageFlowConfigs.get(messageFlowConfigIndex);
@@ -109,6 +120,15 @@
 		
 		// Filter and sort the resource configs for the selected message flow (for display)...
 		messageFlowConfigs = SmooksUtils.getMessageFlowConfigs(messageFlow, allResourceConfigs);
+		if(!showAll.isOn()) {
+			Iterator<TransformationResource> listIterator = messageFlowConfigs.iterator();
+			while(listIterator.hasNext()) {
+				TransformationResource resource = listIterator.next();
+				if(!resource.getUseragent().equalsIgnoreCase(messageFlow.getFlowUseragentString())) {
+					listIterator.remove();
+				}
+			}
+		}
 		
 		// Clear the selected configuration.
 		selectedConfig = null;

Modified: labs/jbossesb/trunk/product/console/view/transform/list-resources.xhtml
===================================================================
--- labs/jbossesb/trunk/product/console/view/transform/list-resources.xhtml	2006-11-19 16:10:57 UTC (rev 7709)
+++ labs/jbossesb/trunk/product/console/view/transform/list-resources.xhtml	2006-11-19 16:33:08 UTC (rev 7710)
@@ -24,23 +24,28 @@
 				</div>
 			</div>
 			<div class="section">
-		    <h:outputText value="There are no Resource Configurations targeted at the current Message Flow!" rendered="#{messageFlowConfigs != null and messageFlowConfigs.rowCount==0}"/>
-		    <h:dataTable value="#{messageFlowConfigs}" var="configSelection" rendered="#{messageFlowConfigs.rowCount>0}">
-		        <h:column>
-		            <f:facet name="header">Execution Selector</f:facet>
-				    #{configSelection.selector}
-		        </h:column>
-		        <h:column>
-		            <f:facet name="header">Applied Resource</f:facet>
-				    #{configSelection.path}
-		        </h:column>
-		        <h:column>
-		            <f:facet name="header">Manage</f:facet>
-				    <h:commandLink action="#{manageResources.viewConfiguration}">View</h:commandLink>
-				    <f:verbatim>|</f:verbatim>
-				    <h:commandLink action="#{manageResources.deleteConfiguration}">Delete</h:commandLink>
-		        </h:column>
-		    </h:dataTable>
+			    <h:commandLink action="#{manageResources.toggleShowAll}">
+				    <h:outputText value="Show All" rendered="#{!showAll.on}"/>
+				    <h:outputText value="Narrow List" rendered="#{showAll.on}"/>
+			    </h:commandLink>
+				<br/>
+			    <h:outputText value='There are no Resource Configurations targeted directly at the current Message Flow.  Click "Show All" to see resources that are targeted indirectly.' rendered="#{messageFlowConfigs != null and messageFlowConfigs.rowCount==0}"/>
+			    <h:dataTable value="#{messageFlowConfigs}" var="configSelection" rendered="#{messageFlowConfigs.rowCount>0}">
+			        <h:column>
+			            <f:facet name="header">Execution Selector</f:facet>
+					    #{configSelection.selector}
+			        </h:column>
+			        <h:column>
+			            <f:facet name="header">Applied Resource</f:facet>
+					    #{configSelection.path}
+			        </h:column>
+			        <h:column>
+			            <f:facet name="header">Manage</f:facet>
+					    <h:commandLink action="#{manageResources.viewConfiguration}">View</h:commandLink>
+					    <f:verbatim>|</f:verbatim>
+					    <h:commandLink action="#{manageResources.deleteConfiguration}">Delete</h:commandLink>
+			        </h:column>
+			    </h:dataTable>
 			</div>
 		</h:form>
 		<h:form>			




More information about the jboss-svn-commits mailing list