public static void getArticle(HttpServletRequest request) throws Exception {
    long groupId = ParamUtil.getLong(request, "groupId");
    long classNameId = ParamUtil.getLong(request, "classNameId");
    long classPK = ParamUtil.getLong(request, "classPK");
    String articleId = ParamUtil.getString(request, "articleId");
    String structureId = ParamUtil.getString(request, "structureId");

    JournalArticle article = null;

    if (Validator.isNotNull(articleId)) {
      article =
          JournalArticleServiceUtil.getLatestArticle(
              groupId, articleId, WorkflowConstants.STATUS_ANY);
    } else if ((classNameId > 0) && (classPK > 0)) {
      String className = PortalUtil.getClassName(classNameId);

      article = JournalArticleServiceUtil.getLatestArticle(groupId, className, classPK);
    } else if (Validator.isNotNull(structureId)) {
      JournalStructure structure = null;

      try {
        structure = JournalStructureServiceUtil.getStructure(groupId, structureId);
      } catch (NoSuchStructureException nsse1) {
        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);

        if (groupId == themeDisplay.getCompanyGroupId()) {
          return;
        }

        try {
          structure =
              JournalStructureServiceUtil.getStructure(
                  themeDisplay.getCompanyGroupId(), structureId);
        } catch (NoSuchStructureException nsse2) {
          return;
        }
      }

      article =
          JournalArticleServiceUtil.getArticle(
              groupId, JournalStructure.class.getName(), structure.getId());

      article.setNew(true);

      article.setId(0);
      article.setClassNameId(0);
      article.setClassPK(0);
      article.setArticleId(null);
      article.setVersion(0);
    }

    request.setAttribute(WebKeys.JOURNAL_ARTICLE, article);
  }
  public static void getStructure(HttpServletRequest request) throws Exception {

    long groupId = ParamUtil.getLong(request, "groupId");
    String structureId = ParamUtil.getString(request, "structureId");

    JournalStructure structure = null;

    if (Validator.isNotNull(structureId)) {
      structure = JournalStructureServiceUtil.getStructure(groupId, structureId);
    }

    request.setAttribute(WebKeys.JOURNAL_STRUCTURE, structure);
  }