Package com.agiletec.plugins.jpcontentfeedback.aps.system.services.contentfeedback.comment.model

Examples of com.agiletec.plugins.jpcontentfeedback.aps.system.services.contentfeedback.comment.model.CommentSearchBean


  @Override
  public List<String> getCommentIds() {
    List<String> comments = new ArrayList<String>();
    try {
      CommentSearchBean searchBean = (CommentSearchBean) this.getSearchBean();
      searchBean.setSort(ICommentSearchBean.SORT_DESC);
      comments = this.getCommentManager().searchCommentIds(searchBean);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getCommentIds");
    }
    return comments;
View Full Code Here


    }
    return SUCCESS;
  }

  private ICommentSearchBean prepareSearchBean() {
    CommentSearchBean searchBean = new CommentSearchBean();
    searchBean.setComment(this.getText());
    searchBean.setUsername(this.getAuthor());
    searchBean.setCreationFROMDate(this.getFrom());
    searchBean.setCreationTODate(this.getTo());
    searchBean.setStatus(this.getStatus());
    return searchBean;
  }
View Full Code Here

      if (StringUtils.isBlank(contentId)) {
        ApsSystemUtils.getLogger().error("Content id null");
        return commentIds;
      }
      if (this.isAuth(contentId)) {
        CommentSearchBean searchBean = new CommentSearchBean();
        searchBean.setContentId(contentId);
        searchBean.setStatus(Comment.STATUS_APPROVED);
        commentIds = this.getCommentManager().searchCommentIds(searchBean);
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getContentCommentIds");
      throw new RuntimeException("Error", t);
View Full Code Here

      assertEquals(comment.getStatus(), commentRead.getStatus());
      assertEquals(comment.getUsername(), commentRead.getUsername());
      assertEquals(comment.getId(), commentRead.getId());
      assertEquals(Comment.STATUS_TO_APPROVE, commentRead.getStatus());

      CommentSearchBean searchBean = new CommentSearchBean();
      searchBean.setComment("Testo ");
      listaIds = this._commentManager.searchCommentIds(searchBean);
      assertEquals(1, listaIds.size());

    // Ricerca per data successiva a publicazione
      searchBean = new CommentSearchBean();
      searchBean.setComment("Testo ");
      searchBean.setCreationFROMDate(new Date(System.currentTimeMillis()+24*60*60*1000));
      searchBean.setStatus(0);
      searchBean.setUsername("username");
      listaIds = this._commentManager.searchCommentIds(searchBean);
      assertEquals(0, listaIds.size());

    // Ricerca elemento esatto con qualsiasi stato
      searchBean = new CommentSearchBean();
      searchBean.setComment("Testo ");
      searchBean.setCreationFROMDate(new Date(System.currentTimeMillis()));
      searchBean.setStatus(0);
      searchBean.setUsername("username");
      listaIds = this._commentManager.searchCommentIds(searchBean);
      assertEquals(1, listaIds.size());

    // Ricerca per commento errato
      searchBean = new CommentSearchBean();
      searchBean.setComment("ciccio");
      listaIds = this._commentManager.searchCommentIds(searchBean);
      assertEquals(0, listaIds.size());

    // Ricerca per titolo errato
      searchBean = new CommentSearchBean();
      searchBean.setComment("ciccio");
      searchBean.setStatus(Comment.STATUS_NOT_APPROVED);
      listaIds = this._commentManager.searchCommentIds(searchBean);
      assertEquals(0, listaIds.size());
      // Ricerca per titolo errato
      searchBean = new CommentSearchBean();
      searchBean.setStatus(Comment.STATUS_TO_APPROVE);
      listaIds = this._commentManager.searchCommentIds(searchBean);
      assertEquals(1, listaIds.size());

    } catch (Throwable t) {
      t.printStackTrace();
View Full Code Here

  @AfterReturning(
      pointcut="execution(* com.agiletec.plugins.jacms.aps.system.services.content.IContentManager.deleteContent(..)) && args(content)")
  public void deleteAllComments(Content content) throws ApsSystemException{
    try {
      String contentId = content.getId();
      CommentSearchBean searcherBean = new CommentSearchBean();
      searcherBean.setContentId(contentId);
      List<String> ids = this.searchCommentIds(searcherBean);
      for (int i = 0; i< ids.size();i++){
        this.deleteComment(Integer.parseInt(ids.get(i)));
      }
            this.notifyEvent(contentId, -1, ContentFeedbackChangedEvent.CONTENT_COMMENT, ContentFeedbackChangedEvent.REMOVE_OPERATION_CODE);
View Full Code Here

      assertEquals(Action.SUCCESS, result1);

      this.initAction("/do/jpcontentfeedback/FrontEnd/contentfeedback", "insert");
      assertEquals(TokenInterceptor.INVALID_TOKEN_CODE, this.executeAction());

      CommentSearchBean searchBean = new CommentSearchBean();
      searchBean.setComment("Testo ");
      listaIds = this._commentManager.searchCommentIds(null);
      assertEquals(1, listaIds.size());

      this.initAction("/do/jpcontentfeedback/FrontEnd/contentfeedback", "delete");
      this.addParameter("contentId", listaIds.get(0));
View Full Code Here

      this.addParameter("title", "testTitle");
      this.addParameter("commentText", "testComment");
      String result2 = this.executeAction();
      assertEquals(Action.SUCCESS, result2);

      CommentSearchBean searchBean = new CommentSearchBean();
      searchBean.setComment("Testo ");

      CommentSearchBean sb = new CommentSearchBean();
      sb.setSort(ICommentSearchBean.SORT_ASC);
      listaIds = this._commentManager.searchCommentIds(sb);
      assertEquals(2, listaIds.size());

      // Inserimento votazione su commento 1
      this.initAction("/do/jpcontentfeedback/FrontEnd/contentfeedback", "insertCommentVote");
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpcontentfeedback.aps.system.services.contentfeedback.comment.model.CommentSearchBean

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.