use of org.jboss.hal.meta.AddressTemplate in project console by hal.
the class ClusteringPresenter method addBridge.
void addBridge(ServerSubResource ssr) {
Metadata metadata = metadataRegistry.lookup(ssr.template);
NameItem nameItem = new NameItem();
Form<ModelNode> form = new ModelNodeForm.Builder<>(Ids.build(ssr.baseId, Ids.ADD), metadata).unboundFormItem(nameItem, 0).fromRequestProperties().include(QUEUE_NAME, DISCOVERY_GROUP, STATIC_CONNECTORS).unsorted().build();
List<AddressTemplate> templates = asList(SELECTED_SERVER_TEMPLATE.append(CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(IN_VM_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(HTTP_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(REMOTE_CONNECTOR + EQ_WILDCARD));
form.getFormItem(DISCOVERY_GROUP).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, SELECTED_SERVER_TEMPLATE.append(DISCOVERY_GROUP + EQ_WILDCARD)));
form.getFormItem(STATIC_CONNECTORS).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, templates));
new AddResourceDialog(resources.messages().addResourceTitle(ssr.type), form, (name, model) -> {
name = nameItem.getValue();
ResourceAddress address = SELECTED_SERVER_TEMPLATE.append(ssr.resource + "=" + name).resolve(statementContext);
crud.add(ssr.type, name, address, model, (n, a) -> reload());
}).show();
}
use of org.jboss.hal.meta.AddressTemplate in project console by hal.
the class ClusteringPresenter method addBroadcastGroup.
// Include JGROUPS_CLUSTER and SOCKET_BINDING fields in the Add form, as one of these fields is required.
void addBroadcastGroup(ServerSubResource ssr) {
List<AddressTemplate> templates = asList(SELECTED_SERVER_TEMPLATE.append(CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(IN_VM_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(HTTP_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(REMOTE_CONNECTOR + EQ_WILDCARD));
showBroadcastOrDiscoveryGroupAddDialog(ssr, formBuilderAugmentor -> {
formBuilderAugmentor.include(CONNECTORS);
}, formAugmentor -> {
formAugmentor.getFormItem(CONNECTORS).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, templates));
});
}
use of org.jboss.hal.meta.AddressTemplate in project console by hal.
the class ConnectionPresenter method addPooledConnectionFactory.
void addPooledConnectionFactory(ServerSubResource ssr) {
Metadata metadata = metadataRegistry.lookup(ssr.template);
NameItem nameItem = new NameItem();
Form<ModelNode> form = new ModelNodeForm.Builder<>(Ids.build(ssr.baseId, Ids.ADD), metadata).unboundFormItem(nameItem, 0).fromRequestProperties().include("entries", DISCOVERY_GROUP, CONNECTORS).unsorted().build();
List<AddressTemplate> templates = asList(SELECTED_SERVER_TEMPLATE.append(CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(IN_VM_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(HTTP_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(REMOTE_CONNECTOR + EQ_WILDCARD));
form.getFormItem(DISCOVERY_GROUP).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, SELECTED_SERVER_TEMPLATE.append(DISCOVERY_GROUP + EQ_WILDCARD)));
form.getFormItem(CONNECTORS).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, templates));
new AddResourceDialog(resources.messages().addResourceTitle(ssr.type), form, (name, model) -> {
name = nameItem.getValue();
ResourceAddress address = SELECTED_SERVER_TEMPLATE.append(ssr.resource + EQ + name).resolve(statementContext);
crud.add(ssr.type, name, address, model, (n, a) -> reload());
}).show();
}
use of org.jboss.hal.meta.AddressTemplate in project console by hal.
the class ConnectionView method setPresenter.
@Override
public void setPresenter(ConnectionPresenter presenter) {
super.setPresenter(presenter);
// register the suggestion handlers here rather than in a @PostConstruct method
// they need a valid presenter reference!
List<AddressTemplate> templates = asList(SELECTED_SERVER_TEMPLATE.append(CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(IN_VM_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(HTTP_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(REMOTE_CONNECTOR + EQ_WILDCARD));
connectionFactoryForm.getFormItem(CONNECTORS).registerSuggestHandler(new ReadChildrenAutoComplete(mbuiContext.dispatcher(), presenter.statementContext, templates));
pooledConnectionFactoryForm.getFormItem(CONNECTORS).registerSuggestHandler(new ReadChildrenAutoComplete(mbuiContext.dispatcher(), presenter.statementContext, templates));
}
use of org.jboss.hal.meta.AddressTemplate in project console by hal.
the class StoreElement method tableForm.
private Form<ModelNode> tableForm(CacheType cacheType, Store store, Table table, MetadataRegistry metadataRegistry) {
AddressTemplate template = cacheType.template.append(STORE + "=" + store.resource).append(TABLE + "=" + table.resource);
Metadata metadata = metadataRegistry.lookup(template);
String id = Ids.build(cacheType.baseId, store.baseId, table.baseId, Ids.FORM);
return new ModelNodeForm.Builder<>(id, metadata).include(PREFIX).customFormItem(ID_COLUMN, ad -> new ColumnFormItem(ID_COLUMN)).customFormItem(DATA_COLUMN, ad -> new ColumnFormItem(DATA_COLUMN)).customFormItem(TIMESTAMP_COLUMN, ad -> new ColumnFormItem(TIMESTAMP_COLUMN)).include(BATCH_SIZE, FETCH_SIZE).unsorted().onSave((f, changedValues) -> presenter.saveTable(table, changedValues)).prepareReset(f -> presenter.resetTable(table, f)).build();
}
Aggregations