@Override protected void fillXML(final Document document, final Element xmlRequest, final Request theRequest) { super.fillXML(document, xmlRequest, theRequest); final PostSubmitFormRequest postSubmitFormRequest = (PostSubmitFormRequest)theRequest; xmlRequest.setAttribute(XML_ATTR_LINKEXTRACTORTYPE, ACTION_LINKEXTRACTOR_TYPE_MATCH_DEFINITION); xmlRequest.setAttribute(XML_ATTR_EXTRACTORPATH, theRequest.getPath().orElse(theRequest.getName())); xmlRequest.setAttribute(XML_ATTR_CONF_FORM_EXTRACTOR_PARAMETERS, buildConfFormExtractorParameters(postSubmitFormRequest)); final Element recordHtmlInfos = document.createElement(XML_TAG_RECORD_HTML_INFOS); recordHtmlInfos.setAttribute(XML_ATTR_EXTRACTOR_REGEXP, "false"); recordHtmlInfos.setAttribute(XML_ATTR_EXTRACTOR_OCCURENCE, "1"); recordHtmlInfos.setAttribute(XML_ATTR_HTML_TYPE, "2"); xmlRequest.appendChild(recordHtmlInfos); final Element extractorHtmlInfos = document.createElement(XML_TAG_EXTRACTOR_HTML_INFOS); extractorHtmlInfos.setAttribute(XML_ATTR_EXTRACTOR_REGEXP, "false"); extractorHtmlInfos.setAttribute(XML_ATTR_EXTRACTOR_OCCURENCE, "1"); extractorHtmlInfos.setAttribute(XML_ATTR_HTML_TYPE, "2"); xmlRequest.appendChild(extractorHtmlInfos); final Request referer = postSubmitFormRequest.getReferer(); xmlRequest.setAttribute(XML_ATTR_REFERER_UID, WriterUtils.getElementUid(referer)); theRequest.getServer().ifPresent(server -> xmlRequest.setAttribute(XML_ATTR_SERV_UID, server.getName())); theRequest.getServer().ifPresent(server -> xmlRequest.setAttribute(XML_ATTR_EXTRACTOR_SERVER_UID, server.getName())); }
@Override protected void fillXML(final Document document, final Element xmlRequest, final Request theRequest) { super.fillXML(document, xmlRequest, theRequest); final GetFollowLinkRequest getFollowLinkRequest = (GetFollowLinkRequest)theRequest; xmlRequest.setAttribute(XML_ATTR_LINKEXTRACTORTYPE, ACTION_LINKEXTRACTOR_TYPE_MATCHCONTENT); xmlRequest.setAttribute(XML_ATTR_EXTRACTORPATH, theRequest.getPath().orElse(theRequest.getName())); final Element recordHtmlInfos = document.createElement(XML_TAG_RECORD_HTML_INFOS); recordHtmlInfos.setAttribute(XML_ATTR_EXTRACTOR_CONTENT, getFollowLinkRequest.getText()); recordHtmlInfos.setAttribute(XML_ATTR_EXTRACTOR_OCCURENCE, "1"); recordHtmlInfos.setAttribute(XML_ATTR_HTML_TYPE, "1"); xmlRequest.appendChild(recordHtmlInfos); final Element extractorHtmlInfos = document.createElement(XML_TAG_EXTRACTOR_HTML_INFOS); extractorHtmlInfos.setAttribute(XML_ATTR_EXTRACTOR_CONTENT, getFollowLinkRequest.getText()); extractorHtmlInfos.setAttribute(XML_ATTR_EXTRACTOR_OCCURENCE, "1"); extractorHtmlInfos.setAttribute(XML_ATTR_HTML_TYPE, "1"); xmlRequest.appendChild(extractorHtmlInfos); final Request referer = getFollowLinkRequest.getReferer(); xmlRequest.setAttribute(XML_ATTR_REFERER_UID, WriterUtils.getElementUid(referer)); theRequest.getServer().ifPresent(server -> xmlRequest.setAttribute(XML_ATTR_SERV_UID, server.getName())); theRequest.getServer().ifPresent(server -> xmlRequest.setAttribute(XML_ATTR_EXTRACTOR_SERVER_UID, server.getName())); } }
protected void fillXML(final Document document, final Element xmlRequest, final Request theRequest) { xmlRequest.setAttribute(XML_ATTR_METHOD, theRequest.getHttpMethod().toString()); theRequest.getContentType().ifPresent(c -> xmlRequest.setAttribute(XML_ATTR_CONTENT_TYPE, c)); theRequest.getServer().ifPresent(server -> xmlRequest.setAttribute(XML_ATTR_SERV_UID, server.getName())); xmlRequest.setAttribute(XML_ATTR_ACTION_TYPE, String.valueOf(getActionType())); theRequest.getPath().ifPresent(path -> xmlRequest.setAttribute(XML_ATTR_PATH, path)); theRequest.getExtractors().forEach(extractElem -> ExtractorWriter.of(extractElem).writeXML(document, xmlRequest)); writeValidationSection(theRequest, document, xmlRequest); writeParameters(theRequest, document, xmlRequest); theRequest.getHeaders().forEach(header -> HeaderWriter.writeXML(document, xmlRequest, header)); }
private void from(Object object) { if (object instanceof Request) { Request instance = (Request) object; Optional<String> pathOptional = instance.getPath(); if (pathOptional.isPresent()) { path(pathOptional);
Optional<String> pathOptional = instance.getPath(); if (pathOptional.isPresent()) { path(pathOptional);
Optional<String> pathOptional = instance.getPath(); if (pathOptional.isPresent()) { path(pathOptional);
Optional<String> pathOptional = instance.getPath(); if (pathOptional.isPresent()) { path(pathOptional);
Optional<String> pathOptional = instance.getPath(); if (pathOptional.isPresent()) { path(pathOptional);
Optional<String> pathOptional = instance.getPath(); if (pathOptional.isPresent()) { path(pathOptional);
Optional<String> pathOptional = instance.getPath(); if (pathOptional.isPresent()) { path(pathOptional);