Package org.nxplanner.domain

Examples of org.nxplanner.domain.Iteration


    public List fetchEditableIterations() throws HibernateException, AuthenticationException {
        List allIterations = getSession().find(EDITABLE_ITERATIONS_QUERY_STRING);
        List acceptedIterations = new ArrayList();
        for (int i = 0; i < allIterations.size(); i++) {
            Iteration it = (Iteration)allIterations.get(i);
            if (accept(it)) {
                acceptedIterations.add(it);
            }
        }
View Full Code Here


        this.authorizer = authorizer;
        iterationRepository = new IterationRepository(session,authorizer,personId);
    }

    public Iteration getIteration(UserStory story) throws HibernateException {
        Iteration iteration = iterationRepository.getIterationForStory(story);
        return iteration;
    }
View Full Code Here

    }

    public static void main(String[] args) throws Exception {
        FileOutputStream stream = new FileOutputStream("XPlannerStories.pdf");
        PdfExporter exporter = new PdfExporter();
        Iteration iteration = new Iteration();
        ArrayList stories = new ArrayList();

        ArrayList tasks = new ArrayList();
        tasks.add(newTask("Task 1", "Description of Task 1", 2.0));
        tasks.add(newTask("Task 2", "Description of Task 2", 3.0));
        stories.add(newStory("Story 1", new Person(), 1.0, tasks));
        iteration.setUserStories(stories);
        exporter.exportToPdf(iteration, stream);
        stream.close();

    }
View Full Code Here

                session = GlobalSessionFactory.get().openSession();
                List iterations = session.find("from i in " + Iteration.class +
                        " where i.endDate >= ?", new Date(), Hibernate.DATE);
                Date now = new Date();
                for (int i = 0; i < iterations.size(); i++) {
                    Iteration iteration = (Iteration)iterations.get(i);
                    DataSample estimatedHoursSample = new DataSample(now, iteration.getId(),
                            "estimatedHours", iteration.getEstimatedHours());
                    session.save(estimatedHoursSample);
                    DataSample actualHoursSample = new DataSample(now, iteration.getId(),
                            "actualHours", iteration.getActualHours());
                    session.save(actualHoursSample);
                    DataSample remainingHoursSample = new DataSample(now, iteration.getId(),
                            "remainingHours", iteration.getRemainingHours());
                    session.save(remainingHoursSample);
                }
                log.info("committing data sample changes");
                session.flush();
                session.connection().commit();
View Full Code Here

                session = GlobalSessionFactory.get().openSession();
                List iterations = session.find("from i in " + Iteration.class +
                        " where i.endDate >= ?", new Date(), Hibernate.DATE);
                Date now = new Date();
                for (int i = 0; i < iterations.size(); i++) {
                    Iteration iteration = (Iteration)iterations.get(i);
                    DataSample estimatedHoursSample = new DataSample(now, iteration.getId(),
                            "estimatedHours", iteration.getEstimatedHours());
                    session.save(estimatedHoursSample);
                    DataSample actualHoursSample = new DataSample(now, iteration.getId(),
                            "actualHours", iteration.getActualHours());
                    session.save(actualHoursSample);
                    DataSample remainingHoursSample = new DataSample(now, iteration.getId(),
                            "remainingHours", iteration.getRemainingHours());
                    session.save(remainingHoursSample);
                }
                log.info("committing data sample changes");
                session.flush();
                session.connection().commit();
View Full Code Here

      InputStream reportStream = null;
      JRDataSource ds = null;
      Map parameters = new HashMap();

      if (object instanceof Iteration) {
         Iteration iteration = (Iteration)object;

         try {
            ds = new IterationDataSource(iteration, session);
         } catch (HibernateException he) {
            throw new ExportException(he);
         }

         reportStream = PdfReportExporter.class.getClassLoader().getResourceAsStream("org/nxplanner/export/reports/JRIteration.jasper");
         parameters.put("IterationName", iteration.getName());
         parameters.put("IterationStartDate", iteration.getStartDate());
         parameters.put("IterationEndDate", iteration.getEndDate());
      } else if (object instanceof UserStory) {
         UserStory story = (UserStory)object;

         try {
            ds = new UserStoryDataSource(story, session);
View Full Code Here

public class DatabaseMappingsTestScript extends org.nxplanner.acceptance.AbstractDatabaseTestScript{

    public void testMappings() throws Exception {
        Project project = newProject();
        Iteration iteration = newIteration(project);
        UserStory story = newUserStory(iteration);
        Person person = newPerson();
        story.setCustomer(person);
        session.flush();
        session.connection().commit();
View Full Code Here

      IterationRepository dao = new IterationRepository(getSession(), getAuthorizer(), getLoggedInUserId());
      List iterations = dao.fetchEditableIterations();
      List options = new ArrayList();
      for (int i = 0; i < iterations.size(); i++)
      {
         Iteration it = (Iteration) iterations.get(i);
         options.add(new IterationModel(it));
      }
      return options;
   }
View Full Code Here

        project.setName(PROJECT_PREFIX + project.getId());
        return project;
    }

    public Iteration newIteration(Project project) {
        Iteration iteration = new Iteration();
        iteration.setProjectId(project.getId());
        iteration.setStartDate(new Date(System.currentTimeMillis() - DAY));
        iteration.setEndDate(new Date(System.currentTimeMillis() + DAY));
        project.getIterations().add(iteration);
        iteration.setId(nextId++);
        iteration.setName(ITERATION_PREFIX + iteration.getId());
        return iteration;
    }
View Full Code Here

    StoryModel model;

    public void testGetName() throws Exception {
        UserStory story = new UserStory();
        story.setName("story");
        Iteration iteration = new Iteration();
        iteration.setName("iteration");
        IterationModel model = new IterationModel(iteration){
            protected Project getProject() {
                Project project = new Project();
                project.setName("project");
                return project;
View Full Code Here

TOP

Related Classes of org.nxplanner.domain.Iteration

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.