Examples of Chapter


Examples of org.apache.cxf.jaxrs.resources.Chapter

       
        String value = "<Chapter><title>The Book</title><id>2</id></Chapter>";
        m.setContent(InputStream.class, new ByteArrayInputStream(value.getBytes()));
        List<Object> params = JAXRSUtils.processParameters(ori, values, m);
        assertEquals(1, params.size());
        Chapter c = (Chapter)params.get(0);
        assertNotNull(c);
        assertEquals(2L, c.getId());
        assertEquals("The Book", c.getTitle());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.Chapter

       
        String value = "<Chapter><title>The Book</title><id>2</id></Chapter>";
        m.setContent(InputStream.class, new ByteArrayInputStream(value.getBytes()));
        List<Object> params = JAXRSUtils.processParameters(ori, values, m);
        assertEquals(1, params.size());
        Chapter c = (Chapter)params.get(0);
        assertNotNull(c);
        assertEquals(2L, c.getId());
        assertEquals("The Book", c.getTitle());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.Chapter

       
        String value = "<Chapter><title>The Book</title><id>2</id></Chapter>";
        m.setContent(InputStream.class, new ByteArrayInputStream(value.getBytes()));
        List<Object> params = JAXRSUtils.processParameters(ori, values, m);
        assertEquals(1, params.size());
        Chapter c = (Chapter)params.get(0);
        assertNotNull(c);
        assertEquals(2L, c.getId());
        assertEquals("The Book", c.getTitle());
    }
View Full Code Here

Examples of org.bar.foo.entities.Chapter

    editor.setName("Editions Bidule");
    return editor;
  }
 
  public static Chapter newChapter(int i) {
    Chapter chapter = new Chapter();
    chapter.setLevel(i);
    chapter.setSelfValue("chapitre n�"+i);
    return chapter;
  }
View Full Code Here

Examples of org.eclipse.xtext.xdoc.xdoc.Chapter

    set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "01-twoChapters.xdoc"), true);
    set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "02-twoChapters.xdoc"), true);
    XdocFile file = (XdocFile) getModel((XtextResource)set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "twoChaptersDoc.xdoc"), true));
    Document doc = (Document) file.getMainSection();
    for(int i = 0; i < doc.getChapters().size(); i++) {
      Chapter chapter = doc.getChapters().get(i);
      generate(chapter);
    }
    generate(doc);
    validate(EXPECTATION_DIR + "01-twoChapters.xdoc.html", RESULT_DIR + "01-twoChapters.xdoc.html");
    validate(EXPECTATION_DIR + "02-twoChapters.xdoc.html", RESULT_DIR + "02-twoChapters.xdoc.html");
View Full Code Here

Examples of org.gtugs.domain.Chapter

    AppEngineUserService userService = new AppEngineUserService();
    map.put("userService", userService);
    model.put("model", map);

    Chapter chapter = retrieveChapter(chapterId);

    if (chapter == null) {
      String errorText = "Failed to retrieve chapter with ID \"" + chapterId +
          "\" -- chapter not found.";
      model.put("errorText", errorText);
View Full Code Here

Examples of org.gtugs.domain.Chapter

  @Override
  protected Object formBackingObject(HttpServletRequest request) throws
      ServletException {
    String chapterId = request.getParameter("id");
    Chapter chapter = retrieveChapter(chapterId);

    if (chapter == null) {
      return new Event();
    }

    Event event = new Event();
    event.setChapterId(chapter.getId());
    event.setStartDate(new Date());
    event.setStartTime("1900");
    event.setEndDate(new Date());
    event.setEndTime("2100");
    event.setCity(chapter.getCity());
    event.setState(chapter.getState());
    event.setCountry(chapter.getCountry());

    return event;
  }
View Full Code Here

Examples of org.gtugs.domain.Chapter

  }

  @Override
  public ModelAndView onSubmit(Object command) throws ServletException {
    Event cmd = (Event) command;
    Chapter chapter = retrieveChapter(cmd.getChapterId());
    AppEngineUserService userService = new AppEngineUserService();

    if (chapter == null) {
      String errorText = "Failed to update chapter with ID \"" +
          cmd.getChapterId() + "\" -- chapter not found.";

      return new ModelAndView("admin_error", "errorText", errorText);
    }
    if (!hasAccess(userService, chapter)) {
      String errorText = "You are not listed as an organizer for this " +
          "chapter. Please sign in with an organizer's account to access " +
          "this page.";

      return new ModelAndView("error", "errorText", errorText);
    }

    eventManager.storeEvent(cmd);

    return new ModelAndView(new RedirectView(getSuccessView() + "?id=" +
        chapter.getId() + "&t=events"));
  }
View Full Code Here

Examples of org.gtugs.domain.Chapter

    response.setContentType("text/plain");
    MemcacheService ms = MemcacheServiceFactory.getMemcacheService();
    ms.clearAll();

    String chapterId = request.getParameter("id");
    Chapter chapter = retrieveChapter(chapterId);

    if (chapter == null) {
      response.getWriter().println("Geocode update failed: chapter not found");
      return;
    }

    response.getWriter().println(chapter.getName());

    Point point = mapsService.getCoordinates(chapter.getCity(),
        chapter.getState(), chapter.getCountry());
    if (point == null) {
      response.getWriter().println("Geocode update failed: point not found");
      return;
    } else {
      chapter.setLatitude(point.getLatitude());
      chapter.setLongitude(point.getLongitude());

      PersistenceManager pm = PMF.get().getPersistenceManager();
      try {
        pm.makePersistent(chapter);
      } catch (Exception e) {
        response.getWriter().println("Geocode update failed: JDO error");
        return;
      } finally {
        pm.close();
      }
    }

    chapter = null;
    chapter = retrieveChapter(chapterId);

    if (chapter == null) {
      response.getWriter().println("Geocode update failed: chapter not found");
      return;
    }

    response.getWriter().println("Geocode update succeeded");
    response.getWriter().println(point.getLatitude() + ", " + point.getLongitude());
    response.getWriter().println(chapter.getLatitude() + ", " + chapter.getLongitude());
  }
View Full Code Here

Examples of org.gtugs.domain.Chapter

  protected void setUp() throws Exception {
    chapterManager = new SimpleChapterManager();
    chapters = new ArrayList<Chapter>();

    Chapter chapter = new Chapter();
    chapter.setName(GTUG_A_NAME);
    chapters.add(chapter);

    chapter = new Chapter();
    chapter.setName(GTUG_B_NAME);
    chapters.add(chapter);

    ChapterDao chapterDao = new InMemoryChapterDao(chapters);
    chapterManager.setChapterDao(chapterDao);
  }
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.