Skip to content

Commit d49eb52

Browse files
committed
Merge branch 'feature/trace-ui' into develop
2 parents ef4ec6c + 01106ea commit d49eb52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2282
-56
lines changed

marklogic-data-hub/src/main/java/com/marklogic/hub/DataHub.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
*/
1616
package com.marklogic.hub;
1717

18+
import java.nio.file.Paths;
19+
import java.util.ArrayList;
20+
import java.util.HashMap;
21+
import java.util.List;
22+
import java.util.Map;
23+
24+
import org.slf4j.Logger;
25+
import org.slf4j.LoggerFactory;
26+
import org.springframework.web.client.ResourceAccessException;
27+
1828
import com.fasterxml.jackson.databind.JsonNode;
1929
import com.marklogic.appdeployer.AppConfig;
2030
import com.marklogic.appdeployer.ConfigDir;
@@ -36,7 +46,14 @@
3646
import com.marklogic.appdeployer.command.groups.DeployGroupsCommand;
3747
import com.marklogic.appdeployer.command.mimetypes.DeployMimetypesCommand;
3848
import com.marklogic.appdeployer.command.schemas.LoadSchemasCommand;
39-
import com.marklogic.appdeployer.command.security.*;
49+
import com.marklogic.appdeployer.command.security.DeployAmpsCommand;
50+
import com.marklogic.appdeployer.command.security.DeployCertificateAuthoritiesCommand;
51+
import com.marklogic.appdeployer.command.security.DeployCertificateTemplatesCommand;
52+
import com.marklogic.appdeployer.command.security.DeployExternalSecurityCommand;
53+
import com.marklogic.appdeployer.command.security.DeployPrivilegesCommand;
54+
import com.marklogic.appdeployer.command.security.DeployProtectedCollectionsCommand;
55+
import com.marklogic.appdeployer.command.security.DeployRolesCommand;
56+
import com.marklogic.appdeployer.command.security.DeployUsersCommand;
4057
import com.marklogic.appdeployer.command.tasks.DeployScheduledTasksCommand;
4158
import com.marklogic.appdeployer.command.triggers.DeployTriggersCommand;
4259
import com.marklogic.appdeployer.command.viewschemas.DeployViewSchemasCommand;
@@ -60,15 +77,6 @@
6077
import com.marklogic.mgmt.databases.DatabaseManager;
6178
import com.marklogic.rest.util.Fragment;
6279
import com.marklogic.rest.util.ResourcesFragment;
63-
import org.slf4j.Logger;
64-
import org.slf4j.LoggerFactory;
65-
import org.springframework.web.client.ResourceAccessException;
66-
67-
import java.nio.file.Paths;
68-
import java.util.ArrayList;
69-
import java.util.HashMap;
70-
import java.util.List;
71-
import java.util.Map;
7280

7381
public class DataHub {
7482

marklogic-data-hub/src/main/resources/ml-config/databases/trace-database.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,34 @@
2828
{
2929
"scalar-type": "string",
3030
"namespace-uri": "",
31-
"localname": "trace-id",
31+
"localname": "traceId",
3232
"collation": "http://marklogic.com/collation/codepoint",
3333
"range-value-positions": false,
3434
"invalid-values": "reject"
35+
},
36+
{
37+
"scalar-type": "string",
38+
"namespace-uri": "",
39+
"localname": "identifier",
40+
"collation": "http://marklogic.com/collation/codepoint",
41+
"range-value-positions": false,
42+
"invalid-values": "reject"
43+
},
44+
{
45+
"scalar-type": "unsignedInt",
46+
"namespace-uri": "http://marklogic.com/data-hub/debug",
47+
"localname": "is-debugging-enabled",
48+
"collation": "",
49+
"range-value-positions": false,
50+
"invalid-values": "reject"
51+
},
52+
{
53+
"scalar-type": "dateTime",
54+
"namespace-uri": "",
55+
"localname": "created",
56+
"collation": "",
57+
"range-value-positions": false,
58+
"invalid-values": "reject"
3559
}
3660
],
3761
"schema-database": "%%SCHEMAS_DATABASE%%",

