示例#1
0
  public void updateContent(HelpPageContent helpPageContent, String content, User updatingUser) {
    EntityManager entityManager = getEntityManager();

    Date now = new Date(System.currentTimeMillis());

    helpPageContent.setLastModified(now);
    helpPageContent.setLastModifier(updatingUser);
    helpPageContent.setContent(content);

    entityManager.persist(helpPageContent);
  }
示例#2
0
  @Override
  public void delete(HelpPageContent helpPageContent) {
    EntityManager entityManager = getEntityManager();

    if (helpPageContent.getPage() != null) {
      HelpPage helpPage = helpPageContent.getPage();
      helpPage.removeContent(helpPageContent);
      entityManager.persist(helpPage);
    }

    super.delete(helpPageContent);
  }
示例#3
0
  public HelpPageContent create(HelpPage page, Locale locale, String content, User creatingUser) {
    EntityManager entityManager = getEntityManager();

    Date now = new Date(System.currentTimeMillis());

    HelpPageContent helpPageContent = new HelpPageContent();
    helpPageContent.setCreated(now);
    helpPageContent.setLastModified(now);
    helpPageContent.setCreator(creatingUser);
    helpPageContent.setLastModifier(creatingUser);
    helpPageContent.setLocale(locale);
    helpPageContent.setContent(content);

    entityManager.persist(helpPageContent);

    page.addContent(helpPageContent);

    entityManager.persist(page);

    return helpPageContent;
  }