requestInstantiateTemplateRequestEntity.setEncodingVersion(requestedTemplate.getEncodingVersion()); requestInstantiateTemplateRequestEntity.setSnippet(requestTemplateContents);
/** * Creates a TemplateDTO from the specified template. * * @param template template * @return dto */ public TemplateDTO createTemplateDTO(final Template template) { if (template == null) { return null; } final TemplateDTO original = template.getDetails(); final TemplateDTO copy = new TemplateDTO(); copy.setId(original.getId()); copy.setGroupId(template.getProcessGroup().getIdentifier()); copy.setName(original.getName()); copy.setDescription(original.getDescription()); copy.setTimestamp(original.getTimestamp()); copy.setUri(original.getUri()); copy.setEncodingVersion(original.getEncodingVersion()); return copy; }
public static ConfigSchema transformTemplateToSchema(InputStream source) throws JAXBException, IOException { try { TemplateDTO templateDTO = (TemplateDTO) JAXBContext.newInstance(TemplateDTO.class).createUnmarshaller().unmarshal(source); FlowSnippetDTOEnricher enricher = new FlowSnippetDTOEnricher(); enricher.enrich(templateDTO.getSnippet(), templateDTO.getEncodingVersion()); ConfigSchema configSchema = new ConfigSchemaFunction().apply(templateDTO); return configSchema; } finally { source.close(); } }
public static ConfigSchema transformTemplateToSchema(InputStream source) throws JAXBException, IOException { try { TemplateDTO templateDTO = (TemplateDTO) JAXBContext.newInstance(TemplateDTO.class).createUnmarshaller().unmarshal(source); FlowSnippetDTOEnricher enricher = new FlowSnippetDTOEnricher(); enricher.enrich(templateDTO.getSnippet(), templateDTO.getEncodingVersion()); ConfigSchema configSchema = new ConfigSchemaFunction().apply(templateDTO); return configSchema; } finally { source.close(); } }