User faea122c03
06-06-2008 15:58:25
Hi, everyone!
Now I'm writing plugin which adds SD file to IJC database. For this purpose I wrote the following code:
MDFileReader sdfi = new MDFileReader(filename2);
List ids = edp.queryForIds(DFTermExpression.ALL_DATA, SortDirective.EMPTY, getEnvironment());
Map<String,Object> valuesToUpdate = new HashMap<String,Object>();
List<DFField> fields = entity.getFields().getItems();
while(true){
Molecule str = sdfi.getMolecule();
if(str == null) break;
MarvinStructure dbstr = new MarvinStructure(str);
valuesToUpdate.put(structureFieldId, dbstr);
for(int i=0; i<fields.size(); i++){
String fldid = fields.get(i).getId();
if(fldid.compareTo(structureFieldId) == 0)
continue;
Object fvalue = str.getPropertyObject(fldid);
if(fvalue != null){
valuesToUpdate.put(fldid, dbstr);
}
}
edp.insert(valuesToUpdate, null, getEnvironment());
}
However, by execution this code I obtained the exception message that SD file is invalid because it is not produced by MDFileWriter. Question: Which class should I use for SD file reading in this case?
Now I'm writing plugin which adds SD file to IJC database. For this purpose I wrote the following code:
MDFileReader sdfi = new MDFileReader(filename2);
List ids = edp.queryForIds(DFTermExpression.ALL_DATA, SortDirective.EMPTY, getEnvironment());
Map<String,Object> valuesToUpdate = new HashMap<String,Object>();
List<DFField> fields = entity.getFields().getItems();
while(true){
Molecule str = sdfi.getMolecule();
if(str == null) break;
MarvinStructure dbstr = new MarvinStructure(str);
valuesToUpdate.put(structureFieldId, dbstr);
for(int i=0; i<fields.size(); i++){
String fldid = fields.get(i).getId();
if(fldid.compareTo(structureFieldId) == 0)
continue;
Object fvalue = str.getPropertyObject(fldid);
if(fvalue != null){
valuesToUpdate.put(fldid, dbstr);
}
}
edp.insert(valuesToUpdate, null, getEnvironment());
}
However, by execution this code I obtained the exception message that SD file is invalid because it is not produced by MDFileWriter. Question: Which class should I use for SD file reading in this case?