This repository was archived by the owner on Sep 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
src/main/java/com/marklogic/mgmt/security Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,33 @@ protected String[] getUpdateResourceParams(String payload) {
79
79
return params .toArray (new String [] {});
80
80
}
81
81
82
+ /**
83
+ * In ML 8.0-5.1 deleting an amp fails if the database is specified on the
84
+ * delete url
85
+ */
86
+ @ Override
87
+ protected String [] getDeleteResourceParams (String payload ) {
88
+ List <String > params = new ArrayList <String >();
89
+ params .add ("document-uri" );
90
+ if (payloadParser .isJsonPayload (payload )) {
91
+ JsonNode node = payloadParser .parseJson (payload );
92
+ params .add (node .get ("document-uri" ).asText ());
93
+ if (node .has ("namespace" )) {
94
+ params .add ("namespace" );
95
+ params .add (node .get ("namespace" ).asText ());
96
+ }
97
+ } else {
98
+ Fragment f = new Fragment (payload );
99
+ params .add (f .getElementValue ("/node()/*[local-name(.) = 'document-uri']" ));
100
+
101
+ String val = f .getElementValue ("/node()/*[local-name(.) = 'namespace']" );
102
+ if (val != null ) {
103
+ params .add ("namespace" );
104
+ params .add (val );
105
+ }
106
+ }
107
+ return params .toArray (new String [] {}); }
108
+
82
109
public void setNamespace (String namespace ) {
83
110
this .namespace = namespace ;
84
111
}
You can’t perform that action at this time.
0 commit comments