Examples of ContentEntity


Examples of org.vosao.entity.ContentEntity

      PageEntity page = getDao().getPageDao().getById(pageId);
      if (page != null) {
        if (filter != null && !filter.check(page)) {
          continue;
        }
        ContentEntity content = getBusiness().getPageBusiness()
            .getPageContent(page, language);
        if (content != null) {
          String text = StrUtil.extractSearchTextFromHTML(
              content.getContent());
          if (text.length() > textSize) {
            text = text.substring(0, textSize);
          }
          result.add(new Hit(page, text, language));
        }
View Full Code Here

Examples of org.vosao.entity.ContentEntity

    setSystemService(systemService);
    prepareContent();
  }

  private void prepareContent() {
    ContentEntity contentEntity = getPageBusiness().getPageContent(
        getPage(), getLanguageCode());
    if (contentEntity == null) {
      String msg = Messages.get("content_not_found") + " "
          + getFriendlyURL() + " " + getLanguageCode();
      logger.error(msg);
      setContent(msg);
      return;
    }
    String resultContent = contentEntity.getContent();
    if (isVelocityProcessing()) {
      VelocityContext context = getPageBusiness().createContext(
          getLanguageCode(), getPage());
      context.put("page", getPage());
      resultContent = getSystemService().render(resultContent, context);
View Full Code Here

Examples of org.vosao.entity.ContentEntity

      TemplateEntity template = getDao().getTemplateDao().getById(
          page.getTemplate());
      return render(page, template.getContent(), languageCode);
    }
    else {
      ContentEntity content = getPageContent(page, languageCode);
      return pagePostProcess(content.getContent(), page);
    }
  }
View Full Code Here

Examples of org.vosao.entity.ContentEntity

    return velocityPluginService;
  }

  @Override
  public ContentEntity getPageContent(PageEntity page, String languageCode) {
    ContentEntity content = getDao().getContentDao().getByLanguage(
        PageEntity.class.getName(), page.getId(), languageCode);
    if (content == null || content.getContent().isEmpty()) {
      content = getDao().getContentDao().getByLanguage(
          PageEntity.class.getName(), page.getId(),
          getBusiness().getDefaultLanguage());
    }
    if (content == null) {
      logger.error("No content found for page " + page.getTitle());
      content = new ContentEntity();
      content.setParentClass(PageEntity.class.getName());
      content.setParentKey(page.getId());
      content.setLanguageCode(languageCode);
    }
    return content;
  }
View Full Code Here

Examples of org.vosao.entity.ContentEntity

        languageCode);
  }

  @Override
  public void saveContent(PageEntity page, String language, String content) {
    ContentEntity contentEntity = getDao().getPageDao().setContent(
        page.getId(), language, content);
    getSystemService().getPageCache().remove(page.getFriendlyURL());
    PageMessage message = new PageMessage(Topic.PAGES_CHANGED,
        page.getFriendlyURL(), page.getId());
    getBusiness().getMessageQueue().publish(message);
View Full Code Here

Examples of org.vosao.entity.ContentEntity

  private void copyContent(PageEntity src, PageEntity dst) {
    List<ContentEntity> contents = getDao().getPageDao().getContents(
        src.getId());
    for (ContentEntity content : contents) {
      ContentEntity newContent = new ContentEntity();
      newContent.copy(content);
      newContent.setId(null);
      newContent.setParentKey(dst.getId());
      getDao().getContentDao().save(newContent);
      getBusiness().getSystemService().getPageCache().remove(
          dst.getFriendlyURL());
    }
  }
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.