Package in.partake.model.dto

Examples of in.partake.model.dto.Event


            UserEx sender = UserDAOFacade.getUserEx(con, daos, userMessage.getSenderId());
            if (sender == null)
                continue;

            Event event = daos.getEventAccess().find(con, userMessage.getEventId());
            if (event == null)
                return null;


            Message message = daos.getMessageAccess().find(con, UUID.fromString(userMessage.getMessageId()));
View Full Code Here


import org.apache.commons.lang.StringUtils;
import org.codehaus.jackson.node.ObjectNode;

class EntityEventMapper extends Postgres9EntityDataMapper<Event> {
    public Event map(ObjectNode obj) {
        return new Event(obj).freeze();
    }
View Full Code Here

        try {
            ArrayList<Event> events = new ArrayList<Event>();
            DataIterator<Event> it = new Postgres9DataIterator<Event>(idMapper, psars);
            while (it.hasNext()) {
                Event event = it.next();
                if (event == null)
                    continue;
                events.add(event);
            }
View Full Code Here

        for (UserTicket enrollment : enrollments) {
            if (enrollment == null)
                continue;

            Event event = daos.getEventAccess().find(con, enrollment.getEventId());
            if (event == null)
                continue;

            EventTicket ticket = daos.getEventTicketAccess().find(con, enrollment.getTicketId());
            if (ticket == null)
View Full Code Here

        for (UserTicket userTicket : rawTickets) {
            if (userTicket == null)
                continue;

            Event event = daos.getEventAccess().find(con, userTicket.getEventId());
            if (event == null)
                continue;

            if (now.isBefore(event.getBeginDate()))
                filtered.add(new Pair<UserTicket, Event>(userTicket, event));
        }

        // filtered を開始時刻順にソート
        Collections.sort(filtered, new Comparator<Pair<UserTicket, Event>>() {
            @Override
            public int compare(Pair<UserTicket, Event> o1, Pair<UserTicket, Event> o2) {
                long t1 = o1.getSecond().getBeginDate().getTime();
                long t2 = o2.getSecond().getBeginDate().getTime();
                if (t1 < t2)
                    return -1;
                if (t1 == t2)
                    return 0;
                return 1;
            }
        });

        for (int i = 0; i < limit && i + offset < filtered.size(); ++i) {
            UserTicket userTicket = filtered.get(i + offset).getFirst();
            Event event = filtered.get(i + offset).getSecond();

            EventTicket ticket = daos.getEventTicketAccess().find(con, userTicket.getTicketId());
            if (ticket == null)
                continue;
View Full Code Here

        for (UserTicket enrollment : enrollments) {
            if (enrollment == null)
                continue;

            Event event = daos.getEventAccess().find(con, enrollment.getEventId());
            if (event == null)
                continue;

            EventTicket ticket = daos.getEventTicketAccess().find(con, enrollment.getTicketId());
            if (ticket == null)
View Full Code Here

    @Override
    protected Void doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        IEventAccess dao = daos.getEventAccess();

        Event event = dao.find(con, eventId);
        if (event == null)
            throw new PartakeException(UserErrorCode.INVALID_EVENT_ID);

        if (!EventRemovePermission.check(event, user))
            throw new PartakeException(UserErrorCode.FORBIDDEN_EVENT_EDIT);

        dao.remove(con, event.getId());
        return null;
    }
View Full Code Here

        Map<String, String[]> params = getFormParameters();

        ModifyTransaction transaction = new ModifyTransaction(user, eventId, params);
        transaction.execute();

        Event event = transaction.getEvent();
        List<EventTicket> tickets = transaction.getEventTickets();

        // If the event is already published, We update event search index.
        IEventSearchService searchService = PartakeApp.getEventSearchService();
        if (!event.isSearchable())
            searchService.remove(eventId);
        else if (searchService.hasIndexed(eventId))
            searchService.update(event, tickets);
        else
            searchService.create(event, tickets);
View Full Code Here

        if (event == null)
            throw new PartakeException(UserErrorCode.INVALID_EVENT_ID);
        if (!EventEditPermission.check(event, user))
            throw new PartakeException(UserErrorCode.FORBIDDEN_EVENT_EDIT);

        event = new Event(event);
        updateEvent(con, daos);

        event.setModifiedAt(TimeUtil.getCurrentDateTime());
        EventDAOFacade.modify(con, daos, event);
View Full Code Here

                if (visitedIds.contains(relatedEventId))
                    continue;

                visitedIds.add(relatedEventId);

                Event relatedEvent = daos.getEventAccess().find(con, relatedEventId);
                if (relatedEvent == null)
                    continue;

                eventIds.add(relatedEventId);

                ObjectNode obj = new ObjectNode(JsonNodeFactory.instance);
                obj.put("id", relatedEvent.getId());
                obj.put("title", relatedEvent.getTitle());
                array.add(obj);
            }
            event.setRelatedEventIds(eventIds);

            // OK. We want to return event.id and event.title.
View Full Code Here

TOP

Related Classes of in.partake.model.dto.Event

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.