Skip to content

V1.2.0 ("Cloudbusting")

Compare
Choose a tag to compare
@codingatty codingatty released this 28 Jan 20:09
· 61 commits to master since this release

Changes in this release

Major

  • API change: single-instance values and multiple-instance values are broken into two data fields (see API change, below)
  • XSL relaxation (see XSL relaxation, below)

Minor

API change

In release V1.1.0 and earlier, both single-instance attributes and multiple-instance attributes were kept in a single dictionary named TSDRMap. Examples of single-instance attributes are the application serial number (ApplicationNumber), the filing date (ApplicationDate), and its current status (MarkCurrentStatusExternalDescriptionText). Examples of multiple-instance attributes are prosecution events and assignments (kept in the lists MarkEventList and AssignmentList, respectively); these entries were lists of dictionaries, each dictionary representing one prosecution event or assignment.

This treatment required program logic to recognize the type of entry by its key; if it ended in "List", the entry was to be treated as a list of dictionaries; otherwise as a string. This was ungainly, requiring storing the materials as generic Objects and casting them to the appropriate type as required, and losing the benefits of typing.

In this release, the prior mixed-content dictionary TSDRMap is replaced by a new object TSDRData, which now contains two dictionaries: TSDRSingle for single-valued attributes, and TSDRMulti for multi-valued attributes. In addition, the TSDRMapIsValid flag is moved into the TSDRData object.

The following snippet demonstrates the changes.

V1.1.0 and older:

Plumage.TSDRReq t = new Plumage.TSDRReq();
t.getTSDRInfo("2564831", "r");  // get info on reg. no 2,564,831
if (t.TSDRMapIsValid){
    Console.WriteLine("Application serial no: " + t.TSDRMap["ApplicationNumber"]);
    ArrayList event_list = (ArrayList)t.TSDRMap["MarkEventList"];
    Dictionary<string, Object> most_recent_event = (Dictionary<string, Object>)event_list[0];
    Console.WriteLine("Most recent event: " + most_recent_event["MarkEventDescription"]);
    }

V1.2.0:

Plumage.TSDRReq t = new Plumage.TSDRReq();
t.getTSDRInfo("2564831", "r");  // get info on reg. no 2,564,831
if (t.TSDRData.TSDRMapIsValid){
    Console.WriteLine("Application serial no: ", t.TSDRData.TSDRSingle["ApplicationNumber"]);
    List<Dictionary<string, string>> event_list = t.TSDRData.TSDRMulti["MarkEventList"];
    Dictionary<string, string> most_recent_event = event_list[0];
    Console.WriteLine("Most recent event: " + most_recent_event["MarkEventDescription"]);
    }

Also, for consistency with the change from the TSDRMap dictionary to the TSDRData object , as well as consistency with other method names, the getTSDRMap and resetTSDRMap method have been renamed to getTSDRData and resetTSDRData, respectively.

XSL relaxation

Prior to this release, the CSV produced by the XSL transform could have no blank or empty lines. This made constructing a usable XSL file burdensome and made the XSL file itself more clutterful. With this release, the XSLT can produce blank or empty lines, and they will be stripped out as part of building the CSV information. The lines are removed as part of building the TSDRReq.CSVData member.