Commit d47108ea authored by Richard Bruskiewich's avatar Richard Bruskiewich Committed by Matija Obreza
Browse files

Cleaned out LOG comments from debugging. Code for creation of

category and property ("trait" or Parameter) otherwise seems to work.
The next part for validation if Method.
parent 88f4507d
......@@ -573,35 +573,18 @@ public class GenesysServiceImpl implements GenesysService, TraitService, Dataset
@Transactional(readOnly = false)
public Parameter addParameter(Crop crop, String category, String title) {
LOG.info("addParameter(Crop:"+(crop!=null?crop.getName():"null")+","+category+","+title+")");
LOG.info("new Parameter() ");
Parameter parameter = new Parameter();
LOG.info("setCrop ");
parameter.setCrop(crop); // BEWARE: Crop Rules are defective in JSON rendering
LOG.info("parameterCategoryRepository.findByName(category)");
parameter.setCrop(crop);
ParameterCategory parameterCategory =
parameterCategoryRepository.findByName(category);
LOG.info("setCategory(parameterCategory);");
parameter.setCategory(parameterCategory);
LOG.info("setTitle(title)");
parameter.setTitle(title);
LOG.info("parameterRepository.save(parameter)");
parameterRepository.save(parameter);
LOG.info("return parameter");
return parameter;
}
......
......@@ -171,26 +171,18 @@ public class TraitsController extends RestController {
Crop crop = cropService.getCrop(cropName) ;
//LOG.debug("getParameter? ");
LOG.debug("Calling getParameter()");
//Parameter property = traitService.getParameter(crop, propertyJson.title);
Parameter property = traitService.getParameter(crop, propertyJson.title);
//LOG.debug(property.toString());
if(property == null) {
// create if not available already?
property = traitService.addParameter(crop, propertyJson.category, propertyJson.title);
//if(property == null) { // create if not available already?
LOG.info("Calling traitService.addParameter()");
Parameter property = traitService.addParameter(crop, propertyJson.category, propertyJson.title);
LOG.info("Returning from createProperty()");
// property = traitService.addParameter(crop, propertyJson.category, propertyJson.title);
// LOG.debug("...done.");
//} else
// LOG.warn("Property '"+propertyJson.title+"' in category '"+
// propertyJson.category+"' for crop '"+
// cropName+"' already exists?");
} else
LOG.warn("Property '"+propertyJson.title+"' in category '"+
propertyJson.category+"' for crop '"+
cropName+"' already exists?");
return property;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment