Package com.melitronic.domain.entity

Examples of com.melitronic.domain.entity.Item


    super.persist(e, em, context);
   
  }

    public Item store(Item item, Deployment deployment, EntityManager em, CallContext context) {
      Item last = null;
      boolean isNew = item.getId() == null;
      deployment = (Deployment)PmDeployment.instance().refresh(deployment, em, context);
      if (isNew) {
          Collection<Item> items = deployment.getItems();
          if (items != null && items.size() > 0) {
            for (Item i : items) {
              if (i.getNextId() == null) {
                last = i;
                break;
              }
            }
          }
      }
      else {
        item = (Item)refresh(item, em, context);
      }
     
      if (item.getItemKey() == null) {
        Product product = deployment.getProduct();
        String prefix = product.getPrefix();
       
        if (product.getLastKey() == null) {
          product.setLastKey(new Long(1));
        }
        else {
          product.setLastKey(new Long(product.getLastKey().longValue() + 1));
        }
        persist(product, em, context);
       
        item.setItemKey((prefix != null ? prefix : "") + "-" + product.getLastKey() );
      }
     
      item.setDeployment(deployment);
      persist(item, em, context);
     
      if (isNew && last !=null) {
        last.setNextId(item.getId());
        PmItem.instance().store(last, deployment, em, context);
      }
     
      return item;
    }
View Full Code Here


     
      return item;
    }
 
    public Item store(Item item, Sprint sprint, EntityManager em, CallContext context) {
      Item lastItem = null;
      ItemImplementation last = null;
      boolean isNew = item.getId() == null;
      sprint = (Sprint)PmDeployment.instance().refresh(sprint, em, context);
      Deployment deployment = sprint.getDeployment();
     
      if (isNew) {
          Collection<ItemImplementation> iic = sprint.getItemImplementation();
          if (iic != null && iic.size() > 0) {
            for (ItemImplementation ii : iic) {
              if (ii.getNextId() == null) {
                last = ii;
                break;
              }
            }
          }
         
          Collection<Item> items = deployment.getItems();
          if (items != null && items.size() > 0) {
            for (Item i : items) {
              if (i.getNextId() == null) {
                lastItem = i;
                break;
              }
            }
          }
      }
      else {
        item = (Item)refresh(item, em, context);
      }
     
      if (item.getItemKey() == null) {
        Product product = deployment.getProduct();
        String prefix = product.getPrefix();
       
        if (product.getLastKey() == null) {
          product.setLastKey(new Long(1));
        }
        else {
          product.setLastKey(new Long(product.getLastKey().longValue() + 1));
        }
        persist(product, em, context);
       
        item.setItemKey((prefix != null ? prefix : "") + "-" + product.getLastKey() );
      }
     
      item.setDeployment(deployment);
      persist(item, em, context);
     
      if (isNew) {       
        ItemImplementation itemImplementation = new ItemImplementation();
        itemImplementation.setSprint(sprint);
        itemImplementation.setItem(item);
        persist(itemImplementation, em, context);
       
        if (last != null) {
          last.setNextId(itemImplementation.getId());
          persist(last, em, context);
        }
        if (lastItem != null) {
          lastItem.setNextId(item.getId());
          persist(lastItem, em, context);
        }
      }
     
      return item;
View Full Code Here

     
      return item;
    }
 
    public void changePositions(Item entity, EntityManager em, CallContext context) {
    Item it = (Item)PmDeployment.instance().findById(entity, em, context);
    it.setNextId(entity.getNextId());
    persist(it, em, context);
    }
View Full Code Here

    persist(it, em, context);
    }

    public void move(Long itemId, Deployment newParent, Long before, EntityManager em, CallContext context) {
      // item->item; deployment list
      Item item = new Item();
      item.setId(itemId);
      item = (Item)findById(item, em, context);
     
      Deployment oldParent = item.getDeployment();
      newParent = (Deployment)PmDeployment.instance().findById(newParent, em, context);
     
      if (item.getId() != null && before != null && item.getId().longValue() == before.longValue()) {
        return;
      }
     
      if ( oldParent != null && oldParent.getItems().contains(item) ) {
        Long n = item.getNextId();
        for (Item i : oldParent.getItems()) {
          if (i.getNextId() != null && i.getNextId().longValue() == item.getId().longValue()) {
            i.setNextId(n);
            persist(i, em, context);
            break;
          }
        }
        oldParent.getItems().remove(item);
      }
     
    item.setDeployment(newParent);
    for (Item i : newParent.getItems()) {
      if ( before != null && i.getNextId() != null &&
        i.getNextId().longValue() == before.longValue() ) {
        i.setNextId(item.getId());
        persist(i, em, context);
        break;
      }
      else if ( before == null && i.getNextId() == null ) {
        i.setNextId(item.getId());
        persist(i, em, context);
        break;
      }
    }
    newParent.getItems().add(item);
    item.setNextId(before);
    persist(item, em, context);
     
    }
