Package com.steeplesoft.frenchpress.model

Examples of com.steeplesoft.frenchpress.model.Comment


    public String addComment() {
        loadPost();
        comment.setPost(post);
        post.getComments().add(comment);
        postService.updatePost(post);
        comment = new Comment();

        try {
            FacesContext.getCurrentInstance().getExternalContext().redirect(post.getSlug());
        } catch (IOException ex) {
        }
View Full Code Here


        return Constants.VIEW_ADMIN_COMMENTS_INDEX;
    }

    public String delete() {
        // TODO
        Comment toDelete = (Comment) dataTable.getRowData();
        commentService.deleteComment(toDelete);

        return null;
    }
View Full Code Here

    }

    public void loadComment() {
        final FacesContext facesContext = FacesContext.getCurrentInstance();
        if (!facesContext.isPostback()) {
            Comment requestedComment = (Comment) ((ServletRequest) facesContext.getExternalContext().getRequest())
                    .getAttribute("commentId");
            comment = (requestedComment != null) ? requestedComment :
                    commentService.getComment(comment.getId());
        }
    }
View Full Code Here

        em.merge(comment);
    }

    @Transactional
    public void deleteComment(Comment comment) {
        Comment toDelete = em.find(Comment.class, comment.getId());
        if (toDelete != null) {
            em.remove(toDelete);
        }
    }
View Full Code Here

TOP

Related Classes of com.steeplesoft.frenchpress.model.Comment

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.