Examples of CommentImpl


Examples of com.founder.fix.fixflow.core.impl.task.CommentImpl

  }

  public Object execute(CommandContext commandContext) {
    String userId = Authentication.getAuthenticatedUserId();
    CommentImpl comment = new CommentImpl();
    comment.setId(GuidUtil.CreateGuid());
    comment.setUserId(userId);
    comment.setType(CommentImpl.TYPE_COMMENT);
    comment.setTime(ClockUtil.getCurrentTime());
    comment.setTaskId(taskId);
    comment.setProcessInstanceId(processInstanceId);
    // comment.setAction(Event.ACTION_ADD_COMMENT);

    comment.setMessage(message);

    comment.setFullMessage(fullMessage);

    commandContext.getCommentManager().insert(comment);

    return null;
  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.task.CommentImpl

    objectParamWhere.add(parameter.toString());

    List<CommentImpl> commentImplList = new ArrayList<CommentImpl>();

    for (Map<String, Object> dataMap : dataObj) {
      CommentImpl commentImpl = new CommentImpl();
      for (String dataKey : dataMap.keySet()) {

        if (dataKey.equals("ID")) {
          commentImpl.setId(StringUtil.getString(dataMap.get(dataKey)));
        }

        if (dataKey.equals("TYPE")) {
          commentImpl.setType(StringUtil.getString(dataMap.get(dataKey)));
        }

        if (dataKey.equals("TIME")) {
          commentImpl.setTime(StringUtil.getDate(dataMap.get(dataKey)));
        }

        if (dataKey.equals("USER_ID")) {
          commentImpl.setUserId(StringUtil.getString(dataMap.get(dataKey)));
        }

        if (dataKey.equals("TASKINSTANCE_ID")) {
          commentImpl.setTaskId(StringUtil.getString(dataMap.get(dataKey)));
        }

        if (dataKey.equals("PROCESSINSTANCE_ID")) {
          commentImpl.setProcessInstanceId(StringUtil.getString(dataMap.get(dataKey)));
        }

        if (dataKey.equals("ACTION")) {
          commentImpl.setAction(StringUtil.getString(dataMap.get(dataKey)));
        }

        if (dataKey.equals("MESSAGE")) {
          commentImpl.setMessage(StringUtil.getString(dataMap.get(dataKey)));
        }

        if (dataKey.equals("FULL_MSG")) {
          commentImpl.setFullMessage(StringUtil.getString(dataMap.get(dataKey)));
        }

      }
      commentImplList.add(commentImpl);
    }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.CommentImpl

        ExperimentBean expBean = (ExperimentBean)JSFUtil.getManagedObject("ExperimentBean");
        exp = expBean.getExperiment();
       
        log.debug("Recieved comment " + getComment() + " for " + expBean.getEname());
       
        Comment cmt = new CommentImpl(exp.getEntityID(), getExpPhase() );
        if( title == null || "".equals(title) ) {
            title = getComment();
            if ( title.length() > CommentBacking.TITLE_LENGTH )
                title = getComment().substring(0, CommentBacking.TITLE_LENGTH );
        }
        // User is?
        UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
        // Existing comment?
        if( ! "".equals(commentId) && commentId != null ) {
            cmt = cm.getComment(this.getlCommentID());
        } else {
            cmt.setAuthorID(user.getUserid());
            cmt.setExperimentPhaseID( expBean.getCurrentPhaseName() );
        }
        // Edit/update the comment:
        cmt.setParentID( getlParentID() );
        cmt.setExperimentID(exp.getEntityID());
        cmt.setPostDate( java.util.Calendar.getInstance() );
        cmt.setComment(title , this.comment );
       

        // Add or update, depending on commendId:
        if( "".equals(commentId) ) {
            cm.registerComment(cmt, expBean.getID(), getExpPhase() );
View Full Code Here

Examples of eu.planets_project.tb.impl.model.CommentImpl

  @PersistenceContext(unitName="testbed", type=PersistenceContextType.TRANSACTION)
  private EntityManager manager;
 
  public void deleteComment(long id) {
    CommentImpl t_helper = manager.find(CommentImpl.class, id);
    manager.remove(t_helper);
  }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.CommentImpl

    CommentImpl t_helper = manager.find(CommentImpl.class, id);
    manager.remove(t_helper);
  }

  public void deleteComment(CommentImpl comment) {
    CommentImpl t_helper = manager.find(CommentImpl.class, comment.getCommentID());
    manager.remove(t_helper);
  }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.CommentImpl

  /* (non-Javadoc)
   * @see eu.planets_project.tb.api.CommentManager#getNewComment()
   */
  public Comment getNewRootComment(long lExperimentID, String sExperimentPhaseID) {
    CommentImpl c1 = new CommentImpl(lExperimentID, sExperimentPhaseID);
    return c1;
  }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.CommentImpl

  /**
   * @param args
   */
  public static void main(String[] args) {
    CommentManagerImpl manager = CommentManagerImpl.getInstance();
    CommentImpl com1 = (CommentImpl)manager.getNewRootComment(1, "setup");
    Long lExpID = com1.getExperimentID();
    String sPhaseID = com1.getExperimentPhaseID();
    System.out.println("ID: "+lExpID+" Phase: "+sPhaseID);
   
  }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.CommentImpl

      //create two test Comments, note their ID and persist them
      //new root comment with Comment(long lExperimentID, String sExperimentPhaseID)
      //please note: phaseID are not correct
      CommentManagerImpl manager = CommentManagerImpl.getInstance();
      CommentImpl com1 = (CommentImpl)manager.getNewRootComment(1, "setup");
      //Comment com1 = new Comment(1, "setup");
      //System.out.println("Contains? "+manager.containsComment(1));
      commentID1 = dao_r.persistComment(com1);
      CommentImpl find_com1 = dao_r.findComment(commentID1);
      manager.registerComment(find_com1, find_com1.getExperimentID(),find_com1.getExperimentPhaseID());
      System.out.println("XXXContains? "+manager.containsComment(commentID1));
     
      //new root comment
      CommentImpl com2 = (CommentImpl)manager.getNewRootComment(2, "evaluation");
      commentID2 = dao_r.persistComment(com2);
      CommentImpl find_com2 = dao_r.findComment(commentID2);
      manager.registerComment(find_com2, find_com2.getExperimentID(),find_com2.getExperimentPhaseID());
      System.out.println("XXXContains? "+manager.containsComment(commentID2));
     
     
    } catch (NamingException e) {
      //TODO integrate message into logging mechanism
View Full Code Here

Examples of eu.planets_project.tb.impl.model.CommentImpl

  }
 
  public void testEJBEntityDeleted(){
    dao_r.deleteComment(this.commentID1);
    dao_r.deleteComment(dao_r.findComment(commentID2));
    CommentImpl c1,c2;
    try{
      c1 = dao_r.findComment(commentID1);
      c2 = dao_r.findComment(commentID2);
     
    }catch(Exception e){
View Full Code Here

Examples of eu.planets_project.tb.impl.model.CommentImpl

    assertNull(c1);
    assertNull(c2)
  }
 
  public void testEJBEntityUpdated(){
    CommentImpl test_find1 =  dao_r.findComment(commentID1);
    //modify the bean
    long l1 = 1;
    test_find1.setTitle("Title1");
    test_find1.setExperimentID(l1);
    dao_r.updateComment(test_find1);
    //Test1: updating existing entity
    test_find1 =  dao_r.findComment(commentID1);
    assertEquals("Title1",test_find1.getTitle())
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.