Package org.haystack.tagval

Examples of org.haystack.tagval.HRef


    public void onService(HServer db, HGrid req, HGridWriter writer) throws Exception {
        // get required point id
        if (req.isEmpty())
            throw new Exception("Request has no rows");
        HRow row = req.row(0);
        HRef id = valToId(db, row.get("id"));

        // check for write
        if (row.has("level")) {
            int level = row.getInt("level");
            String who = row.getStr("who"); // be nice to have user fallback
View Full Code Here


    @Override
    public void onService(HServer db, HGrid req, HGridWriter writer) throws Exception {
        if (req.isEmpty())
            throw new Exception("Request has no rows");
        HRow row = req.row(0);
        HRef id = valToId(db, row.get("id"));

        String range = row.getStr("range");
        db.hisRead(id, range, writer);
    }
View Full Code Here

    @Override
    public void onService(HServer db, HGrid req, HGridWriter writer) throws Exception {
        if (req.isEmpty())
            throw new Exception("Request has no rows");
        HRef id = valToId(db, req.meta().get("id"));

        HHisItem[] items = HHisItem.gridToItems(req);
        db.hisWrite(id, items);

        writeGrid(writer, HGrid.EMPTY);
View Full Code Here

        return "Invoke action on target entity";
    }

    @Override
    public void onService(HServer db, HGrid req, HGridWriter writer) throws Exception {
        HRef id = valToId(db, req.meta().get("id"));

        String action = req.meta().getStr("action");
        HDict args = HDict.EMPTY;
        if (req.numRows() > 0)
            args = req.row(0);
View Full Code Here

        verifyEq(client.readAll("site", 2).numRows(), 2);

        // readById
        HDict rec = client.readById(recA.id());
        verifyEq(rec.dis(), disA);
        HRef badId = HRef.make("badBadId");
        verifyEq(client.readById(badId, false), null);
        try {
            client.readById(badId);
            fail();
        }
View Full Code Here

        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

        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

        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

TOP

Related Classes of org.haystack.tagval.HRef

Copyright © 2018 www.massapicom. 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.