Examples of PageEntity


Examples of org.vosao.entity.PageEntity

    super(PageEntity.class);
  }

  @Override
  public void remove(Long id) {
    PageEntity page = getById(id);
    if (page != null) {
      List<PageEntity> versions = selectByUrl(page.getFriendlyURL());
      for (PageEntity version : versions) {
        removeVersion(version.getId());
      }
      List<PageEntity> children = selectAllChildren(page.getFriendlyURL());
      for (PageEntity child : children) {
        remove(child.getId());
      }
      getCommentDao().removeByPage(page.getFriendlyURL());
    }
  }
View Full Code Here

Examples of org.vosao.entity.PageEntity

    }
  }
 
  @Override
  public void removeVersion(Long id) {
    PageEntity page = getById(id);
    if (page != null) {
      getContentDao().removeById(PAGE_CLASS_NAME, id);
      super.remove(id);
    }
  }
View Full Code Here

Examples of org.vosao.entity.PageEntity

  private void addPage(String title, String url, String resource,
        Long templateId, Integer sortIndex, boolean cached,
        boolean searchable) {
        String content = loadResource(resource);
    PageEntity page = new PageEntity(title, url,  templateId);
    page.setCreateUserEmail("admin@test.com");
    page.setModUserEmail("admin@test.com");
    page.setState(PageState.APPROVED);
    page.setSortIndex(sortIndex);
    page.setCached(cached);
    page.setSearchable(searchable);
    getDao().getPageDao().save(page);
    getDao().getPageDao().setContent(page.getId(),
        LanguageEntity.ENGLISH_CODE, content);
        log.info("Added " + title);
  }
View Full Code Here

Examples of org.vosao.entity.PageEntity

    super(business);
  }
 
  @Override
  public PageEntity findPage(String path) {
    PageEntity page = getDao().getPageDao().getByUrl(path);
    if (page == null) {
      return new PageEntity(Messages.get("page.not_found", path),
          Messages.get("page.not_found", path), null);
    }
    return page;
  }
View Full Code Here

Examples of org.vosao.entity.PageEntity

        pageUrl, false));
  }

  @Override
  public String findContent(String path, String aLanguageCode) {
    PageEntity page = getDao().getPageDao().getByUrl(path);
    if (page != null) {
      return getBusiness().getPageBusiness().createPageRenderDecorator(
        page, aLanguageCode).getContent();
    }
    return Messages.get("approved_content_not_found");
View Full Code Here

Examples of org.vosao.entity.PageEntity

  }
 
  @Override
  public String findStructureContent(String path, String field,
      String aLanguageCode) {
    PageEntity page = getDao().getPageDao().getByUrl(path);
    if (page != null) {
      if (field != null) {
        if (page.isStructured()
          && isStructureFieldExists(page, field)) {
          StructurePageRenderDecorator pageDecorator =
            (StructurePageRenderDecorator) getBusiness()
              .getPageBusiness().createPageRenderDecorator(
                  page, aLanguageCode);
View Full Code Here

Examples of org.vosao.entity.PageEntity

  }

  @Override
  public String renderStructureContent(String path,
      String structureTemplateName) {
    PageEntity page = getDao().getPageDao().getByUrl(path);
    if (page != null) {
      if (!page.isStructured()) {
        return Messages.get("page.not_structural");
      }
      StructureTemplateEntity template = getDao()
          .getStructureTemplateDao().getByName(structureTemplateName);
      if (template == null) {
View Full Code Here

Examples of org.vosao.entity.PageEntity

    return addPage(name, "/" + name);
  }

  public PageEntity addPage(final String title, final String url,
      PageState state) {
    PageEntity page = new PageEntity(title, url);
    page.setState(state);
    try {
      page.setPublishDate(DateUtil.toDate("01.01.2010"));
    }
    catch (ParseException e) {
      e.printStackTrace();
    }
    dao.getPageDao().save(page);
View Full Code Here

Examples of org.vosao.entity.PageEntity

        commentTool = new CommentTool(getDao());
  }   


  public void testSave() {
    PageEntity page = pageTool.addPage("test");
    CommentEntity comment = commentTool.addComment("alex", "content", page);
    CommentEntity comment2 = getDao().getCommentDao().getById((Long)null);
    assertNull(comment2);
    List<CommentEntity> comments = getDao().getCommentDao().getById((List<Long>)null);
    assertEquals(0, comments.size());
View Full Code Here

Examples of org.vosao.entity.PageEntity

    assertEquals("alex", comment2.getName());
    assertEquals("content", comment2.getContent());
 
 
  public void testUpdate() {
    PageEntity page = pageTool.addPage("test");
    CommentEntity comment = commentTool.addComment("alex", "content", page);
    CommentEntity comment2 = getDao().getCommentDao().getById(
        comment.getId());
    assertNotNull(comment2);
    assertEquals("alex", comment2.getName());
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.