Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-1868

Merge argument descriptors into SQLState strings so that SQLState documentation can be generated by a program

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.2.1.6
    • 10.3.1.4
    • Build tools
    • None

    Description

      See DERBY-1566. That JIRA introduced a program, written by David, which generates human-readable tables of message strings for inclusion in the Reference Guide. The tool doesn't patch in friendly arguments. That leaves the message strings peppered with unfriendly placeholders like

      {0}

      .

      {1}

      , etc.. Laura painstakingly editted the tables, by hand substituting in friendlier arguments like <userName> and <tableName>.

      We need to move Laura's substitutions into the source code so that David's program can automatically plug them in. This will save us a lot of grief when we generate future releases. Dan and Andrew have proposed approaches to this problem. Those approaches are discussed in DERBY-1566. Here is Andrew's comment on Dan's proposal:

      "While Dan's suggestion here:

      http://mail-archives.apache.org/mod_mbox/db-derby-dev/200608.mbox/%3c44F62247.2080500@apache.org%3e

      to generate the message file and doc from a single XML file would be ideal, a simpler approach to implement would be to maintain the meanings of the markers in another properties file, identified by message key and marker number. So, e.g. the new properties file would contain:

      01500.0=<constraintName>
      01500.1=<tableName>

      Then ErrorMessageGenerator could look up the value of the markers by SQLState and MessageFormat marker number in the properties file, although this approach would require maintaining two files instead of one."

      I glossed this further: "If we adopt Andrew's approach, I would recommend co-locating the argument descriptiors in the same properties file which contains the messages. This will help keep the argument descriptors from drifting out of sync with the messages themselves--that is a substantial advantage of Dan's approach."

      Attachments

        1. derby-1868-lineEndings-v01.diff
          4 kB
          Richard N. Hillegas
        2. messages.dtd
          2 kB
          Richard N. Hillegas
        3. messages.xml
          239 kB
          Richard N. Hillegas
        4. derby-1868-merged-v01.diff
          394 kB
          Richard N. Hillegas
        5. derby-1868-merged-v02.diff
          2 kB
          Richard N. Hillegas
        6. antlib.diff
          0.6 kB
          Knut Anders Hatlen
        7. derby-1868-merged-v03.diff
          0.7 kB
          Richard N. Hillegas

        Activity

          People

            rhillegas Richard N. Hillegas
            rhillegas Richard N. Hillegas
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: