Package in.partake.model.dto

Examples of in.partake.model.dto.Event


        // TODO: 開始時刻が現在時刻より後の event のみを取り出したい、というかリマインダーを送るべりイベントのみを取り出したい
        DataIterator<Event> it = daos.getEventAccess().getIterator(con);
        try {
            while (it.hasNext()) {
                Event e = it.next();
                if (e == null) { continue; }
                String eventId = e.getId();
                if (eventId == null) { continue; }
                EventEx event = EventDAOFacade.getEventEx(con, daos, eventId);
                if (event == null) { continue; }
                if (event.getBeginDate().isBefore(now)) { continue; }
View Full Code Here


        this.eventId = eventId;
    }

    @Override
    protected Event doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        Event event = daos.getEventAccess().find(con, eventId);
        if (event == null)
            throw new PartakeException(UserErrorCode.INVALID_EVENT_ID);

        if (!StringUtils.equals(event.getOwnerId(), user.getId()))
            throw new PartakeException(UserErrorCode.FORBIDDEN_EVENT_EDIT);

        if (!event.isDraft())
            throw new PartakeException(UserErrorCode.EVENT_ALREADY_PUBLISHED);

        event = new Event(event);
        event.setDraft(false);
        daos.getEventAccess().put(con, event);

        // Event Activity に挿入
        IEventActivityAccess eaa = daos.getEventActivityAccess();
        EventActivity activity = new EventActivity(eaa.getFreshId(con), event.getId(), "イベントが更新されました : " + event.getTitle(), event.getDescription(), event.getCreatedAt());
        eaa.put(con, activity);

        // さらに、twitter bot がつぶやく (private の場合はつぶやかない)
        if (event.isSearchable())
            EventDAOFacade.tweetNewEventArrival(con, daos, event);

        this.tickets = daos.getEventTicketAccess().findEventTicketsByEventId(con, eventId);

        return event;
View Full Code Here

        List<String> eventIds = searchService.search(query, category, sortOrder, beforeDeadlineOnly, offset, maxNum);
        List<Event> events = new ArrayList<Event>();

        for (String eventId : eventIds) {
            Event event = daos.getEventAccess().find(con, eventId);
            if (event != null && event.isSearchable())
                events.add(event);
        }

        return events;
    }
View Full Code Here

     * @see https://dev.twitter.com/blog/upcoming-tco-changes
     */
    public static final int URL_LENGTH = 23;

    public static EventEx getEventEx(PartakeConnection con, IPartakeDAOs daos, String eventId) throws DAOException {
        Event event = daos.getEventAccess().find(con, eventId);
        if (event == null) { return null; }
        UserEx owner = UserDAOFacade.getUserEx(con, daos, event.getOwnerId());
        if (owner == null) { return null; }

        String feedId = daos.getEventFeedAccess().findByEventId(con, eventId);

        List<EventTicket> tickets = daos.getEventTicketAccess().findEventTicketsByEventId(con, eventId);

        List<User> editors = new ArrayList<User>();
        if (event.getEditorIds() != null) {
            for (String editorId : event.getEditorIds()) {
                User editor = daos.getUserAccess().find(con, editorId);
                if (editor != null)
                    editors.add(editor);
            }
        }

        List<Event> relatedEvents = new ArrayList<Event>();
        if (event.getRelatedEventIds() != null) {
            for (String relatedEventId : event.getRelatedEventIds()) {
                if (!Util.isUUID(relatedEventId))
                    continue;
                Event relatedEvent = daos.getEventAccess().find(con, relatedEventId);
                if (relatedEvent != null)
                    relatedEvents.add(relatedEvent);
            }
        }

View Full Code Here

        this.eventId = eventId;
    }

    @Override
    protected String doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        Event event = daos.getEventAccess().find(con, eventId);
        if (event == null)
            throw new PartakeException(UserErrorCode.INVALID_EVENT_ID);

        if (!EventEditPermission.check(event, user))
            throw new PartakeException(UserErrorCode.FORBIDDEN_EVENT_COPY);
View Full Code Here

        return eventEmbryo.getId();
    }

    public static String copy(PartakeConnection con, IPartakeDAOs daos, UserEx user, Event event) throws DAOException {
        // --- copy event.
        Event newEvent = new Event(event);
        newEvent.setId(null);
        newEvent.setTitle(Util.shorten("コピー -- " + event.getTitle(), 100));
        newEvent.setDraft(true);
        newEvent.setOwnerId(user.getId());
        String newEventId = EventDAOFacade.create(con, daos, newEvent);
        newEvent.setId(newEventId);

        // --- copy ticket.
        List<EventTicket> tickets = daos.getEventTicketAccess().findEventTicketsByEventId(con, event.getId());
        for (EventTicket ticket : tickets) {
            EventTicket newTicket = new EventTicket(ticket);
View Full Code Here

        // TODO: 開催前のイベントだけiterateすれば充分
        DataIterator<Event> it = daos.getEventAccess().getIterator(con);
        try {
            while (it.hasNext()) {
                Event e = it.next();
                if (e == null)
                    continue;
                String eventId = e.getId();
                if (eventId == null)
                    continue;
                if (!Util.isUUID(eventId)) {
                    Logger.warn("eventId is not UUID.... Should not happen. : " + eventId);
                    continue;
View Full Code Here

        searchService.truncate();
        Set<String> bannedUserId = collectBannedUserId(con, daos);
        DataIterator<Event> it = daos.getEventAccess().getIterator(con);
        try {
            while (it.hasNext()) {
                Event event = it.next();
                if (event == null) { continue; }

                List<EventTicket> tickets = daos.getEventTicketAccess().findEventTicketsByEventId(con, event.getId());

                if (!event.isSearchable() || bannedUserId.contains(event.getOwnerId()))
                    searchService.remove(event.getId());
                else if (searchService.hasIndexed(event.getId()))
                    searchService.update(event, tickets);
                else
                    searchService.create(event, tickets);
            }
        } finally {
View Full Code Here

        IEventAccess dao = daos.getEventAccess();

        DataIterator<Event> it = dao.getIterator(con, EventFilterCondition.PUBLISHED_PUBLIC_EVENT_ONLY);
        try {
            while (it.hasNext()) {
                Event event = it.next();
                assert event != null;
                if (event == null)
                    continue;

                assert event.isSearchable();
                if (!event.isSearchable())
                    continue;

                if (!EventCategory.getAllEventCategory().equals(categoryName) && !categoryName.equals(event.getCategory()))
                    continue;

                CalendarUtil.addToCalendar(calendar, event);
            }
        } finally {
View Full Code Here

        UserEx sender = UserDAOFacade.getUserEx(con, daos, receivedMessage.getSenderId());
        if (sender == null)
            return null;

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

        Message message = daos.getMessageAccess().find(con, UUID.fromString(receivedMessage.getMessageId()));
        if (message == null)
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.