Package com.melitronic.domain.entity

Examples of com.melitronic.domain.entity.Product


      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);
     
View Full Code Here


      if (!isNew) {
        item = (Item)refresh(item, em, context);
      }
     
      if (item.getItemKey() == null) {
        Product product = itemgroup.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.setItemGroup(itemgroup);
      persist(item, em, context);
     
View Full Code Here

      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);
     
View Full Code Here

    public void generateTestData(CallContext context) {
      ProductUtil.generateTestData(em, context);
    }
   
    public Collection<Deployment> findDeplyments(Long productId, CallContext context) {
      Product product = null;
      if (productId == null) {
        product = PmProduct.instance().findFirstProduct(em);
      }
      else {
        product = PmProduct.instance().findProduct(productId, em);
      }
     
      for (Deployment depl : product.getDeployment()) {
        depl.getProduct();
        for (Item item : depl.getItems()) {
          for (ItemImplementation ii : item.getItemImplementation()) {
            for (Task task : ii.getTasks()) {
              task.getId();
            }
          }
          if (item instanceof Issue) {
            for (Action action : ((Issue)item).getAction()) {
              Person person = action.getPerson();
              if (person != null) {
                person.getId();
              }
            }
          }
        }
      }
       
      return product.getDeployment();
    }
View Full Code Here

      return resp;
    }
   
    public Collection<Team> findTeams(Long productId, CallContext context) {
     
      Product product = null;
      if (productId == null) {
        product = PmProduct.instance().findFirstProduct(em);
      }
      else {
        product = PmProduct.instance().findProduct(productId, em);
      }
     
      for (Team team : product.getTeam()) {
        Collection<Sprint> sprintColl = PmTeam.instance().findSprintByProduct(team, product, em);
        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();
              }
            }
          }
        }
        for (TeamMember tm : team.getTeamMember()) {
          for (TeamMember tm2 : tm.getPerson().getTeamMember()) {
            tm2.getTeam();
            for (Task tsk : tm2.getTask()) {
              tsk.getTeamMember();
            }
          }
        }
      }
       
      return product.getTeam();
    }
