Esempio n. 1
0
  private static synchronized List<BriefTabFieldFormatDTO> loadBriefFormats(
      String schema, RecordType recordType) {
    Pair<String, RecordType> pair = new Pair<String, RecordType>(schema, recordType);
    List<BriefTabFieldFormatDTO> list = Fields.briefTabFieldFormats.get(pair);

    // Checking again for thread safety.
    if (list != null) {
      return list;
    }

    if (Fields.logger.isDebugEnabled()) {
      Fields.logger.debug("Loading brief formats from " + schema + "." + recordType);
    }

    TabFieldsDAO dao = TabFieldsDAO.getInstance(schema);

    list = dao.listBriefFormats(recordType);
    Fields.briefTabFieldFormats.put(pair, list);

    return list;
  }
Esempio n. 2
0
  private static synchronized JavascriptCacheableList<FormTabDatafieldDTO> loadFormFields(
      String schema, RecordType recordType) {
    Pair<String, RecordType> pair = new Pair<String, RecordType>(schema, recordType);
    JavascriptCacheableList<FormTabDatafieldDTO> list = Fields.formTabFields.get(pair);

    // Checking again for thread safety.
    if (list != null) {
      return list;
    }

    if (Fields.logger.isDebugEnabled()) {
      Fields.logger.debug("Loading form fields from " + schema + "." + recordType);
    }

    TabFieldsDAO dao = TabFieldsDAO.getInstance(schema);

    List<FormTabDatafieldDTO> fields = dao.listFields(recordType);
    if (recordType == RecordType.HOLDING) {
      list =
          new JavascriptCacheableList<FormTabDatafieldDTO>(
              "CatalogingInput.holdingFields",
              schema + ".cataloging." + recordType.toString(),
              ".form.js");
    } else {
      list =
          new JavascriptCacheableList<FormTabDatafieldDTO>(
              "CatalogingInput.formFields",
              schema + ".cataloging." + recordType.toString(),
              ".form.js");
    }
    list.addAll(fields);

    Fields.formTabFields.put(pair, list);

    return list;
  }