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

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


   * @throws IllegalStateException
   */
  @Test
  public void testWithoutPublication() throws IllegalStateException,
  ContentRepositoryException, IOException {
    ResourceURI workURI = new PageURIImpl(site, "/etc/weblounge", WORK);
    Page work = new PageImpl(workURI);
    work.setTemplate(template.getIdentifier());

    repository.put(work);

View Full Code Here


  public void testGetRevisionCount() throws ContentRepositoryException,
  IOException {
    int count = populateRepository();
    assertEquals(count, repository.getVersionCount() - 1);

    ResourceURI page1WorkURI = new PageURIImpl(page1URI, WORK);
    Page page2Work = new PageImpl(page1WorkURI);
    page2Work.setTemplate(template.getIdentifier());

    repository.put(page2Work);
    assertEquals(count + 1, repository.getVersionCount() - 1);
View Full Code Here

   */
  @Test
  public void testLock() throws Exception {

    // Create pages and uris
    ResourceURI uriLive = new PageURIImpl(site, "/etc/weblounge");
    Page pageLive = new PageImpl(uriLive);
    pageLive.setTemplate(template.getIdentifier());
    ResourceURI uriWork = new PageURIImpl(site, "/etc/weblounge", WORK);
    Page pageWork = new PageImpl(uriWork);
    pageWork.setTemplate(template.getIdentifier());

    // Add the pages to the index
    repository.put(pageLive);
View Full Code Here

   */
  @Test
  public void testUnlock() throws Exception {

    // Create pages and uris
    ResourceURI uriLive = new PageURIImpl(site, "/etc/weblounge");
    Page pageLive = new PageImpl(uriLive);
    pageLive.setTemplate(template.getIdentifier());
    ResourceURI uriWork = new PageURIImpl(site, "/etc/weblounge", WORK);
    Page pageWork = new PageImpl(uriWork);
    pageWork.setTemplate(template.getIdentifier());

    // Add the pages to the index
    repository.put(pageLive);
View Full Code Here

    repositoryProperties.put(FileSystemContentRepository.OPT_ROOT_DIR, repositoryRoot.getAbsolutePath());
    repository.updated(repositoryProperties);
    repository.connect(site);

    // Remove the default home page
    repository.delete(new PageURIImpl(site, "/"), true);
  }
View Full Code Here

  @Test
  public void testWithPreferredVersion() throws Exception {
    SearchResult result = null;

    // Make sure the homepage doesn't get into our way
    repository.delete(new PageURIImpl(site, "/"), true);

    SearchQuery workPreferredQuery = new SearchQueryImpl(site).withPreferredVersion(WORK).sortByCreationDate(Order.Ascending);
    SearchQuery livePreferredQuery = new SearchQueryImpl(site).withPreferredVersion(LIVE).sortByCreationDate(Order.Ascending);
    SearchQuery workOnlyQuery = new SearchQueryImpl(site).withVersion(WORK).sortByCreationDate(Order.Ascending);
    SearchQuery liveOnlyQuery = new SearchQueryImpl(site).withVersion(LIVE).sortByCreationDate(Order.Ascending);

    // Test empty repository
    assertEquals(0, repository.find(workPreferredQuery).getDocumentCount());
    assertEquals(0, repository.find(livePreferredQuery).getDocumentCount());
    assertEquals(0, repository.find(workOnlyQuery).getDocumentCount());
    assertEquals(0, repository.find(liveOnlyQuery).getDocumentCount());

    // Create URI and pages and add them to the repository
    ResourceURI liveOnlyURI = new PageURIImpl(site, "/liveonly", LIVE);
    ResourceURI liveAndWorkLiveURI = new PageURIImpl(site, "/liveandwork", LIVE);
    ResourceURI liveAndWorkWorkURI = new PageURIImpl(site, "/liveandwork", WORK);
    ResourceURI workOnlyURI = new PageURIImpl(site, "/workonly", WORK);

    Page liveOnly = new PageImpl(liveOnlyURI);
    liveOnly.setTemplate(template.getIdentifier());
    Page liveAndWorkLive = new PageImpl(liveAndWorkLiveURI);
    liveAndWorkLive.setTemplate(template.getIdentifier());
View Full Code Here

        logger.debug("Content repository is offline");
        response.invalidate();
        return SKIP_BODY;
      }
     
      ResourceURI pageURI = new PageURIImpl(request.getSite(), null, resourceid);
      Page page = (Page) repository.get(pageURI);
      if (page == null) {
        logger.warn("Unable to link to non-existing page {}", pageURI);
        return SKIP_BODY;
      }
View Full Code Here

    // Is it a page?
    try {
      String objectId = args[0];
      // TODO: What if we hit a file or an image?
      if (objectId.startsWith("/"))
        page = (Page) repository.get(new PageURIImpl(site, args[0]));
      else
        page = (Page) repository.get(new PageURIImpl(site, null, args[0]));
      if (page != null) {
        title("page");
        pad("id", page.getURI().getIdentifier().toString());
        pad("path", page.getURI().getPath());
View Full Code Here

   */
  @Before
  public void setUp() throws Exception {
    site = EasyMock.createNiceMock(Site.class);
    EasyMock.replay(site);
    liveHomeURI = new PageURIImpl(site, homePath, Resource.LIVE);
    workHomeURI = new PageURIImpl(site, homePath, Resource.WORK);
    workSubURI = new PageURIImpl(site, subPath, Resource.WORK);
    bundle = new StandaloneBundle(BundleContentRepositoryTest.class.getClassLoader());
   
    TestUtils.startTesting();
    repository = new BundleContentRepository();
    Dictionary<String, Object> properties = new Hashtable<String, Object>();
View Full Code Here

    renderer = new PageletRendererImpl("renderer");

    // module
    module.addRenderer(renderer);

    pageURI = new PageURIImpl(site, pageURIPath);
    page = new PageImpl(pageURI);
    actionUrl = new WebUrlImpl(site, UrlUtils.concat(siteUrl, mountpoint));
  }
View Full Code Here

TOP

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

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.