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

Cleaning up inline documentation for new/updated TraitsController REST

API
parent d47108ea
...@@ -103,7 +103,8 @@ public class TraitsController extends RestController { ...@@ -103,7 +103,8 @@ public class TraitsController extends RestController {
/** /**
* Create a new category (ParameterCategory) for a property of a descriptor * Create a new crop property category (ParameterCategory) to
* use with descriptors (property/method/scale) meta-data
* *
* @return * @return
* @throws ValidationException * @throws ValidationException
...@@ -144,10 +145,13 @@ public class TraitsController extends RestController { ...@@ -144,10 +145,13 @@ public class TraitsController extends RestController {
} }
/** /**
* Adds a property by crop * Adds a new property by crop, if such a property for a given crop
* and title doesn't already exist. If it does exist, then the
* existing record is retrieved and sent back.
* *
* @param cropName to which the property belongs (given as a string in the path of the API call)
* @param propertyJson
* @return * @return
* @throws ValidationException * @throws ValidationException
*/ */
...@@ -191,7 +195,7 @@ public class TraitsController extends RestController { ...@@ -191,7 +195,7 @@ public class TraitsController extends RestController {
//@NotNull //@NotNull
//@NotBlank //@NotBlank
//public String uri; //public String rdfUri;
@NotNull @NotNull
@NotBlank @NotBlank
...@@ -204,7 +208,7 @@ public class TraitsController extends RestController { ...@@ -204,7 +208,7 @@ public class TraitsController extends RestController {
} }
/** /**
* Add a crop * Add a crop property method to the database.
* *
* @return * @return
* @throws ValidationException * @throws ValidationException
...@@ -228,6 +232,8 @@ public class TraitsController extends RestController { ...@@ -228,6 +232,8 @@ public class TraitsController extends RestController {
if(propertyId != 0) if(propertyId != 0)
property = traitService.getTrait(propertyId); property = traitService.getTrait(propertyId);
else else
//if the (long integer) property id given in the path is zero,
// then the method is left "floating" in the database.
property = null ; property = null ;
Method method = traitService.addMethod(methodJson.description, methodJson.unit, methodJson.fieldName, methodJson.fieldType, methodJson.fieldSize, Method method = traitService.addMethod(methodJson.description, methodJson.unit, methodJson.fieldName, methodJson.fieldType, methodJson.fieldSize,
...@@ -237,7 +243,11 @@ public class TraitsController extends RestController { ...@@ -237,7 +243,11 @@ public class TraitsController extends RestController {
} }
public static class MethodJson { public static class MethodJson {
//@NotNull
//@NotBlank
//public String rdfUri;
@NotNull @NotNull
@NotBlank @NotBlank
@MinLength(10) @MinLength(10)
......
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