Revert "Switching to formal XML body construction via GS*Encoder classes. #199"
This reverts commit e218762e86.
This commit is contained in:
parent
e218762e86
commit
cd511983c0
@ -3263,7 +3263,7 @@ public class GeoServerRESTPublisher {
|
|||||||
* @param calculationMode
|
* @param calculationMode
|
||||||
* @return true if recalculation succeeded, false otherwise.
|
* @return true if recalculation succeeded, false otherwise.
|
||||||
*/
|
*/
|
||||||
private boolean recalculateBBox(StoreType type, GSResourceEncoder renc, String workspace, String storeName, String layerName, BBoxRecalculationMode calculationMode){
|
private boolean recalculateBBox(StoreType type, String xmlElementName, String workspace, String storeName, String layerName, BBoxRecalculationMode calculationMode, boolean enabled){
|
||||||
|
|
||||||
String baseUrl = restURL + "/rest/workspaces/" + workspace + "/" +
|
String baseUrl = restURL + "/rest/workspaces/" + workspace + "/" +
|
||||||
type.getType().toLowerCase() +"s/" + storeName + "/" +
|
type.getType().toLowerCase() +"s/" + storeName + "/" +
|
||||||
@ -3283,12 +3283,8 @@ public class GeoServerRESTPublisher {
|
|||||||
// GSWorkspaceEncoder wsenc = new GSWorkspaceEncoder(workspace);
|
// GSWorkspaceEncoder wsenc = new GSWorkspaceEncoder(workspace);
|
||||||
|
|
||||||
// String body = wsenc.toString();
|
// String body = wsenc.toString();
|
||||||
// String body = "<" + xmlElementName +"><name>" + layerName + "</name>" +
|
String body = "<" + xmlElementName +"><name>" + layerName + "</name>" +
|
||||||
// "<enabled>" + enabled + "</enabled></" + xmlElementName + ">";
|
"<enabled>" + enabled + "</enabled></" + xmlElementName + ">";
|
||||||
renc.remove(GSResourceEncoder.KEYWORDS);
|
|
||||||
renc.remove(GSResourceEncoder.METADATA);
|
|
||||||
renc.remove(GSResourceEncoder.METADATALINKS);
|
|
||||||
String body = renc.toString();
|
|
||||||
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;
|
||||||
@ -3303,11 +3299,7 @@ public class GeoServerRESTPublisher {
|
|||||||
* @return true if successful, false otherwise
|
* @return true if successful, false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean recalculateFeatureTypeBBox(String workspace, String storeName, String layerName, BBoxRecalculationMode calculationMode, boolean enabled){
|
public boolean recalculateFeatureTypeBBox(String workspace, String storeName, String layerName, BBoxRecalculationMode calculationMode, boolean enabled){
|
||||||
GSFeatureTypeEncoder fenc = new GSFeatureTypeEncoder();
|
return recalculateBBox(StoreType.DATASTORES, "featureType", workspace, storeName, layerName, calculationMode, enabled);
|
||||||
fenc.remove(GSFeatureTypeEncoder.ATTRIBUTES);
|
|
||||||
fenc.setName(layerName);
|
|
||||||
fenc.setEnabled(enabled);
|
|
||||||
return recalculateBBox(StoreType.DATASTORES, fenc, workspace, storeName, layerName, calculationMode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3319,10 +3311,6 @@ public class GeoServerRESTPublisher {
|
|||||||
* @return true if successful, false otherwise
|
* @return true if successful, false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean recalculateCoverageBBox(String workspace, String storeName, String layerName, BBoxRecalculationMode calculationMode, boolean enabled){
|
public boolean recalculateCoverageBBox(String workspace, String storeName, String layerName, BBoxRecalculationMode calculationMode, boolean enabled){
|
||||||
GSCoverageEncoder cenc = new GSCoverageEncoder();
|
return recalculateBBox(StoreType.COVERAGESTORES, "coverage", workspace, storeName, layerName, calculationMode, enabled);
|
||||||
cenc.remove(GSCoverageEncoder.SUPPORTED_FORMATS);
|
|
||||||
cenc.setName(layerName);
|
|
||||||
cenc.setEnabled(enabled);
|
|
||||||
return recalculateBBox(StoreType.COVERAGESTORES, cenc, workspace, storeName, layerName, calculationMode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ public class GSCoverageEncoder extends GSResourceEncoder {
|
|||||||
public final static String NATIVECOVERAGENAME = "nativeCoverageName";
|
public final static String NATIVECOVERAGENAME = "nativeCoverageName";
|
||||||
|
|
||||||
private final static String NATIVE_FORMAT="nativeFormat";
|
private final static String NATIVE_FORMAT="nativeFormat";
|
||||||
public final static String SUPPORTED_FORMATS="supportedFormats";
|
private final static String SUPPORTED_FORMATS="supportedFormats";
|
||||||
|
|
||||||
private final static String REQUEST_SRS="requestSRS";
|
private final static String REQUEST_SRS="requestSRS";
|
||||||
private final static String RESPONSE_SRS="responseSRS";
|
private final static String RESPONSE_SRS="responseSRS";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user