Exemplo n.º 1
0
 private PageManifestDef loadRootPageDefinition(String manifestPathOrPath)
     throws ParserConfigurationException, SAXException, XPathExpressionException, IOException {
   PageManifestDef pmd = new PageManifestDef();
   Document document = readPageDefinitionFile(manifestPathOrPath, pmd);
   pmd.setSelectorStrategy(selectorExpr.evaluate(document));
   return pmd;
 }
Exemplo n.º 2
0
    public PageManifestDef read(FileScope fileScope, Document document, PageManifestDef pmd)
        throws XPathExpressionException {
      this.fileScope = fileScope;
      XmlUtils.iterateSubElements(
          document, resourcesExpr, e -> pmd.addResourceSet(readResourcesDefinition(e)));
      XmlUtils.iterateSubElements(
          document, fragmentsExpr, e -> pmd.addFragments(readFragmentDefinition(e)));
      XmlUtils.iterateSubElements(document, viewsExpr, e -> pmd.addView(readViewDefinition(e)));

      List<String> imports =
          XmlUtils.getSingleAttrNodes(
              document, importsExpr, "file", "import tag must contain file attribute");

      imports
          .stream()
          .forEach(
              i ->
                  XMLPageManifestLoader.this.readPageDefinitionFile(
                      fileScope.getRelativePath(i), pmd));

      return pmd;
    }