Exemple #1
0
  /**
   * @param restoreNode
   * @return ActivityNode
   * @throws ActivityServiceException
   */
  public ActivityNode copyTo(ActivityNode restoreNode) throws ActivityServiceException {
    super.copyTo(restoreNode);
    restoreNode.setPosition(this.getPosition());
    restoreNode.setInReplyTo(this.getInReplyToId(), this.getInReplyToUrl());
    restoreNode.setAssignedTo(this.getAssignedToName(), this.getAssignedToId());

    FieldList textFields = this.getTextFields();
    FieldList dateFields = this.getDateFields();
    FieldList personFields = this.getPersonFields();
    FieldList bookmarkFields = this.getBookmarkFields();
    FieldList fileFields = this.getFileFields();
    List<Field> listOfFields = new ArrayList<Field>();
    for (Field fd : textFields) {
      listOfFields.add(fd);
    }
    for (Field fd : dateFields) {
      listOfFields.add(fd);
    }
    for (Field fd : personFields) {
      listOfFields.add(fd);
    }
    for (Field fd : bookmarkFields) {
      listOfFields.add(fd);
    }
    for (Field fd : fileFields) {
      listOfFields.add(fd);
    }
    restoreNode.setFields(listOfFields);
    return restoreNode;
  }
 @Before
 public void init() {
   activity = createActivity();
   addSnippetParam("sample.activityId", activity.getActivityId());
   activityNode = createActivityNode(activity.getActivityId(), "Entry");
   addSnippetParam("sample.activityNodeId", activityNode.getActivityId());
 }
 @After
 public void destroy() {
   deleteActivityNode(activityNode.getActivityId());
   deleteActivity(activity.getActivityId());
 }