JIRA Fixes #40

Merged
merged 3 commits into from Nov 20, 2012
Jump to file or symbol
Failed to load files and symbols.
+169 −38
Diff settings

Always

Just for now

View
@@ -22,7 +22,7 @@
</description>
<properties>
- <ballroom.version>1.5.1.Final</ballroom.version>
+ <ballroom.version>1.5.2-SNAPSHOT</ballroom.version>
<gwt.version>2.5.0-rc2</gwt.version>
<gwtp.version>0.7</gwtp.version>
<gwt.maven>2.5.0-rc2</gwt.maven>
@@ -27,6 +27,7 @@
import org.jboss.dmr.client.ModelDescriptionConstants;
import org.jboss.dmr.client.ModelNode;
+import java.util.Iterator;
import java.util.List;
/**
@@ -75,7 +76,19 @@ public String getValue(Queue object) {
com.google.gwt.user.cellview.client.Column<Queue, String> protocolColumn = new com.google.gwt.user.cellview.client.Column<Queue, String>(new TextCell()) {
@Override
public String getValue(Queue object) {
- return object.getJndiName();
+ List<String> names = object.getEntries();
+ StringBuilder builder = new StringBuilder();
+ if (!names.isEmpty())
+ {
+ Iterator<String> iterator = names.iterator();
+ builder.append("[").append(iterator.next());
+ if (iterator.hasNext())
+ {
+ builder.append(", ...");
+ }
+ builder.append("]");
+ }
+ return builder.toString();
}
};
@@ -27,6 +27,7 @@
import org.jboss.dmr.client.ModelDescriptionConstants;
import org.jboss.dmr.client.ModelNode;
+import java.util.Iterator;
import java.util.List;
/**
@@ -75,7 +76,19 @@ public String getValue(JMSEndpoint object) {
com.google.gwt.user.cellview.client.Column<JMSEndpoint, String> protocolColumn = new com.google.gwt.user.cellview.client.Column<JMSEndpoint, String>(new TextCell()) {
@Override
public String getValue(JMSEndpoint object) {
- return object.getJndiName();
+ List<String> names = object.getEntries();
+ StringBuilder builder = new StringBuilder();
+ if (!names.isEmpty())
+ {
+ Iterator<String> iterator = names.iterator();
+ builder.append("[").append(iterator.next());
+ if (iterator.hasNext())
+ {
+ builder.append(", ...");
+ }
+ builder.append("]");
+ }
+ return builder.toString();
}
};
@@ -24,6 +24,9 @@
import org.jboss.as.console.client.shared.subsys.messaging.model.JMSEndpoint;
import org.jboss.ballroom.client.widgets.tables.DefaultCellTable;
+import java.util.Iterator;
+import java.util.List;
+
/**
* @author Heiko Braun
* @date 3/29/11
@@ -34,7 +37,7 @@ public EndpointTable() {
super(8, new ProvidesKey<JMSEndpoint>() {
@Override
public Object getKey(JMSEndpoint item) {
- return item.getJndiName();
+ return item.getEntries();
}
});
@@ -48,7 +51,19 @@ public String getValue(JMSEndpoint record) {
TextColumn<JMSEndpoint> jndiNameColumn = new TextColumn<JMSEndpoint>() {
@Override
public String getValue(JMSEndpoint record) {
- return record.getJndiName();
+ List<String> names = record.getEntries();
+ StringBuilder builder = new StringBuilder();
+ if (!names.isEmpty())
+ {
+ Iterator<String> iterator = names.iterator();
+ builder.append("[").append(iterator.next());
+ if (iterator.hasNext())
+ {
+ builder.append(", ...");
+ }
+ builder.append("]");
+ }
+ return builder.toString();
}
};
@@ -125,8 +125,13 @@ public void onSuccess(DMRResponse result) {
queue.setName(prop.getName());
ModelNode propValue = prop.getValue();
- String jndi = propValue.get("entries").asList().get(0).asString();
- queue.setJndiName(jndi);
+ List<ModelNode> entires = propValue.get("entries").asList();
+ List<String> values = new ArrayList<String>(entires.size());
+ for (ModelNode entry : entires)
+ {
+ values.add(entry.asString());
+ }
+ queue.setEntries(values);
if(propValue.hasDefined("durable"))
queue.setDurable(propValue.get("durable").asBoolean());
@@ -154,9 +159,13 @@ public void onSuccess(DMRResponse result) {
JMSEndpoint topic = factory.topic().as();
topic.setName(prop.getName());
- ModelNode propValue = prop.getValue();
- String jndi = propValue.get("entries").asList().get(0).asString();
- topic.setJndiName(jndi);
+ List<ModelNode> entires = prop.getValue().get("entries").asList();
+ List<String> values = new ArrayList<String>(entires.size());
+ for (ModelNode entry : entires)
+ {
+ values.add(entry.asString());
+ }
+ topic.setEntries(values);
topics.add(topic);
}
@@ -21,11 +21,11 @@
import com.google.gwt.event.logical.shared.CloseEvent;
import com.google.gwt.event.logical.shared.CloseHandler;
-import com.google.web.bindery.event.shared.EventBus;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.inject.Inject;
+import com.google.web.bindery.event.shared.EventBus;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.View;
import com.gwtplatform.mvp.client.annotations.NameToken;
@@ -45,7 +45,6 @@
import org.jboss.as.console.client.shared.model.ResponseWrapper;
import org.jboss.as.console.client.shared.subsys.Baseadress;
import org.jboss.as.console.client.shared.subsys.RevealStrategy;
-import org.jboss.as.console.client.shared.subsys.messaging.connections.MsgConnectionsPresenter;
import org.jboss.as.console.client.shared.subsys.messaging.model.AddressingPattern;
import org.jboss.as.console.client.shared.subsys.messaging.model.ConnectionFactory;
import org.jboss.as.console.client.shared.subsys.messaging.model.Divert;
@@ -92,6 +91,8 @@
private LoadJMSCmd loadJMSCmd;
private EntityAdapter<ConnectionFactory> factoryAdapter;
private EntityAdapter<Divert> divertAdapter;
+ private EntityAdapter<Queue> queueAdapter;
+ private EntityAdapter<Topic> topicAdapter;
@ProxyCodeSplit
@@ -160,9 +161,10 @@ public MsgDestinationsPresenter(
propertyMetaData
);
-
factoryAdapter = new EntityAdapter<ConnectionFactory>(ConnectionFactory.class, metaData);
divertAdapter = new EntityAdapter<Divert>(Divert.class, metaData);
+ queueAdapter = new EntityAdapter<Queue>(Queue.class, metaData);
+ topicAdapter = new EntityAdapter<Topic>(Topic.class, metaData);
this.loadJMSCmd = new LoadJMSCmd(dispatcher, factory, metaData);
}
@@ -662,7 +664,6 @@ public void onSaveQueue(final String name, Map<String, Object> changedValues) {
if(changedValues.isEmpty()) return;
ModelNode proto = new ModelNode();
- proto.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
proto.get(ADDRESS).set(Baseadress.get());
proto.get(ADDRESS).add("subsystem", "messaging");
proto.get(ADDRESS).add("hornetq-server", getCurrentServer());
@@ -672,11 +673,15 @@ public void onSaveQueue(final String name, Map<String, Object> changedValues) {
//if(changedValues.containsKey("selector") && changedValues.get("selector").equals(""))
// changedValues.put("selector", "undefined");
- List<PropertyBinding> bindings = metaData.getBindingsForType(Queue.class);
- ModelNode operation = ModelAdapter.detypedFromChangeset(proto, changedValues, bindings);
-
+ ModelNode operation = queueAdapter.fromChangeset(changedValues, proto);
dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {
+ @Override
+ public void onFailure(final Throwable caught)
+ {
+ caught.printStackTrace();
+ }
+
@Override
public void onSuccess(DMRResponse result) {
ModelNode response = result.get();
@@ -703,9 +708,14 @@ public void onCreateQueue(final Queue entity) {
queue.get(ADDRESS).add("hornetq-server", getCurrentServer());
queue.get(ADDRESS).add("jms-queue", entity.getName());
- queue.get("entries").setEmptyList();
- queue.get("entries").add(entity.getJndiName());
-
+ List<String> jndiNames = entity.getEntries();
+ if (jndiNames != null)
+ {
+ for (String jndiName : jndiNames)
+ {
+ queue.get("entries").add(jndiName);
+ }
+ }
queue.get("durable").set(entity.isDurable());
if(entity.getSelector()!=null && !entity.getSelector().equals(""))
@@ -812,15 +822,12 @@ public void onSaveTopic(final String name, Map<String, Object> changedValues) {
if(changedValues.isEmpty()) return;
ModelNode proto = new ModelNode();
- proto.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
proto.get(ADDRESS).set(Baseadress.get());
proto.get(ADDRESS).add("subsystem", "messaging");
proto.get(ADDRESS).add("hornetq-server", getCurrentServer());
proto.get(ADDRESS).add("jms-topic", name);
- List<PropertyBinding> bindings = metaData.getBindingsForType(Topic.class);
- ModelNode operation = ModelAdapter.detypedFromChangeset(proto, changedValues, bindings);
-
+ ModelNode operation = topicAdapter.fromChangeset(changedValues, proto);
dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {
@Override
@@ -870,8 +877,14 @@ public void onCreateTopic(final JMSEndpoint entity) {
topic.get(ADDRESS).add("hornetq-server", getCurrentServer());
topic.get(ADDRESS).add("jms-topic", entity.getName());
- topic.get("entries").setEmptyList();
- topic.get("entries").add(entity.getJndiName());
+ List<String> jndiNames = entity.getEntries();
+ if (jndiNames != null)
+ {
+ for (String jndiName : jndiNames)
+ {
+ topic.get("entries").add(jndiName);
+ }
+ }
dispatcher.execute(new DMRAction(topic), new SimpleCallback<DMRResponse>() {
@@ -26,10 +26,11 @@
import org.jboss.as.console.client.shared.help.FormHelpPanel;
import org.jboss.as.console.client.shared.subsys.Baseadress;
import org.jboss.as.console.client.shared.subsys.messaging.model.Queue;
-import org.jboss.as.console.client.widgets.forms.items.JndiNameItem;
+import org.jboss.as.console.client.widgets.forms.items.JndiNamesItem;
import org.jboss.ballroom.client.widgets.forms.CheckBoxItem;
import org.jboss.ballroom.client.widgets.forms.Form;
import org.jboss.ballroom.client.widgets.forms.FormValidation;
+import org.jboss.ballroom.client.widgets.forms.ListItem;
import org.jboss.ballroom.client.widgets.forms.TextBoxItem;
import org.jboss.ballroom.client.widgets.window.DialogueOptions;
import org.jboss.ballroom.client.widgets.window.WindowContentBuilder;
@@ -54,9 +55,10 @@ Widget asWidget() {
TextBoxItem name = new TextBoxItem("name", "Name");
- TextBoxItem jndiName = new JndiNameItem("jndiName", "JNDI Name");
+ ListItem jndiName = new JndiNamesItem("entries", "JNDI Names");
CheckBoxItem durable = new CheckBoxItem("durable", "Durable?");
+ durable.setValue(true); // new queues are durable by default (AS7-4955)
TextBoxItem selector = new TextBoxItem("selector", "Selector")
{
@Override
@@ -26,9 +26,10 @@
import org.jboss.as.console.client.shared.help.FormHelpPanel;
import org.jboss.as.console.client.shared.subsys.Baseadress;
import org.jboss.as.console.client.shared.subsys.messaging.model.Topic;
-import org.jboss.as.console.client.widgets.forms.items.JndiNameItem;
+import org.jboss.as.console.client.widgets.forms.items.JndiNamesItem;
import org.jboss.ballroom.client.widgets.forms.Form;
import org.jboss.ballroom.client.widgets.forms.FormValidation;
+import org.jboss.ballroom.client.widgets.forms.ListItem;
import org.jboss.ballroom.client.widgets.forms.TextBoxItem;
import org.jboss.ballroom.client.widgets.window.DialogueOptions;
import org.jboss.ballroom.client.widgets.window.WindowContentBuilder;
@@ -51,9 +52,8 @@ Widget asWidget() {
layout.setStyleName("window-content");
final Form<Topic> form = new Form<Topic>(Topic.class);
-
TextBoxItem name = new TextBoxItem("name", "Name");
- TextBoxItem jndiName = new JndiNameItem("jndiName", "JNDI Name");
+ ListItem jndiName = new JndiNamesItem("entries", "JNDI Names");
form.setFields(name, jndiName);
@@ -31,8 +31,10 @@
import org.jboss.as.console.client.shared.subsys.Baseadress;
import org.jboss.as.console.client.shared.subsys.messaging.model.Queue;
import org.jboss.as.console.client.widgets.forms.FormToolStrip;
+import org.jboss.as.console.client.widgets.forms.items.JndiNamesItem;
import org.jboss.ballroom.client.widgets.forms.CheckBoxItem;
import org.jboss.ballroom.client.widgets.forms.Form;
+import org.jboss.ballroom.client.widgets.forms.ListItem;
import org.jboss.ballroom.client.widgets.forms.TextBoxItem;
import org.jboss.ballroom.client.widgets.forms.TextItem;
import org.jboss.ballroom.client.widgets.tables.DefaultCellTable;
@@ -41,6 +43,7 @@
import org.jboss.ballroom.client.widgets.window.Feedback;
import org.jboss.dmr.client.ModelNode;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -117,7 +120,7 @@ public void onConfirmation(boolean isConfirmed) {
queueTable = new DefaultCellTable<Queue>(8, new ProvidesKey<Queue>() {
@Override
public Object getKey(Queue item) {
- return item.getJndiName();
+ return item.getEntries();
}
});
queueProvider = new ListDataProvider<Queue>();
@@ -133,7 +136,19 @@ public String getValue(Queue record) {
TextColumn<Queue> jndiNameColumn = new TextColumn<Queue>() {
@Override
public String getValue(Queue record) {
- return record.getJndiName();
+ List<String> names = record.getEntries();
+ StringBuilder builder = new StringBuilder();
+ if (!names.isEmpty())
+ {
+ Iterator<String> iterator = names.iterator();
+ builder.append("[").append(iterator.next());
+ if (iterator.hasNext())
+ {
+ builder.append(", ...");
+ }
+ builder.append("]");
+ }
+ return builder.toString();
}
};
@@ -146,7 +161,7 @@ public String getValue(Queue record) {
// ----
TextItem name = new TextItem("name", "Name");
- TextItem jndi = new TextItem("jndiName", "JNDI");
+ ListItem jndi = new JndiNamesItem("entries", "JNDI Names");
CheckBoxItem durable = new CheckBoxItem("durable", "Durable?");
TextBoxItem selector = new TextBoxItem("selector", "Selector") {
@@ -28,7 +28,9 @@
import org.jboss.as.console.client.shared.subsys.messaging.model.JMSEndpoint;
import org.jboss.as.console.client.shared.subsys.messaging.model.Topic;
import org.jboss.as.console.client.widgets.forms.FormToolStrip;
+import org.jboss.as.console.client.widgets.forms.items.JndiNamesItem;
import org.jboss.ballroom.client.widgets.forms.Form;
+import org.jboss.ballroom.client.widgets.forms.ListItem;
import org.jboss.ballroom.client.widgets.forms.TextItem;
import org.jboss.ballroom.client.widgets.tools.ToolButton;
import org.jboss.ballroom.client.widgets.tools.ToolStrip;
@@ -120,7 +122,7 @@ public void onConfirmation(boolean isConfirmed) {
// -----
TextItem name = new TextItem("name", "Name");
- TextItem jndi = new TextItem("jndiName", "JNDI");
+ ListItem jndi = new JndiNamesItem("entries", "JNDI Names");
form.setFields(name, jndi);
Oops, something went wrong.