Changeset 564 for DCWoRMS/trunk/src/test/DEBBTranslator
- Timestamp:
- 11/07/12 08:40:59 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/src/test/DEBBTranslator/src/DEBB2DCWoRMSTranslator.java
r562 r564 43 43 44 44 private static final String DEFAULT_OUTPUT_FILE_NAME = "xml/DCWORMS_TEST.xml"; 45 // private static final String DEFAULT_INPUT_FILE_NAME = "xml/PLMXML_HLRSSmallServerRoom.xml"; 46 private static final String DEFAULT_INPUT_FILE_NAME = 47 "xml/PLMXML_PSNCRECS.xml"; 48 private static final String DEFAULT_DEBB_COMPONENT_FILE_NAME = "xml/DEBBComponents.xml"; 45 private static final String DEFAULT_INPUT_FILE_NAME = "xml/PLMXML_HLRSSmallServerRoom.xml"; 49 46 private static DocumentBuilder xmlDocumentBuilder; 50 47 private static DocumentBuilderFactory domFactory; … … 250 247 String partId = partRef.getNodeValue().substring(1); // Get rid of # at 251 248 // the beginning 249 // UserData - hostname 250 expr = xpath 251 .compile("plm:UserData/plm:UserValue[@title='hostname']/@value"); 252 result = expr.evaluate(productInstance, XPathConstants.NODE); 253 Node debbHostName = (Node) result; 254 255 // UserData - sequence 256 expr = xpath 257 .compile("plm:UserData/plm:UserValue[@title='sequence']/@value"); 258 result = expr.evaluate(productInstance, XPathConstants.NODE); 259 Node debbSequence = (Node) result; 252 260 253 261 // 2) ProductRevisionView … … 257 265 result = expr.evaluate(plmxmlDocument, XPathConstants.NODE); 258 266 Node productRevisionView = (Node) result; 259 //debbName = productRevisionView.getAttributes().getNamedItem("name");260 //System.out.println("name=" + debbName.getNodeValue());267 // debbName = productRevisionView.getAttributes().getNamedItem("name"); 268 // System.out.println("name=" + debbName.getNodeValue()); 261 269 262 270 // 3) UserValue (to extract DEBB name, level or DEBBComponent file) … … 267 275 Node debbComponentId = (Node) result; 268 276 if (debbComponentId != null) { 269 System.out.println("debbComponentId=" + debbComponentId.getNodeValue()); 277 System.out.println("debbComponentId=" 278 + debbComponentId.getNodeValue()); 270 279 } 271 280 … … 278 287 System.out.println("debbLevel=" + debbLevel.getNodeValue()); 279 288 } 280 289 281 290 // DEBBComponentFile 282 291 expr = xpath … … 297 306 nameAttribute.setValue(debbName.getNodeValue()); 298 307 computingResourceElement.setAttributeNode(nameAttribute); 299 // TODO: how to translate DEBB level to class attribute? 308 300 309 Attr classAttribute = dcwormsDocument.createAttribute("class"); 301 310 String dcwormsClass = computingResourceClasses.get(debbLevel … … 303 312 classAttribute.setValue(dcwormsClass); 304 313 computingResourceElement.setAttributeNode(classAttribute); 314 315 if (debbHostName != null) { 316 // TODO: Where to use this hostname information? 317 Comment comment = dcwormsDocument.createComment("Host name " 318 + debbHostName); 319 computingResourceElement.appendChild(comment); 320 } 321 322 if (debbSequence != null) { 323 // TODO: Sequence is described unclearly in the deliverable, not 324 // used in any example. Where to use this information if it 325 // appears? 326 } 305 327 debbParentElement.appendChild(computingResourceElement); 306 328
Note: See TracChangeset
for help on using the changeset viewer.