View Full Code Here

    public void updateTeamPersons(Team team, Collection<Person> persons, CallContext context) {
      PmTeam.instance().updateTeamPersons(team, persons, em, context);
    }
   
    public Collection<ItemGroup> findItemGroups(Long productId, IssueSearchCriterias issueSearchCriteries, CallContext context) {
      Product product = null;
      if (productId == null) {
        product = PmProduct.instance().findFirstProduct(em);
      }
      else {
        product = PmProduct.instance().findProduct(productId, em);
      }
      if (product.getItemGroup().size() == 0) {
      ItemGroup ig = new ItemGroup();
      ig.setName("Itemgroup");
      ig.setProduct(product);
      product.getItemGroup().add(ig);
      PmDeployment.instance().persist(ig, em, context);
     
      product = PmProduct.instance().findProduct(product.getId(), em);
      }
     
      Collection<ItemGroup> igs = null;
      if (issueSearchCriteries == null) {
        igs = product.getItemGroup();
      }
      else {
        Collection<Item> items = PmItemGroup.instance().findItemGroups(product, issueSearchCriteries, em, context);
        HashMap<Long, ItemGroup> igmap = new HashMap<Long, ItemGroup>();
        for (Item i : items) {
View Full Code Here

import net.sourceforge.jivalo.fw.common.context.CallContext;

public class ProductUtil {

  public static void generateTestData(EntityManager em, CallContext context) {
    Product product = new Product();
    product.setName("Product 1");
    product.setPrefix("P1");
    product.setLastKey(new Long(9));
    PmProduct.instance().persist(product, em, context);

    Deployment deployment = new Deployment();
    deployment.setName("release 1.3");
    deployment.setReleaseNumber("01");
    deployment.setVersionNumber("03");
    Calendar cal = GregorianCalendar.getInstance();
    cal.setTimeInMillis(System.currentTimeMillis() + (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.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;
    ig = new ItemGroup();
    ig.setName("Itemgroup 1");
    ig.setProduct(product);
    ig.setNextId(prevItemGroup.getId());
    product.getItemGroup().add(ig);
    PmDeployment.instance().persist(ig, em, context);
   
      Issue issue = new Issue();  
      issue.setSummary("Issue 5.1");
      issue.setEffort(new Integer(4));
      issue.setItemKey("P1-9");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (2*24*60*60*1000));
      issue.setDueDate(cal);
      issue.setDescription("isisisisisisisis");
      issue.setItemType(ItemType.BUG);
      issue.setPriority(IssuePriority.CRITICAL);
      issue.setResolution(IssueResolution.FIXED);
      //issue.setNextId(prevItem.getId());
      issue.setItemGroup(ig);
      ig.getItem().add(issue);
      PmDeployment.instance().persist(issue, em, context);

        Action action = new Action();
        action.setActionType(ActionType.STATUS_CHANGED);
        action.setActionStatus(ItemActionStatus.CLOSED);
        action.setItem(issue);
        PmDeployment.instance().persist(action, em, context);
       
   
      Issue prevIssue = issue;
      issue = new Issue();  
      issue.setSummary("Issue 5.2 - 09:10:52,515 INFO  [SessionSpecContainer]");
      issue.setEffort(new Integer(1));
      issue.setItemKey("P1-8");
      cal = GregorianCalendar.getInstance();
      cal.setTimeInMillis(System.currentTimeMillis() + (1*24*60*60*1000));
      issue.setDueDate(cal);
      issue.setDescription("09:10:52,515 INFO  [SessionSpecContainer] Starting jboss.j2ee:ear=melitronicRM.ear,jar=rmDom.jar,name=DmProduct,service=EJB3\n09:10:52,531 INFO  [EJBContainer] STARTED EJB: com.melitronic.domain.product.DmProduct ejbName: DmProduct");
      issue.setItemType(ItemType.IMPROVEMENT);
      issue.setPriority(IssuePriority.MEDIUM);
      issue.setResolution(IssueResolution.UNRESOLVED);
      issue.setNextId(prevIssue.getId());
      issue.setItemGroup(ig);
      ig.getItem().add(issue);
      PmDeployment.instance().persist(issue, em, context);
     
        action = new Action();
        action.setActionType(ActionType.STATUS_CHANGED);
        action.setActionStatus(ItemActionStatus.OPEN);
        action.setItem(issue);
        PmDeployment.instance().persist(action, em, context);
       
        Action prevAction = action;
        action = new Action();
        action.setActionType(ActionType.ASSIGNED_TO);
        action.setPerson(person);
        action.setNextId(prevAction.getId());
        action.setItem(issue);
        PmDeployment.instance().persist(action, em, context);
       
        prevAction = action;
        action = new Action();
        action.setActionType(ActionType.ADDED_COMMENT);
        action.setComment("Ihan turha juttu");
        action.setNextId(prevAction.getId());
        action.setItem(issue);
        PmDeployment.instance().persist(action, em, context);
       
        prevAction = action;
        action = new Action();
        action.setActionType(ActionType.STATUS_CHANGED);
        action.setActionStatus(ItemActionStatus.CLOSED);
        action.setNextId(prevAction.getId());
        action.setItem(issue);
        PmDeployment.instance().persist(action, em, context);
       
       
    ImplementationPhase ip = new ImplementationPhase();
    ip.setPhaseType(ImplementationPhaseType.DEVELOPMENT);
    Calendar scal = GregorianCalendar.getInstance();
    scal.setTimeInMillis(System.currentTimeMillis() - (7*24*60*60*1000));
    ip.setStartTime(scal);
    Calendar ecal = GregorianCalendar.getInstance();
    ecal.setTimeInMillis(System.currentTimeMillis() + (21*24*60*60*1000));
    ip.setEndTime(ecal);
    ip.setDeployment(deployment);
    PmDeployment.instance().persist(ip, em, context);
   
    Environment environment = new Environment();
    environment.setName("Env1");
    environment.setDescription("edededede");
    environment.setIp("123.23.3.123");
    PmDeployment.instance().persist(environment, em, context);
   
    EnvironmentUsage eu = new EnvironmentUsage();
    eu.setStartTime(scal);
    eu.setEndTime(ecal);
    eu.setImplementationPhase(ip);
    eu.setEnvironment(environment);
    eu.getProduct().add(product);
    product.getEnvironmentUsage().add(eu);
    PmDeployment.instance().persist(eu, em, context);
   
    ip = new ImplementationPhase();
    ip.setPhaseType(ImplementationPhaseType.INTEGRATION_TEST);
    scal = GregorianCalendar.getInstance();
    scal.setTimeInMillis(System.currentTimeMillis() + (22*24*60*60*1000));
    ip.setStartTime(scal);
    ecal = GregorianCalendar.getInstance();
    ecal.setTimeInMillis(System.currentTimeMillis() + (30*24*60*60*1000));
    ip.setEndTime(ecal);
    ip.setDeployment(deployment);
    PmDeployment.instance().persist(ip, em, context);
   
    environment = new Environment();
    environment.setName("Env2");
    environment.setDescription("wwwwwwwwww");
    environment.setIp("123.23.3.125");
    PmDeployment.instance().persist(environment, em, context);
   
    eu = new EnvironmentUsage();
    eu.setStartTime(scal);
    eu.setEndTime(ecal);
    eu.setImplementationPhase(ip);
    eu.setEnvironment(environment);
    eu.getProduct().add(product);
    product.getEnvironmentUsage().add(eu);
    PmDeployment.instance().persist(eu, em, context);
   
  }
View Full Code Here

      }
      return "none";
    }

  public Product getSelectedProduct() {
    Product p = getUC() != null ? getUC().getProduct() : null;
    if (p == null) {
      p = new Product();
      p.setName("");
    }
    return p;
  }
View Full Code Here

TOP

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

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.