DDMSence exposes some properties, such as the namespace prefixes used for each XML namespace, so they can be configured by the end user. For example, if you are
building components from scratch, and you wish to use "ic" as a namespace prefix for the Intelligence Community namespace
instead of "ISM", you would set the "ism.prefix" property with a custom value of ic
.
PropertyReader.setProperty("ism.prefix", "ic");
Figure 1. Command to change a configurable property.
If you are using DDMSence in a multithreaded environment, be aware that each running Thread has its own local PropertyReader. Changing properties in one Thread will not impact or overwrite properties in another Thread.
Only the subset of properties listed below can be set programmatically. Attempts to change other DDMSence properties will result in an exception.
Property Name | Description | Default Value |
---|---|---|
ddms.prefix | Default DDMS prefix used when generating components from scratch | ddms |
gml.prefix | Default GML prefix used when generating components from scratch | gml |
ism.prefix | Default ISM prefix used when generating components from scratch | ISM |
ntk.prefix | Default NTK prefix used when generating components from scratch | ntk |
output.json.inlineAttributes | Renders attributes with other component properties, rather than in a separate enclosure | false |
output.json.prettyPrint | Outputs JSON strings with whitespace and indentation | false |
output.indexLevel | Controls the placement of 1-based indices on the HTML/Text output of fields which are allowed to have multiples (0 = Never use, 1 = Use unless exactly 1 item exists, 2 = Always use) | 0 |
sample.data | Default data directory used by sample applications | data/sample/ |
tspi.prefix | Default TSPI prefix used when generating components from scratch | tspi |
virt.prefix | Default VIRT prefix used when generating components from scratch | virt |
xlink.prefix | Default XLink prefix used when generating components from scratch | xlink |
xml.transform.TransformerFactory | XSLT Engine class name, for Schematron validation | net.sf.saxon.TransformerFactoryImpl |
Table 1. Configurable Properties
The output.json.inlineAttributes
property renders attribute groups inline with the parent component.
Normally, related attributes are enclosed together, matching the class hierarchy of DDMSence.
Setting this property to true removes the enclosure. The examples below show the expected output when this property is set to true or false, respectively:
{ "security": { "excludeFromRollup": true, "classification": "U", "ownerProducer": [ "USA" ] } }
Figure 2. The JSON output of a Security component, with output.json.inlineAttributes
set to true.
{ "security": { "excludeFromRollup": true, "securityAttributes": { "classification": "U", "ownerProducer": [ "USA" ] } } }
Figure 3. The JSON output of a Security component, with output.json.inlineAttributes
set to false.
The output.json.prettyPrint
property applies pretty-printing to a JSON string, via the google-gson library.
The examples below show the expected output when this property is set to true or false, respectively:
{ "qualifier": "http://purl.org/dc/elements/1.1/language", "value": "en" }
Figure 4. The JSON output of a Language component, with output.json.prettyPrint
set to true.
{"qualifier":"http://purl.org/dc/elements/1.1/language","value":"en"}
Figure 5. The JSON output of a Language component, with output.json.prettyPrint
set to false.
The DDMS specification has no convention for the HTML/Text output of fields which might have multiple values, such as the name and phone number fields on a person.
DDMSence optionally adds indices to the names of these values, based on the value of the output.indexLevel
property.
The example below shows a sample XML instance, and the expected output at each indexLevel:
<ddms:creator> <ddms:person> <ddms:name>Brian</ddms:name> <ddms:name>BU</ddms:name> <ddms:surname>Uri</ddms:surname> <ddms:phone>703-885-1000</ddms:phone> </ddms:person> </ddms:creator>
Figure 6. A sample XML instance representing a creator with 2 names and 1 phone number.
creator.name: Brian creator.name: BU creator.surname: Uri creator.phone: 703-885-1000
Figure 7. The Text output of this creator when output.indexLevel is 0
creator.name[1]: Brian creator.name[2]: BU creator.surname: Uri creator.phone: 703-885-1000
Figure 8. The Text output of this creator when output.indexLevel is 1
creator.name[1]: Brian creator.name[2]: BU creator.surname: Uri creator.phone[1]: 703-885-1000
Figure 9. The Text output of this creator when output.indexLevel is 2