Пример #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
  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;
  }