gpt4 book ai didi

org.n52.security.common.xml.XMLPath.node()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 03:27:05 27 4
gpt4 key购买 nike

本文整理了Java中org.n52.security.common.xml.XMLPath.node()方法的一些代码示例,展示了XMLPath.node()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLPath.node()方法的具体详情如下:
包路径:org.n52.security.common.xml.XMLPath
类名称:XMLPath
方法名:node

XMLPath.node介绍

[英]Method node, expects a xpath query resulting in a node.
[中]方法节点,需要xpath查询生成一个节点。

代码示例

代码示例来源:origin: org.n52.metadata/smarteditor-api

public String getValue(Node rootNode, XMLPathCtx context) {
    String nameSpaceURI = getNamespaceURI(rootNode);
    if (startsWith ? nameSpaceURI.startsWith(namespace) : nameSpaceURI.equals(namespace)) {
      if (nodeExists != null && context.findIn(rootNode).node(nodeExists).get() != null) {
        return value;
      } else {
        return value;
      }
    }
    return null;
  }
}

代码示例来源:origin: org.n52.security/52n-security-wss

public void setAuthenticationMethods(Collection<AuthenticationMethod> methods) {
  Node newSuppAuthMethodsElem = m_capsDoc.createElementNS("http://www.gdi-nrw.org/wss", "SupportedAuthenticationMethodList");
  Node capabilityElement = m_xPathCtx.findIn(m_capsDoc).node("//wss:Capability").get();
  Node lOldSuppAuthMethodsElem =
      m_xPathCtx.findIn(capabilityElement).node("//wss:Capability/wss:SupportedAuthenticationMethodList").get();
  if (lOldSuppAuthMethodsElem != null) {
    capabilityElement.removeChild(lOldSuppAuthMethodsElem);
  }
  AuthenticationMethodDOMRenderer renderer = new AuthenticationMethodDOMRenderer();
  for (AuthenticationMethod method : methods) {
    Element authMethodElem = renderer.render(method);
    Node importedNode = m_capsDoc.importNode(authMethodElem, true);
    newSuppAuthMethodsElem.appendChild(importedNode);
  }
  capabilityElement.appendChild(newSuppAuthMethodsElem);
}

代码示例来源:origin: org.n52.security/52n-security-wss

private Node getSecuredServiceTypeNode() {
  Node securedServiceTypeNode = m_xPathCtx.findIn(m_capsDoc).node("//wss:SecuredServiceType").get();
  return securedServiceTypeNode;
}

代码示例来源:origin: org.n52.security/52n-security-wss

