Exemple #1
0
  protected TemplateResource getErrorTemplateResource(String langType) {
    try {
      long companyId = CompanyThreadLocal.getCompanyId();

      JournalServiceConfiguration journalServiceConfiguration =
          ConfigurationProviderUtil.getCompanyConfiguration(
              JournalServiceConfiguration.class, companyId);

      String template = StringPool.BLANK;

      if (langType.equals(TemplateConstants.LANG_TYPE_FTL)) {
        template = journalServiceConfiguration.errorTemplateFTL();
      } else if (langType.equals(TemplateConstants.LANG_TYPE_VM)) {
        template = journalServiceConfiguration.errorTemplateVM();
      } else if (langType.equals(TemplateConstants.LANG_TYPE_XSL)) {
        template = journalServiceConfiguration.errorTemplateXSL();
      } else {
        return null;
      }

      return new StringTemplateResource(langType, template);
    } catch (Exception e) {
    }

    return null;
  }
  protected boolean isIndexAllArticleVersions() {
    JournalServiceConfiguration journalServiceConfiguration = null;

    try {
      journalServiceConfiguration =
          _configurationProvider.getCompanyConfiguration(
              JournalServiceConfiguration.class, CompanyThreadLocal.getCompanyId());

      return journalServiceConfiguration.indexAllArticleVersionsEnabled();
    } catch (Exception e) {
      _log.error(e, e);
    }

    return false;
  }