Skip to content

Commit 4301325

Browse files
authored
Merge pull request #462 from jmakeig/dataservices-example
Data Services example clean-up
2 parents 2f9ef38 + 2db895c commit 4301325

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

examples/data-services/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ Next, run the following Gradle task to deploy the example application:
1717
This creates an app server suitable for Data Services - i.e. one without a rewriter. It also creates a user named
1818
"data-services-example-user" which demonstrates the minimum set of roles needed to invoke a Data Services endpoint.
1919

20+
To generate the `org.example.HelloWorld` proxy class, run:
21+
22+
```shell
23+
gradle generateHelloWorld
24+
```
25+
26+
Take a look at `build.gradle` to see how this task is implemented using `com.marklogic.client.tools.gradle.EndpointProxiesGenTask`.
27+
2028
You can then test the application either by running the following Gradle task:
2129

2230
```shell

examples/data-services/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
plugins {
22
id "java"
33
id "net.saliman.properties" version "1.4.6"
4-
id "com.marklogic.ml-gradle" version "3.13.0"
4+
id "com.marklogic.ml-gradle" version "3.14.0"
55
id 'com.marklogic.ml-development-tools' version '4.2.0'
66
}
77

8+
// apply plugin : 'eclipse'
9+
810
task generateHelloWorld(type: com.marklogic.client.tools.gradle.EndpointProxiesGenTask) {
911
description = "This task is used to generate the src/main/java/com/acme/HelloWorld.java class"
1012
serviceDeclarationFile = 'src/main/ml-modules/root/helloWorld/service.json'

examples/data-services/src/main/java/org/example/HelloWorld.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
import com.marklogic.client.DatabaseClient;
8-
98
import com.marklogic.client.impl.BaseProxy;
109

1110
/**
@@ -33,7 +32,7 @@ private HelloWorldImpl(DatabaseClient dbClient) {
3332
public String whatsUp(String greeting, Long frequency) {
3433
return BaseProxy.StringType.toString(
3534
baseProxy
36-
.request("helloWorld.sjs", BaseProxy.ParameterValuesKind.MULTIPLE_ATOMICS)
35+
.request("whatsUp.sjs", BaseProxy.ParameterValuesKind.MULTIPLE_ATOMICS)
3736
.withSession()
3837
.withParams(
3938
BaseProxy.atomicParam("greeting", false, BaseProxy.StringType.fromString(greeting)),

0 commit comments

Comments
 (0)