Package in.partake.model.dto

Examples of in.partake.model.dto.Event


        String passcode = getParameter("passcode");

        if (passcode == null)
            return render(views.html.events.passcode.render(context(), eventId));

        Event event = new EventPasscodeTransaction(eventId).execute();
        if (event == null)
            return renderNotFound();

        String pass = StringUtils.trim(passcode);

        if (!pass.equals(event.getPasscode())) {
            context().addMessage(MessageCode.MESSAGE_PASSCODE_INVALID);
            return render(views.html.events.passcode.render(context(), eventId));
        }

        // TODO: Reconsider Session.
View Full Code Here


        try {
            Message message = daos.getMessageAccess().find(con, UUID.fromString(userMessage.getMessageId()));
            long twitterId = twitterLinkage.getTwitterId();

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

            String url = "http://partake.in/messages/" + userMessage.getId();
            String messageBody;
            if (event != null) {
                int rest = 140;
                String format = "[PRTK] %s 「%s」に関する新着メッセージがあります。 : %s";
                rest -= Util.codePointCount(format);

                rest -= EventDAOFacade.URL_LENGTH;

                String title = Util.shorten(event.getTitle(), 30);
                rest -= Util.codePointCount(title);

                String body = Util.shorten(message.getSubject(), rest);
                messageBody = String.format(format, url, title, body);
            } else {
View Full Code Here

        EventTicket ticket = daos.getEventTicketAccess().find(con, ticketId);
        if (ticket == null)
            throw new PartakeException(UserErrorCode.INVALID_TICKET_ID);

        IEventAccess eventDao = daos.getEventAccess();
        Event event = eventDao.find(con, ticket.getEventId());
        if (event == null)
            throw new PartakeException(UserErrorCode.INVALID_TICKET_ID);

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

        if (ticket == null) {
            failedSendingUserNotification(con, daos, it, envelope, notification);
            return;
        }

        Event event = daos.getEventAccess().find(con, ticket.getEventId());
        if (event == null) {
            failedSendingUserNotification(con, daos, it, envelope, notification);
            return;
        }
View Full Code Here

        FeedEventTransaction transaction = new FeedEventTransaction(feedId);
        transaction.execute();

        try {
            Event event = transaction.getEvent();
            if (event == null)
                return renderNotFound();

            SyndFeed feed = new SyndFeedImpl();
            feed.setFeedType("rss_2.0");
            feed.setEncoding("utf-8");

            feed.setTitle(event.getTitle() + " - [PARTAKE]");
            feed.setLink(event.getEventURL());
            feed.setDescription(event.getSummary());

            byte[] body = createEventFeed(feed, transaction.getActivities());
            if (body == null)
                return renderNotFound();
            return render(body, "application/rss+xml", "inline");
View Full Code Here

        List<UserTicket> enrollments =
                daos.getEnrollmentAccess().findByUserId(con, user.getId(), 0, 1000);
        for (UserTicket enrollment : enrollments) {
            // TODO: Event should be search-able by ticket-id.
            EventTicket ticket = daos.getEventTicketAccess().find(con, enrollment.getTicketId());
            Event event = daos.getEventAccess().find(con, ticket.getEventId());
            if (event == null)
                continue;
            CalendarUtil.addToCalendar(calendar, event);
        }
View Full Code Here

        proxy.execute();
        assertResultOK(proxy);

        String eventId = getJSON(proxy).get("eventId").asText();

        Event originalEvent = loadEvent(DEFAULT_EVENT_ID);
        List<EventTicket> originalTickets = loadEventTickets(DEFAULT_EVENT_ID);

        Event event = loadEvent(eventId);
        List<EventTicket> tickets = loadEventTickets(eventId);

        assertThat(event.getId(), is(not(originalEvent.getId())));
        assertThat(event.getOwnerId(), is(EVENT_OWNER_ID));
        assertThat(event.getSummary(), is(originalEvent.getSummary()));
        assertThat(event.isDraft(), is(true));

        assertThat(tickets.size(), is(1));
        assertThat(tickets.get(0).getName(), is(originalTickets.get(0).getName()));
        assertThat(tickets.get(0).getId(), is(not(originalTickets.get(0).getId())));
    }
View Full Code Here

        proxy.execute();
        assertResultOK(proxy);

        String eventId = getJSON(proxy).get("eventId").asText();

        Event event = loadEvent(eventId);

        assertThat(event.getOwnerId(), is(EVENT_EDITOR_ID));
    }
View Full Code Here

        addFormParameter(proxy, "options[]", new String[] { "[]" });

        proxy.execute();
        assertResultOK(proxy);

        Event modified = loadEvent(UNPUBLISHED_EVENT_ID);
        List<EnqueteQuestion> questions = modified.getEnquetes();
        assertThat(questions.size(), is(1));
        assertThat(questions.get(0).getAnswerType(), is(EnqueteAnswerType.TEXT));
        assertThat(questions.get(0).getText(), is("test"));
    }
View Full Code Here

        addValidSessionTokenToParameter(proxy);

        proxy.execute();
        assertResultOK(proxy);

        Event event = loadEvent(UNPUBLISHED_EVENT_ID);
        assertThat(event.isDraft(), is(false));
    }
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.