Ignore:
Timestamp:
11/07/12 10:25:30 (12 years ago)
Author:
gosiaw
Message:

Parameter elements for hostnames, labels, sequences, etc. are now created in output document.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/src/test/DEBBTranslator/src/DEBB2DCWoRMSTranslator.java

    r565 r566  
    4343 
    4444        private static final String DEFAULT_OUTPUT_FILE_NAME = "xml/DCWORMS_TEST.xml"; 
     45//      private static final String DEFAULT_INPUT_FILE_NAME = "xml/PLMXML_PSNCRECS.xml"; 
    4546        private static final String DEFAULT_INPUT_FILE_NAME = "xml/PLMXML_HLRSSmallServerRoom.xml"; 
    4647        private static DocumentBuilder xmlDocumentBuilder; 
     
    330331                        computingResourceElement.setAttributeNode(classAttribute); 
    331332 
    332                         if (debbHostName != null) { 
    333                                 // TODO: Where to use this hostname information? 
    334                                 Comment comment = dcwormsDocument.createComment("Host name " 
    335                                                 + debbHostName.getNodeValue()); 
    336                                 computingResourceElement.appendChild(comment); 
     333                        if (debbHostName != null) {                              
     334                                Element parameterElement =dcwormsDocument.createElement("parameter"); 
     335                                Attr parameterNameAttribute = dcwormsDocument.createAttribute("name"); 
     336                                parameterNameAttribute.setValue("hostname"); 
     337                                parameterElement.setAttributeNode(parameterNameAttribute); 
     338                                Element valueElement = dcwormsDocument.createElement("value"); 
     339                                valueElement.appendChild(dcwormsDocument.createTextNode(debbHostName.getNodeValue())); 
     340                                parameterElement.appendChild(valueElement); 
     341                                computingResourceElement.appendChild(parameterElement); 
    337342                        } 
    338343 
    339344                        if (debbSequence != null) { 
    340345                                // TODO: Sequence is described unclearly in the deliverable, not 
    341                                 // used in any example. Where to use this information if it 
    342                                 // appears? 
     346                                // used in any example. Not sure what to do with it. 
     347                                Element parameterElement =dcwormsDocument.createElement("parameter"); 
     348                                Attr parameterNameAttribute = dcwormsDocument.createAttribute("name"); 
     349                                parameterNameAttribute.setValue("sequence"); 
     350                                parameterElement.setAttributeNode(parameterNameAttribute); 
     351                                Element valueElement = dcwormsDocument.createElement("value"); 
     352                                valueElement.appendChild(dcwormsDocument.createTextNode(debbSequence.getNodeValue())); 
     353                                parameterElement.appendChild(valueElement); 
     354                                computingResourceElement.appendChild(parameterElement);                          
    343355                        } 
    344356                        debbParentElement.appendChild(computingResourceElement); 
    345357 
    346                         if (debbLabel != null) { 
    347                                 // TODO: Where to use this label information? 
    348                                 Comment comment = dcwormsDocument.createComment("Label " 
    349                                                 + debbLabel.getNodeValue()); 
    350                                 computingResourceElement.appendChild(comment); 
     358                        if (debbLabel != null) {                                 
     359                                Element parameterElement =dcwormsDocument.createElement("parameter"); 
     360                                Attr parameterNameAttribute = dcwormsDocument.createAttribute("name"); 
     361                                parameterNameAttribute.setValue("label"); 
     362                                parameterElement.setAttributeNode(parameterNameAttribute); 
     363                                Element valueElement = dcwormsDocument.createElement("value"); 
     364                                valueElement.appendChild(dcwormsDocument.createTextNode(debbLabel.getNodeValue())); 
     365                                parameterElement.appendChild(valueElement); 
     366                                computingResourceElement.appendChild(parameterElement); 
     367                                 
    351368                        } 
    352369 
    353370                        if (debbLocation != null) { 
    354                                 // TODO: Where to use this location information? 
    355                                 Comment comment = dcwormsDocument.createComment("Location " 
    356                                                 + debbLocation.getNodeValue()); 
    357                                 computingResourceElement.appendChild(comment); 
     371                                Element parameterElement =dcwormsDocument.createElement("parameter"); 
     372                                Attr parameterNameAttribute = dcwormsDocument.createAttribute("name"); 
     373                                parameterNameAttribute.setValue("location"); 
     374                                parameterElement.setAttributeNode(parameterNameAttribute); 
     375                                Element valueElement = dcwormsDocument.createElement("value"); 
     376                                valueElement.appendChild(dcwormsDocument.createTextNode(debbLocation.getNodeValue())); 
     377                                parameterElement.appendChild(valueElement); 
     378                                computingResourceElement.appendChild(parameterElement); 
     379                                 
    358380                        } 
    359381                         
Note: See TracChangeset for help on using the changeset viewer.