Package ch.entwine.weblounge.common.impl.content.page

Examples of ch.entwine.weblounge.common.impl.content.page.PageReader


   * @see ch.entwine.weblounge.contentrepository.impl.AbstractResourceSerializer#createNewReader()
   */
  @Override
  protected PageReader createNewReader() throws ParserConfigurationException,
      SAXException {
    return new PageReader();
  }
View Full Code Here


   *           if setup of the index fails
   */
  @Before
  public void setUp() throws Exception {
    // Prepare the pages
    PageReader pageReader = new PageReader();
    InputStream is = null;
    Calendar date = Calendar.getInstance();
    Date today = date.getTime();
    date.add(Calendar.YEAR, -1);
    Date lastYear = date.getTime();

    // Add the live page
    try {
      is = this.getClass().getResourceAsStream(pageFile);
      livePage = pageReader.read(is, site);
      livePage.setIdentifier(livePageId);
      livePage.setCreated(livePage.getCreator(), lastYear);
      livePage.setModified(livePage.getModifier(), lastYear);
      pagelet = livePage.getPagelets()[0];

      // Duplicate the content to gain higher ranking

      String elementId = "textid";
      content = pagelet.getContent(elementId, german);
      pagelet.setContent(elementId, content + " " + content, german);
      idx.add(livePage);
    } finally {
      IOUtils.closeQuietly(is);
    }

    // Add the second live page
    try {
      is = this.getClass().getResourceAsStream(pageFile);
      otherLivePage = pageReader.read(is, site);
      otherLivePage.setIdentifier(otherLivePageId);
      otherLivePage.setCreated(otherLivePage.getCreator(), today);
      otherLivePage.setModified(otherLivePage.getModifier(), today);
      idx.add(otherLivePage);
    } finally {
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.impl.content.page.PageReader

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.