This commit is contained in:
Carl Schroedl 2016-09-20 14:32:07 -05:00
parent cd511983c0
commit 6b77579ec0

View File

@ -3261,6 +3261,7 @@ public class GeoServerRESTPublisher {
* @param storeName * @param storeName
* @param layerName * @param layerName
* @param calculationMode * @param calculationMode
* @param enabled
* @return true if recalculation succeeded, false otherwise. * @return true if recalculation succeeded, false otherwise.
*/ */
private boolean recalculateBBox(StoreType type, String xmlElementName, String workspace, String storeName, String layerName, BBoxRecalculationMode calculationMode, boolean enabled){ private boolean recalculateBBox(StoreType type, String xmlElementName, String workspace, String storeName, String layerName, BBoxRecalculationMode calculationMode, boolean enabled){
@ -3270,21 +3271,17 @@ public class GeoServerRESTPublisher {
type.getTypeName().toLowerCase() + "/" + type.getTypeName().toLowerCase() + "/" +
layerName + "." + Format.XML.toString(); layerName + "." + Format.XML.toString();
// LOGGER.debug("Retrieving current state of item from "+ baseUrl);
// String getResult = HTTPUtils.get(baseUrl, gsuser, gspass);
// LOGGER.debug("Current state of item is:\n" + getResult);
String sUrl = baseUrl + "?recalculate=" + calculationMode.getParamValue(); String sUrl = baseUrl + "?recalculate=" + calculationMode.getParamValue();
LOGGER.debug("Constructed the following url for bounding box recalculation: " + sUrl); LOGGER.debug("Constructed the following url for bounding box recalculation: " + sUrl);
// String body = getResult /*
// GSWorkspaceEncoder wsenc = new GSWorkspaceEncoder(workspace); * If the 'enabled' element is not specified in the request body, it will be set to 'false' by GeoServer.
* To avoid unintentional disabling of layers, this method and its callers
// String body = wsenc.toString(); * require that users specify whether the layer should be enabled.
*/
String body = "<" + xmlElementName +"><name>" + layerName + "</name>" + String body = "<" + xmlElementName +"><name>" + layerName + "</name>" +
"<enabled>" + enabled + "</enabled></" + xmlElementName + ">"; "<enabled>" + enabled + "</enabled></" + xmlElementName + ">";
String sendResult = HTTPUtils.putXml(sUrl, body, gsuser, gspass); String sendResult = HTTPUtils.putXml(sUrl, body, gsuser, gspass);
boolean success = sendResult != null; boolean success = sendResult != null;
return success; return success;