marklogic-data-hub/src/main/resources/ml-config/servers/trace-server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"authentication": "digest",
1010
"default-error-format": "json",
1111
"error-handler": "/MarkLogic/rest-api/error-handler.xqy",
12-
"url-rewriter": "/MarkLogic/rest-api/rewriter.xml",
12+
"url-rewriter": "/com.marklogic.hub/tracing-rewriter.xml",
1313
"rewrite-resolves-globally": true
1414
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
xquery version "1.0-ml";
2+
3+
import module namespace hul = "http://marklogic.com/data-hub/hub-utils-lib"
4+
at "/com.marklogic.hub/lib/hub-utils-lib.xqy";
5+
6+
import module namespace debug = "http://marklogic.com/data-hub/debug"
7+
at "/com.marklogic.hub/lib/debug-lib.xqy";
8+
9+
declare option xdmp:mapping "false";
10+
11+
debug:dump-env(),
12+
hul:run-in-modules(function() {
13+
fn:doc("/trace-ui" || xdmp:get-request-field("uri"))
14+
})
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
(:
2+
Copyright 2012-2016 MarkLogic Corporation
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
:)
16+
xquery version "1.0-ml";
17+
18+
import module namespace debug = "http://marklogic.com/data-hub/debug"
19+
at "/com.marklogic.hub/lib/debug-lib.xqy";
20+
21+
import module namespace trace = "http://marklogic.com/data-hub/trace"
22+
at "/com.marklogic.hub/lib/trace-lib.xqy";
23+
24+
declare option xdmp:mapping "false";
25+
26+
debug:dump-env(),
27+
28+
let $q := xdmp:get-request-field("q")
29+
return
30+
trace:get-trace-ids($q)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
(:
2+
Copyright 2012-2016 MarkLogic Corporation
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
:)
16+
xquery version "1.0-ml";
17+
18+
import module namespace debug = "http://marklogic.com/data-hub/debug"
19+
at "/com.marklogic.hub/lib/debug-lib.xqy";
20+
21+
import module namespace trace = "http://marklogic.com/data-hub/trace"
22+
at "/com.marklogic.hub/lib/trace-lib.xqy";
23+
24+
declare option xdmp:mapping "false";
25+
26+
debug:dump-env(),
27+
28+
let $id := xdmp:get-request-field("id")
29+
return
30+
trace:get-trace($id)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
(:
2+
Copyright 2012-2016 MarkLogic Corporation
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
:)
16+
xquery version "1.0-ml";
17+
18+
import module namespace debug = "http://marklogic.com/data-hub/debug"
19+
at "/com.marklogic.hub/lib/debug-lib.xqy";
20+
21+
import module namespace trace = "http://marklogic.com/data-hub/trace"
22+
at "/com.marklogic.hub/lib/trace-lib.xqy";
23+
24+
declare option xdmp:mapping "false";
25+
26+
debug:dump-env(),
27+
28+
let $page := (xdmp:get-request-field("p"), 1)[1] ! xs:int(.)
29+
let $page-count := (xdmp:get-request-field("pc"), 10)[1] ! xs:int(.)
30+
return
31+
trace:get-traces($page, $page-count)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
(:
2+
Copyright 2012-2016 MarkLogic Corporation
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
:)
16+
xquery version "1.0-ml";
17+
18+
import module namespace debug = "http://marklogic.com/data-hub/debug"
19+
at "/com.marklogic.hub/lib/debug-lib.xqy";
20+
21+
import module namespace trace = "http://marklogic.com/data-hub/trace"
22+
at "/com.marklogic.hub/lib/trace-lib.xqy";
23+
24+
declare option xdmp:mapping "false";
25+
26+
debug:dump-env(),
27+
28+
let $body := xdmp:get-request-body()
29+
let $q := ($body/q, "")[1]
30+
let $page := ($body/p, 1)[1] ! xs:int(.)
31+
let $page-count := ($body/pc, 10)[1] ! xs:int(.)
32+
return
33+
trace:find-traces($q, $page, $page-count)

0 commit comments

Comments
 (0)