Examples of Href


Examples of org.haystack.tagval.HRef

        verifyEq(sub.numRows(), 2);
        verifyEq(sub.row(0).dis(), a.dis());
        verifyEq(sub.row(1).dis(), b.dis());

        // now add c, bad, d
        HRef badId = HRef.make("badBadBad");
        try {
            w.sub(new HRef[] { badId }).dump();
            fail();
        }
        catch (UnknownRecException e) {
View Full Code Here

Examples of org.haystack.tagval.HRef

        else if (val instanceof HBool)
            out.print(val);
        else if (val instanceof HNum)
            out.print(((HNum) val).val);
        else if (val instanceof HRef) {
            HRef ref = (HRef) val;
            StringBuilder s = new StringBuilder();
            s.append("@").append(ref.val);
            if (ref.dis != null)
                s.append(" ").append(ref.dis);
            out.print(HStr.toCode(s.toString()));
View Full Code Here

Examples of org.haystack.tagval.HRef

        if (val == HMarker.VAL)
            return "\u2713";

        if (val instanceof HRef) {
            HRef ref = (HRef) val;
            String s = "@" + ref.val;
            if (ref.dis != null)
                s += " " + ref.dis;
            return s;
        }
View Full Code Here

Examples of org.structr.rest.serialization.html.attr.Href

  public RestWriter beginDocument(final String baseUrl, final String propertyView) throws IOException {

    String currentType = baseUrl.replace(restPath + "/", "").replace("/" + propertyView, "");

    Tag head = doc.block("head");
    head.empty("link").attr(new Rel("stylesheet"), new Type("text/css"), new Href("//structr.org/rest.css"));
    head.inline("script").attr(new Type("text/javascript"), new Src("//structr.org/CollapsibleLists.js"));
    head.inline("title").text(baseUrl);

    Tag body = doc.block("body").attr(new Onload("CollapsibleLists.apply(true);"));
    Tag top  = body.block("div").id("top");

    final App app  = StructrApp.getInstance(securityContext);
    final Tag left = body.block("div").id("left");

    try (final Tx tx = app.tx()) {

      for (SchemaNode node : app.nodeQuery(SchemaNode.class).getAsList()) {

        final String rawType = node.getName();
        top.inline("a").attr(new Href(restPath + "/" + rawType), new If(rawType.equals(currentType), new Css("active"))).text(rawType);
      }

    } catch (Throwable t) {
      t.printStackTrace();
    }

    for (String view : StructrApp.getConfiguration().getPropertyViews()) {

      if (!hiddenViews.contains(view)) {
        left.inline("a").attr(new Href(restPath + "/" + currentType + "/" + view), new If(view.equals(propertyView), new Css("active"))).text(view);
      }
    }

    // main div
    currentElement = body.block("div").id("right");
View Full Code Here

Examples of org.structr.rest.serialization.html.attr.Href

      currentElement = currentElement.block("li");
    }

    if ("id".equals(lastName)) {

      currentElement.inline("a").css("id").attr(new Href(restPath + "/" + value)).text(value);

    } else {

      currentElement.inline("span").css("string").text(value);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.