private void removeNonStandardTopNavigation() { Element firstHeading = findFirstElement(Selector.TOP_LEVEL_HEADINGS); if (firstHeading == null) return; int firstHeadingIndex = firstHeading.siblingIndex(); List<Node> topNavigationEtc = new ArrayList<>(); for (Node node : firstHeading.parent().childNodes()) { if (node.siblingIndex() < firstHeadingIndex) topNavigationEtc.add(node); } deleteNodes(topNavigationEtc); }
private void checkEmbedAgainst(PageCompilingContext pc, EvaluatorCompiler compiler, Map<String, String> properties, Class<?> embedClass, Node node) { // TODO also type check them against expressions for (String property : properties.keySet()) { try { if (!compiler.isWritable(property)) { pc.errors.add( CompileError.in(node.outerHtml()) //TODO we need better line number detection if there is whitespace between the annotation and tag. .near(node.siblingIndex()-1) // TODO - line number of the annotation .causedBy(CompileErrors.PROPERTY_NOT_WRITEABLE, String.format("Property %s#%s was not writable. Did you forget to create " + "a setter or @Visible annotation?", embedClass.getSimpleName(), property)) ); } } catch (ExpressionCompileException ece) { pc.errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.ERROR_COMPILING_PROPERTY) ); } } }
private void checkEmbedAgainst(PageCompilingContext pc, EvaluatorCompiler compiler, Map<String, String> properties, Class<?> embedClass, Node node) { // TODO also type check them against expressions for (String property : properties.keySet()) { try { if (!compiler.isWritable(property)) { pc.errors.add( CompileError.in(node.outerHtml()) //TODO we need better line number detection if there is whitespace between the annotation and tag. .near(node.siblingIndex()-1) // TODO - line number of the annotation .causedBy(CompileErrors.PROPERTY_NOT_WRITEABLE, String.format("Property %s#%s was not writable. Did you forget to create " + "a setter or @Visible annotation?", embedClass.getSimpleName(), property)) ); } } catch (ExpressionCompileException ece) { pc.errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.ERROR_COMPILING_PROPERTY) ); } } }
private void checkEmbedAgainst(EvaluatorCompiler compiler, Map<String, String> properties, Class<?> embedClass, Node node) { // TODO also type check them against expressions for (String property : properties.keySet()) { try { if (!compiler.isWritable(property)) { errors.add( CompileError.in(node.outerHtml()) //TODO we need better line number detection if there is whitespace between the annotation and tag. .near(node.siblingIndex()-1) // TODO - line number of the annotation .causedBy(CompileErrors.PROPERTY_NOT_WRITEABLE, String.format("Property %s#%s was not writable. Did you forget to create " + "a setter or @Visible annotation?", embedClass.getSimpleName(), property)) ); } } catch (ExpressionCompileException ece) { errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.ERROR_COMPILING_PROPERTY) ); } } }
errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.MISSING_REPEAT_VAR) ); errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.MISSING_REPEAT_ITEMS) ); errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.REPEAT_OVER_ATOM) ); errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(e) );
private void checkUriConsistency(PageCompilingContext pc, Node element) { String uriAttrib = element.attr("action"); if (null == uriAttrib) uriAttrib = element.attr("src"); if (null == uriAttrib) uriAttrib = element.attr("href"); if (null != uriAttrib) { // Verify that such a uri exists in the page book, // only if it is contextual--ignore abs & relative URIs. if (uriAttrib.startsWith("/")) if (null == pageBook.nonCompilingGet(uriAttrib)) pc.warnings.add( CompileError.in(element.outerHtml()) .near(element.siblingIndex()) // TODO - line number .causedBy(CompileErrors.UNRESOLVABLE_FORM_ACTION, uriAttrib) ); } }
private void checkUriConsistency(Node element) { String uriAttrib = element.attr("action"); if (null == uriAttrib) uriAttrib = element.attr("src"); if (null == uriAttrib) uriAttrib = element.attr("href"); if (null != uriAttrib) { // Verify that such a uri exists in the page book, // only if it is contextual--ignore abs & relative URIs. final String uri = uriAttrib; if (uri.startsWith("/")) if (null == pageBook.nonCompilingGet(uri)) warnings.add( CompileError.in(element.outerHtml()) .near(element.siblingIndex()) // TODO - line number .causedBy(CompileErrors.UNRESOLVABLE_FORM_ACTION, uri) ); } }
pc.errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.MISSING_REPEAT_VAR) ); pc.errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.MISSING_REPEAT_ITEMS) ); pc.errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.REPEAT_OVER_ATOM) ); pc.errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(e) );
private void checkUriConsistency(PageCompilingContext pc, Node element) { String uriAttrib = element.attr("action"); if (null == uriAttrib) uriAttrib = element.attr("src"); if (null == uriAttrib) uriAttrib = element.attr("href"); if (null != uriAttrib) { // Verify that such a uri exists in the page book, // only if it is contextual--ignore abs & relative URIs. if (uriAttrib.startsWith("/")) if (null == pageBook.nonCompilingGet(uriAttrib)) pc.warnings.add( CompileError.in(element.outerHtml()) .near(element.siblingIndex()) // TODO - line number .causedBy(CompileErrors.UNRESOLVABLE_FORM_ACTION, uriAttrib) ); } }
pc.errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.MISSING_REPEAT_VAR) ); pc.errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.MISSING_REPEAT_ITEMS) ); pc.errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(CompileErrors.REPEAT_OVER_ATOM) ); pc.errors.add( CompileError.in(node.outerHtml()) .near(node.siblingIndex()) // TODO - line number .causedBy(e) );
.near(element.siblingIndex()) // TODO - line number .causedBy(CompileErrors.UNRESOLVABLE_FORM_BINDING, e) );
.near(element.siblingIndex()) // TODO - line number .causedBy(CompileErrors.UNRESOLVABLE_FORM_BINDING, e) );
.near(element.siblingIndex()) // TODO - line number .causedBy(CompileErrors.UNRESOLVABLE_FORM_BINDING, e) );