.ifPresent(displayName -> declarer.withDisplayModel(DisplayModel.builder().displayName(displayName.value()).build()));
private DisplayModel getDisplayModel(ComponentModel componentModel) { final DisplayModel.DisplayModelBuilder displayModelBuilder = DisplayModel.builder(); displayModelBuilder.displayName(componentModel.getParameters().get(DISPLAY_NAME_ATTRIBUTE)); displayModelBuilder.summary(componentModel.getParameters().get(SUMMARY_ATTRIBUTE)); displayModelBuilder.example(componentModel.getParameters().get(EXAMPLE_ATTRIBUTE)); return displayModelBuilder.build(); }
.ifPresent(displayName -> declarer.withDisplayModel(DisplayModel.builder().displayName(displayName.value()).build()));
.describedAs(TARGET_VALUE_PARAMETER_DESCRIPTION) .withRole(BEHAVIOUR) .withDisplayModel(DisplayModel.builder().displayName(TARGET_VALUE_PARAMETER_DISPLAY_NAME).build()) .withLayout(LayoutModel.builder().tabName(ADVANCED_TAB).build()) .withModelProperty(new TargetModelProperty());
.displayName(displayName) .summary(summary) .example(example) .path(pathModel) .classValue(classValueModel) .build());
private void declareConfigurationProperties(ExtensionDeclarer extensionDeclarer, ClassTypeLoader typeLoader) { ConstructDeclarer configuration = extensionDeclarer.withConstruct("configurationProperties") .allowingTopLevelDefinition() .withStereotype(APP_CONFIG) .describedAs("References a file with configuration properties. Each property has a key and a value. \n" + "The key can be referenced from the mule configuration files using the following semantics: \n" + "${key_name}. This allows to externalize configuration and change it based\n" + "on the environment the application is being deployed to."); configuration.onDefaultParameterGroup() .withRequiredParameter("file") .ofType(typeLoader.load(String.class)) .withExpressionSupport(NOT_SUPPORTED) .withDisplayModel(DisplayModel.builder().path(new PathModel(FILE, false, EMBEDDED, new String[] {"properties"})).build()) .describedAs(" The location of the file with the configuration properties to use. " + "It may be a location in the classpath or an absolute location. The file location\n" + " value may also contains references to properties that will only be resolved based on " + "system properties or properties set at deployment time."); }
.withLayout(getLayout(3)) .withDisplayModel(DisplayModel.builder() .summary("The XML body to include in the SOAP message, with all the required parameters.") .build()); .withLayout(getLayout(4)) .withDisplayModel(DisplayModel.builder() .displayName(HEADERS_DISPLAY_NAME) .summary("The XML headers to include in the SOAP message.") .build()); .withLayout(getLayout(5)) .withDisplayModel(DisplayModel.builder() .summary("The attachments to include in the SOAP request.") .build()); .withLayout(LayoutModel.builder().order(2).tabName(TRANSPORT).build()) .withDisplayModel(DisplayModel.builder() .displayName(HEADERS_DISPLAY_NAME) .summary("The headers to set in the transport configuration.") .build());
/** * Declares a new connection provider for a configuration given a {@link SoapServiceProviderWrapper} declaration. * * @param configDeclarer the configuration declarer that will own the provider * @param provider a {@link SoapServiceProviderWrapper} that describes the {@link SoapServiceProvider} Type. * @param hasCustomTransports if declares custom transport or not. */ public void declare(ConfigurationDeclarer configDeclarer, SoapServiceProviderWrapper provider, boolean hasCustomTransports) { String description = provider.getDescription(); // Declares the Service Provider as a Connection Provider. ConnectionProviderDeclarer providerDeclarer = configDeclarer.withConnectionProvider(provider.getAlias()) .describedAs(description) .withModelProperty(new ConnectionTypeModelProperty(ForwardingSoapClient.class)) //TODO - MULE-14311 - Make loader work in compile time .withModelProperty(new ImplementingTypeModelProperty(provider.getDeclaringClass().get())) .withConnectionManagementType(POOLING) .supportsConnectivityTesting(provider.supportsConnectivityTesting()); ParameterDeclarationContext context = new ParameterDeclarationContext("Service Provider", providerDeclarer.getDeclaration()); parametersLoader.declare(providerDeclarer, provider.getParameters(), context); if (hasCustomTransports) { providerDeclarer.onParameterGroup(TRANSPORT_GROUP) .withRequiredParameter(TRANSPORT_PARAM) .withDisplayModel(DisplayModel.builder().displayName(TRANSPORT_GROUP).build()) .ofType(typeLoader.load(MessageDispatcherProvider.class)) .withLayout(LayoutModel.builder().order(1).tabName(TRANSPORT).build()) .withExpressionSupport(NOT_SUPPORTED); } }
.displayName(displayName) .summary(summary) .example(example) .path(pathModel) .classValue(classValueModel) .build());