Package org.codehaus.jackson.node

Examples of org.codehaus.jackson.node.ObjectNode


        GetMessagesTransaction transaction = new GetMessagesTransaction(user, offset, limit);
        transaction.execute();

        ArrayNode messages = Util.toSafeJSONArray(transaction.getUserMessageExs());

        ObjectNode obj = new ObjectNode(JsonNodeFactory.instance);
        obj.put("messages", messages);
        obj.put("totalMessagesCount", transaction.getCount());
        return renderOK(obj);
    }
View Full Code Here


        return message;
    }

    @Override
    public ObjectNode toSafeJSON() {
        ObjectNode obj = super.toSafeJSON();

        // TODO: We don't need the detailed information of the event.
        obj.put("event", event.toSafeJSON());
        obj.put("sender", sender.toSafeJSON());
        obj.put("message", message.toSafeJSON());

        return obj;
    }
View Full Code Here

        return new SessionTokenAPI().execute();
    }

    @Override
    public Result doExecute() throws DAOException {
        ObjectNode obj = new ObjectNode(JsonNodeFactory.instance);
        obj.put("token", context().sessionToken());

        return renderOK(obj);
    }
View Full Code Here

        List<UserEx> users = new SearchUserAccess(userNamePrefix, limit).execute();

        ArrayNode array = Util.toSafeJSONArray(users);

        ObjectNode obj = new ObjectNode(JsonNodeFactory.instance);
        obj.put("users", array);
        return renderOK(obj);
    }
View Full Code Here

        ArrayNode imageIds = new ArrayNode(JsonNodeFactory.instance);
        for (String imageId : transaction.getImageIds())
            imageIds.add(imageId);

        ObjectNode obj = new ObjectNode(JsonNodeFactory.instance);
        obj.put("imageIds", imageIds);
        obj.put("count", transaction.getCountImages());
        return renderOK(obj);
    }
View Full Code Here

        ArrayNode statuses = new ArrayNode(JsonNodeFactory.instance);
        for (EventStatus status : transaction.getEventStatuses())
            statuses.add(status.toSafeJSON());

        ObjectNode obj = new ObjectNode(JsonNodeFactory.instance);
        obj.put("totalEventCount", transaction.getNumTotalEvents());
        obj.put("eventStatuses", statuses);

        return renderOK(obj);
    }
View Full Code Here

        else if (searchService.hasIndexed(eventId))
            searchService.update(event, tickets);
        else
            searchService.create(event, tickets);

        ObjectNode obj = new ObjectNode(JsonNodeFactory.instance);
        obj.putAll(transaction.getJSONObject());
        return renderOK(obj);
    }
View Full Code Here

        UserEx user = ensureLogin();
        ensureValidSessionToken();

        String newCalendarId = new RevokeCalendarAPITransaction(user).execute();

        ObjectNode obj = new ObjectNode(JsonNodeFactory.instance);
        obj.put("calendarId", newCalendarId);
        return renderOK(obj);
    }
View Full Code Here

        this.participations = participations;
        this.numEvents = numEvents;
    }

    public ObjectNode toSafeJSON() {
        ObjectNode obj = new ObjectNode(JsonNodeFactory.instance);
        obj.put("numEvents", numEvents);
        ArrayNode events = obj.putArray("participations");

        for (EventParticipation participation : participations)
            events.add(participation.toSafeJSON());

        return obj;
View Full Code Here

        this.numEnrolledUsers = numEnrolledUsers;
        this.numReservedUsers = numReservedUsers;
    }

    public ObjectNode toSafeJSON() {
        ObjectNode obj = new ObjectNode(JsonNodeFactory.instance);
        obj.put("event", event.toSafeJSON());
        obj.put("numEnrolledUsers", numEnrolledUsers);
        obj.put("numReservedUsers", numReservedUsers);
        return obj;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.node.ObjectNode

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.