protected void doAddJournalArticles(
      String journalStructureId, String journalTemplateId, String name, InputStream inputStream)
      throws Exception {

    String journalArticleId = getJournalArticleId(name);

    String title = getName(name);

    Map<Locale, String> titleMap = getNameMap(title);

    String content = StringUtil.read(inputStream);

    content = processJournalArticleContent(content);

    JournalArticle journalArticle =
        JournalArticleLocalServiceUtil.addArticle(
            userId,
            groupId,
            0,
            0,
            journalArticleId,
            false,
            JournalArticleConstants.VERSION_DEFAULT,
            titleMap,
            null,
            content,
            "general",
            journalStructureId,
            journalTemplateId,
            StringPool.BLANK,
            1,
            1,
            2010,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            true,
            0,
            0,
            0,
            0,
            0,
            true,
            true,
            false,
            StringPool.BLANK,
            null,
            new HashMap<String, byte[]>(),
            StringPool.BLANK,
            serviceContext);

    JournalArticleLocalServiceUtil.updateStatus(
        userId,
        groupId,
        journalArticle.getArticleId(),
        journalArticle.getVersion(),
        WorkflowConstants.STATUS_APPROVED,
        StringPool.BLANK,
        serviceContext);
  }