Changeset 565 for DCWoRMS


Ignore:
Timestamp:
11/07/12 09:13:15 (12 years ago)
Author:
gosiaw
Message:

Extracting labels and locations from PLM XML added

File:
1 edited

Legend:

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

    r564 r565  
    108108                        rootElement.appendChild(resourcesElement); 
    109109 
     110                        //***************************************************************** 
    110111                        // Creating (main) scheduler element 
    111112                        // TODO: Fill scheduler with reasonable data! 
     
    116117                        resourcesElement.appendChild(schedulerElement); 
    117118 
     119                        //***************************************************************** 
    118120                        // Transform top level DEBB and all nested DEBBs 
    119121                        transformDEBB(plmxmlDocument, dcwormsDocument, resourcesElement, 
     
    235237 
    236238                // Find DEBB with given id and transform it 
     239                //***************************************************************** 
    237240                // 1) ProductInstance - 
    238241                XPathExpression expr = xpath 
     
    259262                Node debbSequence = (Node) result; 
    260263 
     264                //      UserData - label 
     265                expr = xpath 
     266                                .compile("plm:UserData/plm:UserValue[@title='label']/@value"); 
     267                result = expr.evaluate(productInstance, XPathConstants.NODE); 
     268                Node debbLabel = (Node) result; 
     269 
     270                //      UserData - location 
     271                expr = xpath 
     272                                .compile("plm:UserData/plm:UserValue[@title='location']/@value"); 
     273                result = expr.evaluate(productInstance, XPathConstants.NODE); 
     274                Node debbLocation = (Node) result; 
     275                 
     276                //***************************************************************** 
    261277                // 2) ProductRevisionView 
    262278                expr = xpath 
     
    268284                // System.out.println("name=" + debbName.getNodeValue()); 
    269285 
    270                 // 3) UserValue (to extract DEBB name, level or DEBBComponent file) 
     286                // UserValue (to extract DEBB name, level or DEBBComponent file) 
    271287                // DEBBComponentId 
    272288                expr = xpath 
     
    299315                System.out.println("debbComponentFileName=" + debbComponentFileName); 
    300316 
     317                //***************************************************************** 
    301318                // Add computingResource element for the DEBB 
    302319                if (debbLevel != null) { 
     
    316333                                // TODO: Where to use this hostname information? 
    317334                                Comment comment = dcwormsDocument.createComment("Host name " 
    318                                                 + debbHostName); 
     335                                                + debbHostName.getNodeValue()); 
    319336                                computingResourceElement.appendChild(comment); 
    320337                        } 
     
    327344                        debbParentElement.appendChild(computingResourceElement); 
    328345 
     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); 
     351                        } 
     352 
     353                        if (debbLocation != null) { 
     354                                // TODO: Where to use this location information? 
     355                                Comment comment = dcwormsDocument.createComment("Location " 
     356                                                + debbLocation.getNodeValue()); 
     357                                computingResourceElement.appendChild(comment); 
     358                        } 
     359                         
     360                        //***************************************************************** 
    329361                        // Get nested instances - nested DEBBs and ask them to transform 
    330362                        // themselves 
Note: See TracChangeset for help on using the changeset viewer.