public void setLicensePrecondition(LicensePrecondition licenseProcondition) {
  if (licenseProcondition == null) {
    return;
  }
  Node caproot = m_xPathCtx.findIn(m_capsDoc).node("//wss:Capability").get();
  String baseUrl = licenseProcondition.getBaseUrl();
  String redirectUrl = licenseProcondition.getRedirectUrl();
  String ssoUrl = licenseProcondition.getSsoGetUrl();
  String filledTemplate = String.format(licensePreconditionTemplate, baseUrl, ssoUrl, redirectUrl, baseUrl);
  StringReader reader = new StringReader(filledTemplate);
  Document templateDoc = DOMParser.createNew().parse(new InputSource(reader));
  Node importedTemplateNode = m_capsDoc.importNode(templateDoc.getDocumentElement(), true);
  caproot.appendChild(importedTemplateNode);
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

public String getTemplateFor(Document document) {
  Node rootNode = context.findIn(document).node("/*[1]").get();
  String serviceType = getServiceTypeFrom(rootNode);
  String version = context.findIn(rootNode).text("@version").get();
  return version.equals("") ? templateMap.get(serviceType) : templateMap.get(serviceType + "_" + version);
}

代码示例来源:origin: org.n52.security/52n-security-facade

public Element getAuthnRequest() {
  return (Element) getXpathCtx().findIn(
      m_paosResponse).node("//samlp:AuthnRequest").get();
}

代码示例来源:origin: org.n52.security/52n-security-core

private Node find(final String xpath) {
  Node node = XMLPathCtx.createNew().addNamespaces(namespaces).findIn(sourceDocument).node(xpath).get();
  if (node == null) {
    throw new IllegalArgumentException("XPath <" + xpath + "> must resolve to an node");
  }
  return (Element) node;
}

代码示例来源:origin: org.n52.security/52n-security-facade

public Element getRelayState() {
  return (Element) getXpathCtx().findIn(m_paosResponse).node("//ecp:RelayState").get();
}

代码示例来源:origin: org.n52.security/52n-security-enforcement-impl

Node textBlock = ctxResponse.findIn(member).node(".//*/" + SOSInterceptorGlobals.ELEMENT_SWE_TEXTBLOCK).get();
String blockSeparator = ";";
if (textBlock.hasAttributes()) {
          .getTextContent();
Node values = ctxResponse.findIn(member).node(".//*/" + SOSInterceptorGlobals.ELEMENT_SWE_VALUES).get();
if (values != null && values.getTextContent() != null && !values.getTextContent().isEmpty()) {
  String[] blocks = values.getTextContent().split(blockSeparator);

代码示例来源:origin: org.n52.security/52n-security-enforcement-impl

.node("./*/" + documentPrefix + SOSInterceptorGlobals.ELEMENT_PROCEDURE).get();
if (procedure.getAttributes().getNamedItem(SOSInterceptorGlobals.ATTRIBUTE_XLINK_HREF) != null) {
  String id =

代码示例来源:origin: org.n52.security/52n-security-enforcement-impl

Node queryFilterSubNode = ctx.findIn(queryNode).node("Filter/*").get();

代码示例来源:origin: org.n52.security/52n-security-enforcement-impl

ctxRequest
        .findIn(actualNode)
        .node(SOSInterceptorGlobals.ELEMENT_GML_TIME_PERIOD + "/"
            + SOSInterceptorGlobals.ELEMENT_GML_BEGIN_POSITION).get();
Node endPositionNode =
    ctxRequest
        .findIn(actualNode)
        .node(SOSInterceptorGlobals.ELEMENT_GML_TIME_PERIOD + "/"
            + SOSInterceptorGlobals.ELEMENT_GML_END_POSITION).get();
Node timePositionNode =
    ctxRequest
        .findIn(actualNode)
        .node(SOSInterceptorGlobals.ELEMENT_GML_TIME_INSTANT + "/"
            + SOSInterceptorGlobals.ELEMENT_GML_TIME_POSITION).get();

代码示例来源:origin: org.n52.security/52n-security-enforcement-impl

ctxRequest
        .findIn(actualNode)
        .node(SOSInterceptorGlobals.ELEMENT_GML_TIME_PERIOD + "/"
            + SOSInterceptorGlobals.ELEMENT_GML_BEGIN_POSITION).get();
Node endPositionNode =
    ctxRequest
        .findIn(actualNode)
        .node(SOSInterceptorGlobals.ELEMENT_GML_TIME_PERIOD + "/"
            + SOSInterceptorGlobals.ELEMENT_GML_END_POSITION).get();
Node timePositionNode =
    ctxRequest
        .findIn(actualNode)
        .node(SOSInterceptorGlobals.ELEMENT_GML_TIME_INSTANT + "/"
            + SOSInterceptorGlobals.ELEMENT_GML_TIME_POSITION).get();

代码示例来源:origin: org.n52.security/52n-security-enforcement-impl

ctxRequest
        .findIn(actualNode)
        .node(SOSInterceptorGlobals.ELEMENT_GML_TIME_PERIOD + "/"
            + SOSInterceptorGlobals.ELEMENT_GML_BEGIN_POSITION).get();
Node endPositionNode =
    ctxRequest
        .findIn(actualNode)
        .node(SOSInterceptorGlobals.ELEMENT_GML_TIME_PERIOD + "/"
            + SOSInterceptorGlobals.ELEMENT_GML_END_POSITION).get();
Node timePositionNode =
    ctxRequest
        .findIn(actualNode)
        .node(SOSInterceptorGlobals.ELEMENT_GML_TIME_INSTANT + "/"
            + SOSInterceptorGlobals.ELEMENT_GML_TIME_POSITION).get();

代码示例来源:origin: org.n52.security/52n-security-wss

private List<AuthenticationMethod> getSupportedAuthenticationMethods() {
    List<AuthenticationMethod> supportedAuthNMethods = new ArrayList<AuthenticationMethod>();
    NodeList authenticationMethodList = m_xPathCtx.findIn(m_capsDoc).all("//authn:AuthenticationMethod").get();
    for (int i = 0; i < authenticationMethodList.getLength(); i++) {
      org.w3c.dom.Node currentAuthMethod = authenticationMethodList.item(i);
      String type = m_xPathCtx.findIn(currentAuthMethod).text("@xsi:type").get();
      type = type.substring(type.lastIndexOf(":") + 1);
      String method = m_xPathCtx.findIn(currentAuthMethod).text("@method").get();
      AuthenticationMethod supportedAuthMethod;
      if (type.equals("WASType")) {
        org.w3c.dom.Node accAuthNServiceNode = m_xPathCtx.findIn(currentAuthMethod).node("//authn:AuthenticationService").get();
        String wasName = m_xPathCtx.findIn(accAuthNServiceNode).text("authn:Name/text()").get();
        String wasUrl = m_xPathCtx.findIn(accAuthNServiceNode).text("authn:OnlineResource/@xlink:href").get();
        supportedAuthMethod = new org.n52.security.authentication.WASAuthenticationMethod(wasName, wasUrl, "");
      } else {
        supportedAuthMethod = AuthenticationMethodFactory.getDefault().create(method);
      }
      supportedAuthNMethods.add(supportedAuthMethod);
    }
    return supportedAuthNMethods;
  }
}

代码示例来源:origin: org.n52.security/52n-security-facade

public static SAML2IdPMetadata createFrom(Element idpSsoDescrElement) throws MalformedURLException {
  XMLPathCtx xpathCtx = XMLPathCtx.createNew().addNamespace("md", "urn:oasis:names:tc:SAML:2.0:metadata");
  NodeList nodeList = xpathCtx.findIn(idpSsoDescrElement).all("md:SingleSignOnService").get();
  SAML2IdPMetadata metadata = new SAML2IdPMetadata();
  for (int i = 0; i < nodeList.getLength(); i++) {
    Element ssoService = (Element) nodeList.item(i);
    String binding = ssoService.getAttribute("Binding");
    String location = ssoService.getAttribute("Location");
    metadata.addSSOBinding(binding, new URL(location));
  }
  Element organizationElem = (Element) xpathCtx.findIn(idpSsoDescrElement).node("./../md:Organization").get();
  if (organizationElem == null) {
    String entityID = xpathCtx.findIn(idpSsoDescrElement).text("./../@entityID").get();
    metadata.setOrganisationDisplayName(entityID);
  } else {
    String idpDisplayName = xpathCtx.findIn(organizationElem).text("md:OrganizationDisplayName/text()").get();
    metadata.setOrganisationDisplayName(idpDisplayName);
  }
  return metadata;
}

代码示例来源:origin: org.n52.security/52n-security-enforcement-impl

"http://www.opengis.net/wps/1.0.0");
Node nl = ctx.findIn(doc).node("/wps:Execute/ows:Identifier/text()").get();
String requestedProcessId = nl.getNodeValue();

代码示例来源:origin: org.n52.metadata/smarteditor-api

Document lDoc = getThematicTreeDAO().asXmlDocument(pLocale);
Node rootNode = xmlPathContextFactory.createContext().findIn(lDoc).node("*/node").get();

代码示例来源:origin: org.n52.security/52n-security-enforcement-impl

Node envelope =
    ctx.findIn(doc)
        .node("//*/sos:Contents/sos:ObservationOfferingList/sos:ObservationOffering[@gml:id='"
            + offeringId + "']/gml:boundedBy/gml:Envelope[@srsName='" + srs + "']").get();

代码示例来源:origin: org.n52.security/52n-security-wss

/**
 * @return
 */
public LicensePrecondition getLicensePrecondition() {
  org.w3c.dom.Node licBroClientElement = m_xPathCtx.findIn(m_capsDoc).node("/wss:WSS_Capabilities/wss:Capability/licb:LicensePrecondition/licb:LicenseBrokerClient").get();
  if (licBroClientElement == null) {
    return null;
  }
  String licenseRedirectURL = m_xPathCtx.findIn(licBroClientElement).text("licb:RedirectURL/text()").get();
  String ssoGetURL = m_xPathCtx.findIn(licBroClientElement).text("licb:SSOGetURL").get();
  if (licenseRedirectURL == null && ssoGetURL == null) {
    String baseUrl = m_xPathCtx.findIn(licBroClientElement).text("ows:DCP/ows:HTTP/ows:Post/text()").get();
    if (baseUrl == null) {
      return null;
    }
    baseUrl = ensureSingleEndingSlash(baseUrl);
    licenseRedirectURL = baseUrl + "getOrCreateLicenseToken.faces";
    ssoGetURL = baseUrl + "getLicenseToken.faces";
  }
  LicensePrecondition licensePrecondition = new LicensePrecondition(ssoGetURL.trim(), licenseRedirectURL.trim(), null);
  return licensePrecondition;
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com