private CompletionStage<ConfigTypeNode> getNode(final String id, final String lang, final Function<String, String> placeholderProvider) { return id.isEmpty() // todo: drop that hardcoded datastore string ? CompletableFuture .completedFuture(new ConfigTypeNode("datastore", 0, null, "datastore", "datastore", "datastore", emptySet(), new ArrayList<>(), new ArrayList<>())) : configurationClient.getDetails(lang, id, placeholderProvider); }
@ApiOperation(value = "Return a form description ( Ui Spec ) without a specific configuration ", response = Nodes.class, produces = "application/json", tags = { "form", "ui spec", "configurations", "datastore", "dataset" }, responseHeaders = { @ResponseHeader(name = HEADER_TALEND_COMPONENT_SERVER_ERROR, description = ERROR_HEADER_DESC, response = Boolean.class) }) @GET @Path("form/initial/{type}") public CompletionStage<UiNode> getInitialForm(@PathParam("type") final String type, @Context final HttpServletRequest request) { if (type == null || type.isEmpty()) { throw new WebApplicationException(Response .status(Response.Status.BAD_REQUEST) .entity(new ProxyErrorPayload(ProxyErrorDictionary.BAD_CONFIGURATION_TYPE.name(), "No configuration type passed")) .type(APPLICATION_JSON_TYPE) .build()); } final String language = getLang(request); final Function<String, String> placeholderProvider = placeholderProviderFactory.newProvider(request); return toUiSpecAndMetadata(language, placeholderProvider, CompletableFuture .completedFuture(new ConfigTypeNode(type, 0, null, type, type, type, emptySet(), new ArrayList<>(), new ArrayList<>())), true); }
public ConfigTypeNode enrich(final ConfigTypeNode node, final String lang) { return doEnrich(node.getConfigurationType(), lang, patch -> { final ConfigTypeNode copy = new ConfigTypeNode(node.getId(), node.getVersion(), node.getParentId(), node.getConfigurationType(), node.getName(), node.getDisplayName(), node.getEdges(), new ArrayList<>(), new ArrayList<>(node.getActions())); patch.doPatchProperties(copy.getProperties(), node.getProperties()); patch.appendBuiltInActions(copy.getActions()); return copy; }).orElse(node); }
final ConfigTypeNode node = new ConfigTypeNode(); node.setId(family.getId()); node.setName(family.getMeta().getName());
final Stream<ConfigTypeNode> configNode; if (idFilter.test(c.getId())) { final ConfigTypeNode node = new ConfigTypeNode(); node.setId(c.getId()); node.setVersion(c.getVersion());
public CompletionStage<ConfigTypeNode> filterNestedConfigurations(final String family, final ConfigTypeNode node, final UiSpecContext context) { return propertiesService .filterProperties(family, node.getProperties(), context) .thenApply(props -> new ConfigTypeNode(node.getId(), node.getVersion(), node.getParentId(), node.getConfigurationType(), node.getName(), node.getDisplayName(), node.getEdges(), props, node.getActions())); }