return attributes;
}
private static void setMapAttribute(final JSONObject attributes,
final PJsonObject oldRequest, final Template template) throws JSONException {
final CreateMapProcessor mapProcessor = getMapProcessor(template);
final PJsonObject oldMapPage = (PJsonObject) getOldMapPage(oldRequest);
if (mapProcessor == null) {
if (oldMapPage == null) {
// no map, no work
return;
} else {
LOGGER.warn("The request json data has attribute information for creating the map but config does not have a" +
"map attribute. Check that the request and the config.yaml are correct.");
return;
}
} else if (oldMapPage == null) {
LOGGER.warn("The request json data does not have attribute information for creating the map." +
" Check that the request and the config.yaml are correct.");
return;
}
String mapAttributeName = "map";
if (mapProcessor.getInputMapperBiMap().containsValue("map")) {
mapAttributeName = mapProcessor.getInputMapperBiMap().inverse().get("map");
}
final JSONObject map = new JSONObject();
attributes.put(mapAttributeName, map);