Package in.partake.base

Examples of in.partake.base.PartakeException


    @Override
    protected List<EventTicketNotification> doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        Event event = daos.getEventAccess().find(con, eventId);

        if (!EventNotificationListPermission.check(event, user))
            throw new PartakeException(UserErrorCode.FORBIDDEN_SHOW_NOTIFICATION);

        return daos.getEventNotificationAccess().findByEventId(con, eventId, offset, limit);
    }
View Full Code Here


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

        commentEmbryo.setId(daos.getCommentAccess().getFreshId(con));
        daos.getCommentAccess().put(con, commentEmbryo);

        // TODO: コメント消したときにこれも消したいか? まずいコメントが feed され続けるのは問題となりうるか?
View Full Code Here

    @Override
    protected Void 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_EDIT);

        List<EnqueteQuestion> enquetes = new ArrayList<EnqueteQuestion>();
        try {
            for (int i = 0; i < questions.length; ++i) {
                List<String> optionValues = new ArrayList<String>();
View Full Code Here

    @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);
View Full Code Here

    @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);

        return EventDAOFacade.copy(con, daos, user, event);
    }
View Full Code Here

        byte[] foreImageByteArray;
        try {
            foreImageByteArray = Util.getContentOfFile(file);
        } catch (IOException e) {
            throw new PartakeException(ServerErrorCode.ERROR_IO);
        }

        String imageId = dao.getFreshId(con);
        UserImage imageEmbryo = new UserImage(imageId, user.getId(), contentType, foreImageByteArray, TimeUtil.getCurrentDateTime());
        dao.put(con, imageEmbryo);
View Full Code Here

    @Override
    protected Void doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        event = EventDAOFacade.getEventEx(con, daos, eventId);
        if (event == null)
            throw new PartakeException(UserErrorCode.INVALID_NOTFOUND);

        // Only owner can retrieve the participants list.
        if (!EventParticipationListPermission.check(event, user))
            throw new PartakeException(UserErrorCode.FORBIDDEN_EVENT_ATTENDANT_EDIT);

        tickets = daos.getEventTicketAccess().findEventTicketsByEventId(con, eventId);
        for (int i = 0; i < tickets.size(); ++i) {
            EventTicket ticket = tickets.get(i);
            List<UserTicketEx> participations = EnrollmentDAOFacade.getEnrollmentExs(con, daos, ticket, event);
View Full Code Here

    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

    }

    @Override
    protected Void doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        if (!daos.getUserAccess().exists(con, userId))
            throw new PartakeException(UserErrorCode.INVALID_USER_ID);

        // If |user| does not publish their events, return immediately.
        UserPreference pref = daos.getUserPreferenceAccess().find(con, userId);
        if (pref == null)
            pref = UserPreference.getDefaultPreference(userId);
        if (!pref.isProfilePublic())
            throw new PartakeException(UserErrorCode.INVALID_USER_PRIVATE);

        user = UserDAOFacade.getUserEx(con, daos, userId);

        getEventsFromDB(con, daos);
View Full Code Here

            this.eventsRetrieved = eventDao.findByOwnerId(con, user.getId(), EventFilterCondition.PUBLISHED_PUBLIC_EVENT_ONLY, offset, limit);
        } else if ("editor".equalsIgnoreCase(queryType)) {
            this.numTotalEvents = eventDao.countByEditorUserId(con, user.getId(), EventFilterCondition.PUBLISHED_PUBLIC_EVENT_ONLY);
            this.eventsRetrieved = eventDao.findByEditorUserId(con, user.getId(), EventFilterCondition.PUBLISHED_PUBLIC_EVENT_ONLY, offset, limit);
        } else {
            throw new PartakeException(UserErrorCode.INVALID_ARGUMENT);
        }
    }
View Full Code Here

TOP

Related Classes of in.partake.base.PartakeException

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.