Skip to content

Commit

Permalink
Merge pull request #33 from NASA-PDS-Incubator/Issue-#32-DOMConv-Depr…
Browse files Browse the repository at this point in the history
…ecation_FinalCleanup-WriteDOMSpecification

Issue #32 DOMConv Deprecation_FinalCleanup WriteDOMSpecification
  • Loading branch information
jshughes416 authored Sep 7, 2019
2 parents 479b976 + 72a7a03 commit 5ebfdf8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
import java.util.*;

class ProtPinsGlossary extends Object{
TreeMap <String, AttrDefn> glossMap;
TreeMap <String, DOMAttr> glossMap;
TreeMap <String, String> glossTitleIdMap;

ProtPins protPinsInst;

public ProtPinsGlossary () {
glossMap = new TreeMap <String, AttrDefn> ();
glossMap = new TreeMap <String, DOMAttr> ();
glossTitleIdMap = new TreeMap <String, String> ();
return;
}
Expand All @@ -54,18 +54,19 @@ public void getProtPinsGlossary (String subModelId, String fname) throws Throwab
while(iter1.hasNext()) {
String instRDFId = (String) iter1.next();
InstDefn localInst = (InstDefn) tDict.get(instRDFId);
AttrDefn attrClass = new AttrDefn(localInst.rdfIdentifier);
attrClass.regAuthId = DMDocument.registrationAuthorityIdentifierValue;
attrClass.subModelId = subModelId;
attrClass.title = InfoModel.unEscapeProtegeString(localInst.title);
attrClass.genAttrMap = localInst.genSlotMap;
ArrayList attrdescarr = (ArrayList) attrClass.genAttrMap.get("column_desc");
DOMAttr lDOMAttr = new DOMAttr();
lDOMAttr.setRDFIdentifier(localInst.rdfIdentifier);
lDOMAttr.regAuthId = DMDocument.registrationAuthorityIdentifierValue;
lDOMAttr.subModelId = subModelId;
lDOMAttr.title = InfoModel.unEscapeProtegeString(localInst.title);
lDOMAttr.genAttrMap = localInst.genSlotMap;
ArrayList <String> attrdescarr = (ArrayList<String>) lDOMAttr.genAttrMap.get("column_desc");
String lDescription = (String) attrdescarr.get(0);
lDescription = InfoModel.unEscapeProtegeString(lDescription);
attrClass.description = lDescription;
lDOMAttr.definition = lDescription;

glossMap.put(attrClass.rdfIdentifier, attrClass);
glossTitleIdMap.put(attrClass.title, attrClass.rdfIdentifier);
glossMap.put(lDOMAttr.rdfIdentifier, lDOMAttr);
glossTitleIdMap.put(lDOMAttr.title, lDOMAttr.rdfIdentifier);
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1106,8 +1106,8 @@ public void printGlossary (SectionDefn secInfo) {
while(iter1.hasNext()) {
String lTitle = (String) iter1.next();
String lId = (String) lmodel.glossTitleIdMap.get(lTitle);
AttrDefn attr = (AttrDefn) lmodel.glossMap.get(lId);
printTerm (attr);
DOMAttr lDOMAttr = (DOMAttr) lmodel.glossMap.get(lId);
printTerm (lDOMAttr);
pflag = true;
}

Expand All @@ -1120,14 +1120,14 @@ public void printGlossary (SectionDefn secInfo) {
/**
* Print a data element
*/
private void printTerm (AttrDefn attr) {
private void printTerm (DOMAttr lDOMAttr) {

String phtitle, desc;

String lTermAnchorString = ("term_" + attr.title).toLowerCase();
String titleWithBlanks = DMDocument.replaceString (attr.title, "_", " ");
String lTermAnchorString = ("term_" + lDOMAttr.title).toLowerCase();
String titleWithBlanks = DMDocument.replaceString (lDOMAttr.title, "_", " ");
phtitle = "<a name=\"" + lTermAnchorString + "\">" + titleWithBlanks + "</a>";
desc = attr.description;
desc = lDOMAttr.definition;
prhtml.println("<dt><b>" + phtitle + "</b><dd><i>" + "</i>" + desc);
}

Expand Down

0 comments on commit 5ebfdf8

Please sign in to comment.