test_class.declarator: actionContext
test_class.modifier: private
test_class.original_string: private ActionContext actionContext;
test_class.type: ActionContext
test_class.var_name: actionContext
test_class.declarator: xmlActions
test_class.modifier: private
test_class.original_string: private XMLActions xmlActions;
test_class.type: XMLActions
test_class.var_name: xmlActions
test_class.file: BackEnd/Core/sailfish-core/src/test/java/com/exactpro/sf/actions/TestXMLActions.java
test_class.identifier: TestXMLActions
test_class.superclass: extends AbstractTest
test_case.body: @Test
      public void test() {
          HashMap<String, String> settings = new HashMap<>();
          settings.put(XMLActions.TEMPLATE, "TestSimpleTemplate");
          settings.put("msgType", "AddOrder");
          settings.put("valueField", "ToMapping");
          HashMap<?, ?> hashMap = xmlActions.generateDocument(actionContext, settings);
          Assert.assertEquals(getDocument("TestSimpleTemplateFinal"), hashMap.get(XMLActions.OUT));
      }
test_case.class_method_signature: TestXMLActions.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: put put put generateDocument assertEquals getDocument get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.declarator: TEMPLATE = "Template"
focal_class.modifier: public static final
focal_class.original_string: public static final String TEMPLATE = "Template";
focal_class.type: String
focal_class.var_name: TEMPLATE
focal_class.declarator: OUT = "Content"
focal_class.modifier: public static final
focal_class.original_string: public static final String OUT = "Content";
focal_class.type: String
focal_class.var_name: OUT
focal_class.file: BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/actions/XMLActions.java
focal_class.identifier: XMLActions
focal_class.class_method_signature: XMLActions.generateDocument(IActionContext actionContext, HashMap<?, ?> inputData)
focal_class.full_signature: @Description("The generated XML will available by this reference in field `Content`<br>" + "Example:<br/>" + "#{ref.Content}") @CustomColumns( @CustomColumn(value = TEMPLATE, required = true) ) @ActionMethod public HashMap<?, ?> generateDocument(IActionContext actionContext, HashMap<?, ?> inputData)
focal_class.identifier: generateDocument
focal_class.modifiers: @Description("The generated XML will available by this reference in field `Content`<br>" + "Example:<br/>" + "#{ref.Content}") @CustomColumns( @CustomColumn(value = TEMPLATE, required = true) ) @ActionMethod public
focal_class.parameters: (IActionContext actionContext, HashMap<?, ?> inputData)
focal_class.return: HashMap<?, ?>
focal_class.signature: HashMap<?, ?> generateDocument(IActionContext actionContext, HashMap<?, ?> inputData)
focal_class.superclass: extends AbstractCaller
focal_method.body: @Description("The generated XML will available by this reference in field `Content`<br>" +
              "Example:<br/>" +
              "#{ref.Content}")
      @CustomColumns(
              @CustomColumn(value = TEMPLATE, required = true)
      )
      @ActionMethod
      public HashMap<?, ?> generateDocument(IActionContext actionContext, HashMap<?, ?> inputData) {
          inputData = unwrapFilters(inputData);
          String templateAlias = Objects.requireNonNull((String) inputData.remove(TEMPLATE), "'template' parameter");
  
          IDataManager dataManager = actionContext.getDataManager();
          try (InputStream dataInputStream = dataManager.getDataInputStream(SailfishURI.parse(templateAlias))) {
              StringTemplateLoader stringLoader = new StringTemplateLoader();
              stringLoader.putTemplate(TEMPLATE, IOUtils.toString(dataInputStream, StandardCharsets.UTF_8));
  
              Configuration cfg = new Configuration(Configuration.VERSION_2_3_27);
              cfg.setTemplateLoader(stringLoader);
  
              Template temp = cfg.getTemplate(TEMPLATE);
              try (Writer out = new StringWriter()) {
  
                  temp.process(inputData, out);
  
                  HashMap<String, String> result = new HashMap<>();
                  result.put(OUT, out.toString());
                  return result;
              }
          } catch (Exception e) {
              throw new EPSCommonException(e);
          }
      }
focal_method.class_method_signature: XMLActions.generateDocument(IActionContext actionContext, HashMap<?, ?> inputData)
focal_method.full_signature: @Description("The generated XML will available by this reference in field `Content`<br>" + "Example:<br/>" + "#{ref.Content}") @CustomColumns( @CustomColumn(value = TEMPLATE, required = true) ) @ActionMethod public HashMap<?, ?> generateDocument(IActionContext actionContext, HashMap<?, ?> inputData)
focal_method.identifier: generateDocument
focal_method.invocations: unwrapFilters requireNonNull remove getDataManager getDataInputStream parse putTemplate toString setTemplateLoader getTemplate process put toString
focal_method.modifiers: @Description("The generated XML will available by this reference in field `Content`<br>" + "Example:<br/>" + "#{ref.Content}") @CustomColumns( @CustomColumn(value = TEMPLATE, required = true) ) @ActionMethod public
focal_method.parameters: (IActionContext actionContext, HashMap<?, ?> inputData)
focal_method.return: HashMap<?, ?>
focal_method.signature: HashMap<?, ?> generateDocument(IActionContext actionContext, HashMap<?, ?> inputData)