View Full Code Here

      }
    }

    public void move(Long itemId, Long iiId, Sprint newParent, Long before, EntityManager em, CallContext context) {
      // item->item; sprint list
      Item item = new Item();
      item.setId(itemId);
      item = (Item)findById(item, em, context);
     
      newParent = (Sprint)PmSprint.instance().findById(newParent, em, context);
     
      Sprint oldParent = null;
      ItemImplementation moved = null;
      if (iiId != null) {
        moved = PmItemImplementation.instance().findById(iiId, em, context);
         
          if (moved != null) {
            oldParent = moved.getSprint();

            for (ItemImplementation ii : oldParent.getItemImplementation()) {
              if (ii.getNextId() != null &&
                moved.getId() != null && ii.getNextId().longValue() == moved.getId().longValue()) {
                ii.setNextId(moved.getNextId());
                persist(ii, em, context);
                break;
              }
            }
          }
         
      if (oldParent != null && oldParent.getId().longValue() != newParent.getId().longValue()) {
        oldParent.getItemImplementation().remove(moved);
      }
      }
     
      Long nextId = null;
      if (moved != null) {
          for (ItemImplementation ii : newParent.getItemImplementation()) {
            if (before != null && ii.getItem().getId().longValue() == before.longValue()) {
              nextId = ii.getId();
              break;
            }
          }
          for (ItemImplementation ii : newParent.getItemImplementation()) {
            if (nextId != null && ii.getNextId() != null && ii.getNextId().longValue() == nextId.longValue()) {
              ii.setNextId(moved.getId());
              persist(ii, em, context);
              break;
            }
          }
          moved.setNextId(nextId);
          if (before == null && newParent.getFirstItemImplementation() != null) {
            moved.setNextId(newParent.getFirstItemImplementation().getId());
          }
      if (oldParent.getId().longValue() != newParent.getId().longValue()) {
        newParent.getItemImplementation().add(moved);
        moved.setSprint(newParent);
      }
     
          persist(moved, em, context);
          return;
      }
       
      if (newParent != null && !newParent.getItems().contains(item)) {
        ItemImplementation ii = item.getUncommittedItemImplementation();
        if (ii != null || ii.getId() == null) {
          ii.setSprint(newParent);
          ii.setItem(item);
          ItemImplementation prevIi = newParent.getFirstItemImplementation();
          ii.setNextId(prevIi != null ? prevIi.getId() : null);
          newParent.getItemImplementation().add(ii);
         
          persist(ii, em, context);
        }
        else {
        ii = new ItemImplementation();
        ii.setItem(item);
        item.getItemImplementation().add(ii);
        ii.setSprint(newParent);
        newParent.getItemImplementation().add(ii);
       
        persist(ii, em, context);
        }
View Full Code Here

        team.setSprint(sprintColl);
        for (Sprint sprint : team.getSprint()) {
          sprint.getTeam();
          for (ItemImplementation ii : sprint.getItemImplementation()) {
            ii.getSprint();
            Item item = ii.getItem();
            String name = item.getClass().getName();
            for (Task task : ii.getTasks()) {
              TeamMember tm = task.getTeamMember();
              if (tm != null) {
                tm.getPerson();
              }
View Full Code Here

      return resp;
    }
   
    public Item store(Item item, Deployment deployment, CallContext context) {

      Item resp = PmItem.instance().store(item, deployment, em, context);
     
      return resp;
    }
View Full Code Here

      return resp;
    }
   
    public Item store(Item item, Sprint sprint, CallContext context) {

      Item resp = PmItem.instance().store(item, sprint, em, context);
     
      return resp;
    }
View Full Code Here

      return resp;
    }
   
    public Item store(Item item, ItemGroup itemgroup, CallContext context) {

      Item resp = PmItem.instance().store(item, itemgroup, em, context);
     
      return resp;
    }
View Full Code Here

    deployment.setDescription("jaada jaada jaada...\npada pada pada");
    deployment.setProduct(product);
    product.getDeployment().add(deployment);
    PmDeployment.instance().persist(deployment, em, context);
   
      Item item = new Item();
      item.setSummary("Item 1.3 summary");
      item.setEffort(new Integer(5));
      item.setItemKey("P1-3");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (7*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("diiba daaba\njou jou");
      item.setItemType(ItemType.FEATURE);
      item.setDeployment(deployment);
      deployment.getItems().add(item);
      PmDeployment.instance().persist(item, em, context);

        Task task = new Task();
        task.setName("Task 1.3.2 name");
        task.setEstimation(new Integer(8));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        ItemImplementation ii = new ItemImplementation();
        item.getItemImplementation().add(ii);
        ii.setItem(item);
        PmDeployment.instance().persist(ii, em, context);
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          TaskEstimation tes = new TaskEstimation();
          tes.setEstimation(new Integer(8));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (3*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

        Task prevTask = task;
        task = new Task();
        task.setName("Task 1.3.1 name");
        task.setEstimation(new Integer(5));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        task.setNextId(prevTask.getId());
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(5));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (2*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

      Item prevItem = item;
      item = new Item();
      item.setSummary("Item 1.2 summary");
      item.setEffort(new Integer(14));
      item.setItemKey("P1-2");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("diiba daaba\njou jou");
      item.setItemType(ItemType.FEATURE);
      item.setNextId(prevItem.getId());
      item.setDeployment(deployment);
      deployment.getItems().add(item);
      PmDeployment.instance().persist(item, em, context);

        task = new Task();
        task.setName("Task 1.2.2 name");
        task.setEstimation(new Integer(8));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        ii = new ItemImplementation();
        item.getItemImplementation().add(ii);
        ii.setItem(item);
        PmDeployment.instance().persist(ii, em, context);
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(8));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (1*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);
 
        prevTask = task;
        task = new Task();
        task.setName("Task 1.2.1 name");
        task.setEstimation(new Integer(5));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        task.setNextId(prevTask.getId());
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(5));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (2*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

      prevItem = item;
      item = new Item();
      item.setSummary("Item 1.1 summary");
      item.setEffort(new Integer(8));
      item.setItemKey("P1-1");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("diiba daaba\njou jou");
      item.setItemType(ItemType.FEATURE);
      item.setNextId(prevItem.getId());
      item.setDeployment(deployment);
      deployment.getItems().add(item);
      PmDeployment.instance().persist(item, em, context);

        task = new Task();
        task.setName("Task 1.1.2 name");
        task.setEstimation(new Integer(8));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        ii = new ItemImplementation();
        item.getItemImplementation().add(ii);
        ii.setItem(item);
        PmDeployment.instance().persist(ii, em, context);
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(8));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (1*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);
 
        prevTask = task;
        task = new Task();
        task.setName("Task 1.1.1 name");
        task.setEstimation(new Integer(5));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        task.setNextId(prevTask.getId());
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(5));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

    Deployment prevDeployment = deployment;
    deployment = new Deployment();
    deployment.setName("release 1.2");
    deployment.setReleaseNumber("01");
    deployment.setVersionNumber("02");
    cal = GregorianCalendar.getInstance();
    cal.setTimeInMillis(System.currentTimeMillis() - (4* 7 * 24 * 60 * 60 * 1000));
    deployment.setStartTime(cal);
    cal = GregorianCalendar.getInstance();
    cal.setTimeInMillis(System.currentTimeMillis());
    deployment.setReleaseTime(cal);
    deployment.setDescription("jaada jaada jaada...\npada pada pada");
    deployment.setNextId(prevDeployment.getId());
    deployment.setProduct(product);
    product.getDeployment().add(deployment);
    PmDeployment.instance().persist(deployment, em, context);
   
      item = new Item();
      item.setSummary("Item 2.3 summary");
      item.setEffort(new Integer(5));
      item.setItemKey("P1-6");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (7*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("diiba daaba\njou jou");
      item.setItemType(ItemType.FEATURE);
      item.setDeployment(deployment);
      deployment.getItems().add(item);
      PmDeployment.instance().persist(item, em, context);

        task = new Task();
        task.setName("Task 2.3.2 name");
        task.setEstimation(new Integer(8));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        ii = new ItemImplementation();
        item.getItemImplementation().add(ii);
        ii.setItem(item);
        PmDeployment.instance().persist(ii, em, context);
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(8));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (4*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);
 
        prevTask = task;
        task = new Task();
        task.setName("Task 2.3.1 name");
        task.setEstimation(new Integer(5));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        task.setNextId(prevTask.getId());
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(5));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (5*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

      prevItem = item;
      item = new Item();
      item.setSummary("Item 2.2 summary");
      item.setEffort(new Integer(14));
      item.setItemKey("P1-5");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("diiba daaba\njou jou");
      item.setItemType(ItemType.FEATURE);
      item.setNextId(prevItem.getId());
      item.setDeployment(deployment);
      deployment.getItems().add(item);
      PmDeployment.instance().persist(item, em, context);

        task = new Task();
        task.setName("Task 2.2.2 name");
        task.setEstimation(new Integer(8));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        ii = new ItemImplementation();
        item.getItemImplementation().add(ii);
        ii.setItem(item);
        PmDeployment.instance().persist(ii, em, context);
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(8));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (1*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);
 
        prevTask = task;
        task = new Task();
        task.setName("Task 2.2.1 name");
        task.setEstimation(new Integer(5));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        task.setNextId(prevTask.getId());
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(5));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (2*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

      prevItem = item;
      item = new Item();
      item.setSummary("Item 2.1 summary");
      item.setEffort(new Integer(8));
      item.setItemKey("P1-4");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("diiba daaba\njou jou");
      item.setItemType(ItemType.FEATURE);
      item.setNextId(prevItem.getId());
      item.setDeployment(deployment);
      deployment.getItems().add(item);
      PmDeployment.instance().persist(item, em, context);

        task = new Task();
        task.setName("Task 2.1.2 name");
        task.setEstimation(new Integer(8));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        ii = new ItemImplementation();
        item.getItemImplementation().add(ii);
        ii.setItem(item);
        PmDeployment.instance().persist(ii, em, context);
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(8));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (3*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);
 
        prevTask = task;
        task = new Task();
        task.setName("Task 2.1.1 name");
        task.setEstimation(new Integer(5));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        task.setNextId(prevTask.getId());
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(5));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (2*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

    prevDeployment = deployment;
    deployment = new Deployment();
    deployment.setName("release 1.1");
    deployment.setReleaseNumber("01");
    deployment.setVersionNumber("01");
    cal = GregorianCalendar.getInstance();
    cal.setTimeInMillis(System.currentTimeMillis() - (8 * 7 * 24 * 60 * 60 * 1000));
    deployment.setStartTime(cal);
    cal = GregorianCalendar.getInstance();
    cal.setTimeInMillis(System.currentTimeMillis() - (4 * 7 * 24 * 60 * 60 * 1000));
    deployment.setReleaseTime(cal);
    deployment.setDescription("jaada jaada jaada...\npada pada pada");
    deployment.setNextId(prevDeployment.getId());
    deployment.setProduct(product);
    product.getDeployment().add(deployment);
    PmDeployment.instance().persist(deployment, em, context);

      item = new Item();
      item.setSummary("Item 3.3 summary");
      item.setEffort(new Integer(5));
      item.setItemKey("P1-9");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (7*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("diiba daaba\njou jou");
      item.setItemType(ItemType.FEATURE);
      item.setDeployment(deployment);
      deployment.getItems().add(item);
      PmDeployment.instance().persist(item, em, context);

        task = new Task();
        task.setName("Task 3.3.2 name");
        task.setEstimation(new Integer(8));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        ii = new ItemImplementation();
        item.getItemImplementation().add(ii);
        ii.setItem(item);
        PmDeployment.instance().persist(ii, em, context);
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(8));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (3*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);
 
        prevTask = task;
        task = new Task();
        task.setName("Task 3.3.1 name");
        task.setEstimation(new Integer(5));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        task.setNextId(prevTask.getId());
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(5));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (5*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

      prevItem = item;
      item = new Item();
      item.setSummary("Item 3.2 summary");
      item.setEffort(new Integer(14));
      item.setItemKey("P1-8");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("diiba daaba\njou jou");
      item.setItemType(ItemType.FEATURE);
      item.setNextId(prevItem.getId());
      item.setDeployment(deployment);
      deployment.getItems().add(item);
      PmDeployment.instance().persist(item, em, context);

        task = new Task();
        task.setName("Task 3.2.2 name");
        task.setEstimation(new Integer(8));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        ii = new ItemImplementation();
        item.getItemImplementation().add(ii);
        ii.setItem(item);
        PmDeployment.instance().persist(ii, em, context);
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(8));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (1*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);
 
        prevTask = task;
        task = new Task();
        task.setName("Task 3.2.1 name");
        task.setEstimation(new Integer(5));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        task.setNextId(prevTask.getId());
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(5));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (3*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

      prevItem = item;
      item = new Item();
      item.setSummary("Item 3.1 summary");
      item.setEffort(new Integer(8));
      item.setItemKey("P1-7");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("diiba daaba\njou jou");
      item.setItemType(ItemType.FEATURE);
      item.setNextId(prevItem.getId());
      item.setDeployment(deployment);
      deployment.getItems().add(item);
      PmDeployment.instance().persist(item, em, context);

        task = new Task();
        task.setName("Task 3.1.2 name");
        task.setEstimation(new Integer(8));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
       
            Team team = new Team();
            team.setName("Team 1");
            product.getTeam().add(team);
            team.getProduct().add(product);
            PmDeployment.instance().persist(team, em, context);
           
          Sprint sprint = new Sprint();
          sprint.setName("P1, Sprint 1");
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (7*24*60*60*1000));
          sprint.setStartTime(cal);
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() + (21*24*60*60*1000));
          sprint.setEndTime(cal);
          team.getSprint().add(sprint);
          sprint.setTeam(team);
          sprint.setDeployment(deployment);
          PmDeployment.instance().persist(sprint, em, context);
       
        ii = new ItemImplementation();
        item.getItemImplementation().add(ii);
        ii.setItem(item);
        sprint.getItemImplementation().add(ii);
        ii.setSprint(sprint);
        PmDeployment.instance().persist(ii, em, context);
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
       
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(8));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (1*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
         
          PmDeployment.instance().persist(tes, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(5));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (3*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);
 
          PmDeployment.instance().persist(tes, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(10));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (7*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);
 
        prevTask = task;
        task = new Task();
        task.setName("Task 3.1.1 name");
        task.setEstimation(new Integer(5));
        task.setDescription("xxxxxxxx\nyyyyyyyyy");
        task.setTaskStatus(TaskStatus.NOT_STARTED);
        task.setNextId(prevTask.getId());
        ii.getTasks().add(task);
        task.setItemImplementation(ii);
        PmDeployment.instance().persist(task, em, context);
          tes = new TaskEstimation();
          tes.setEstimation(new Integer(5));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (2*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

          tes = new TaskEstimation();
          tes.setEstimation(new Integer(10));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (5*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

          tes = new TaskEstimation();
          tes.setEstimation(new Integer(12));
          cal = GregorianCalendar.getInstance();
          cal.setTimeInMillis(System.currentTimeMillis() - (7*24*60*60*1000));
          tes.setEstimationDate(new Date(cal.getTimeInMillis()));
          tes.setTask(task);
          PmDeployment.instance().persist(tes, em, context);

      Person person = new Person();
    person.setFirstName("John");
    person.setLastName("Doe");
    person.setUserId("john");
    person.setPassword("password");
    PmDeployment.instance().persist(person, em, context);
   
    TeamMember teamMember = new TeamMember();
    teamMember.setRole("admin");
    teamMember.setPerson(person);
    teamMember.setTeam(team);
    PmDeployment.instance().persist(teamMember, em, context);
   
    person = new Person();
    person.setFirstName("Jane");
    person.setLastName("Doe");
    person.setUserId("jane");
    person.setPassword("password");
    PmDeployment.instance().persist(person, em, context);
   
    teamMember = new TeamMember();
    teamMember.setRole("member");
    teamMember.setPerson(person);
    teamMember.setTeam(team);
    PmDeployment.instance().persist(teamMember, em, context);

    person = new Person();
    person.setFirstName("Arnold");
    person.setLastName("Schwarzenegger");
    person.setUserId("arnold");
    person.setPassword("password");
    PmDeployment.instance().persist(person, em, context);
   
    teamMember = new TeamMember();
    teamMember.setRole("owner");
    teamMember.setPerson(person);
    teamMember.setTeam(team);
    PmDeployment.instance().persist(teamMember, em, context);

    person = new Person();
    person.setFirstName("Demo");
    person.setLastName("Demo");
    person.setUserId("demo");
    person.setPassword("");
    PmDeployment.instance().persist(person, em, context);
   
    teamMember = new TeamMember();
    teamMember.setRole("owner");
    teamMember.setPerson(person);
    teamMember.setTeam(team);
    PmDeployment.instance().persist(teamMember, em, context);

    ItemGroup ig = new ItemGroup();
    ig.setName("Itemgroup 2");
    ig.setProduct(product);
    product.getItemGroup().add(ig);
    PmDeployment.instance().persist(ig, em, context);
   
      item = new Item();
      item.setSummary("Item 4.2 summary");
      item.setEffort(new Integer(14));
      item.setItemKey("P1-2");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("brevbirvdncvenrclndc");
      item.setItemType(ItemType.FEATURE);
      //item.setNextId(prevItem.getId());
      item.setItemGroup(ig);
      ig.getItem().add(item);
      PmDeployment.instance().persist(item, em, context);

      prevItem = item;
      item = new Item();
      item.setSummary("Item 4.1 summary");
      item.setEffort(new Integer(10));
      item.setItemKey("P1-3");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (3*24*60*60*1000));
      item.setDueDate(cal);
      item.setDescription("xxxxxxxxxxxxxx\nyyyyyyyyyyyyy");
      item.setItemType(ItemType.FEATURE);
      item.setNextId(prevItem.getId());
      item.setItemGroup(ig);
      ig.getItem().add(item);
      PmDeployment.instance().persist(item, em, context);

    ItemGroup prevItemGroup = ig;
View Full Code Here

TOP

Related Classes of com.melitronic.domain.entity.Item

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.