static void scanForTemplateParameters(RestResource resource) {
for (RestResource restResource : RestUtils.extractAncestorsParentFirst(resource)) {
for (String p : RestUtils.extractTemplateParams(restResource.getPath())) {
if (!resourceOrParentHasProperty(restResource, p)) {
RestParamProperty property = restResource.addProperty(p);
property.setStyle(RestParamsPropertyHolder.ParameterStyle.TEMPLATE);
String value = UISupport.prompt("Specify default value for parameter [" + p + "]",
"Add Parameter", "");
if (value != null) {
property.setDefaultValue(value);
property.setValue(value);
}
}
}
}
}