Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5255


Ignore:
Timestamp:
01/08/11 14:34:26 (13 years ago)
Author:
mholper
Message:

added createmissingProblemParams Method #1218

Location:
branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb/impl/ECJ19ConnectorImpl.java

    r5254 r5255  
    5656    // TODO Auto-generated method stub
    5757   
    58     Set<String> missingParamSet = algoParams.keySet();
    59     missingParamSet.removeAll(okbClient.getAlgorithmParameterMap(state.getAlgorithmId()).keySet());
     58    Set<String> missingAlgoParamSet = algoParams.keySet();
     59    missingAlgoParamSet.removeAll(okbClient.getAlgorithmParameterMap(state.getAlgorithmId()).keySet());
    6060   
    6161    //fehlende Param Anlegen
     62    if (missingAlgoParamSet.size()>0)
     63      okbClient.createMissingAlgoParams(state.getAlgorithmId(), missingAlgoParamSet);   
    6264   
    63     okbClient.createMissingAlgoParams(state.getAlgorithmId(), missingParamSet);   
     65    Set<String> missingProblemParamSet = problemParams.keySet();
     66    missingProblemParamSet.removeAll(okbClient.getProblemParameterMap(state.getProblemId()).keySet());   
    6467
    6568    //create Experiment if algoparams not exists in HL and problemparams not exits (in HL)
  • branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb/wsclient/OKBServiceClient.java

    r5254 r5255  
    33import static at.hl.okb.wsclient.Utilities.createNameFilter;
    44
    5 import java.util.ArrayList;
    65import java.util.HashMap;
    76import java.util.Iterator;
    8 import java.util.List;
    97import java.util.Map;
    108import java.util.Set;
    11 
    12 import javax.xml.bind.JAXBElement;
    139
    1410import at.hl.wsclient.okb.Algorithm;
     
    1713import at.hl.wsclient.okb.AlgorithmParameter;
    1814import at.hl.wsclient.okb.ArrayOfAlgorithmParameter;
     15import at.hl.wsclient.okb.ArrayOfProblemParameter;
    1916import at.hl.wsclient.okb.IOKBService;
    2017import at.hl.wsclient.okb.NamedOKBItem;
     
    2421import at.hl.wsclient.okb.Problem;
    2522import at.hl.wsclient.okb.ProblemClass;
     23import at.hl.wsclient.okb.ProblemData;
     24import at.hl.wsclient.okb.ProblemParameter;
    2625
    2726import com.google.common.collect.Iterables;
     
    109108    Map<String, Object> returnMap = new HashMap<String, Object>();
    110109
    111     AlgorithmData algoData = port.getAlgorithmData(algorithmId);
    112 
    113110    ArrayOfAlgorithmParameter algoParamList = port
    114111        .getAlgorithmParameters(algorithmId);
     
    117114        .getAlgorithmParameter()) {
    118115      returnMap.put(algoParam.getName().getValue(), null);
    119       // port.getDataType(algoParam.getDataTypeId()).getName().getValue());
    120116    }
    121117
    122118    return returnMap;
    123119  }
     120 
     121  public Map<String, Object> getProblemParameterMap(Long ProblemId) {
     122    Map<String, Object> returnMap = new HashMap<String, Object>();
     123
     124    ArrayOfProblemParameter algoParamList = port
     125        .getProblemParameters(ProblemId);
     126
     127    for (ProblemParameter algoParam : algoParamList
     128        .getProblemParameter()) {
     129      returnMap.put(algoParam.getName().getValue(), null);
     130    }
     131
     132    return returnMap;
     133  }
     134 
     135
    124136
    125137  private <T extends NamedOKBItem> T createNamedOKBItem(Class<T> clazz,
     
    160172    }
    161173  }
     174 
     175  public void createMissingProblemParams(Long ProblemId,
     176      Set<String> missingParamNames) {
     177
     178    //falls Werte auch verglichen werdne sollen
     179    //Map<String, Object> ecjProblemParams
     180    //Set<String> missingParamNames = ecjProblemParams.keySet();
     181    for (String paramname : missingParamNames) {
     182      ProblemParameter newProblemParam = new ProblemParameter();
     183      newProblemParam.setProblemId(ProblemId);
     184      newProblemParam.setDataTypeId(null);// TODO insert DatatypeId if not
     185                        // exists (mapping first);
     186      newProblemParam.setDescription(factory
     187          .createNamedOKBItemDescription("created from ECJ"));
     188      newProblemParam.setName(factory
     189          .createNamedOKBItemDescription(paramname));
     190      port.addProblemParameter(newProblemParam);
     191    }
     192  }
    162193}
Note: See TracChangeset for help on using the changeset viewer.