Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
BillFarber committed Aug 14, 2024
2 parents 265ddc2 + 61c440c commit 8cc5a64
Show file tree
Hide file tree
Showing 1,036 changed files with 5,116 additions and 23,309 deletions.
26 changes: 12 additions & 14 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
MarkLogic® Java Client API

Copyright © 2022 MarkLogic Corporation. MarkLogic and the MarkLogic logo are trademarks or registered trademarks of MarkLogic Corporation in the United States and other countries. All other trademarks are the property of their respective owners.
Copyright © 2024 MarkLogic Corporation. All Rights Reserved.

This project is licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

To the extent required by the applicable open source license, a complete machine-readable copy of the source code corresponding to such code is available upon request. This offer is valid to anyone in receipt of this information and shall expire three years following the date of the final distribution of this product version by MarkLogic. To obtain such source code, send an email to [email protected]. Please specify the product and version for which you are requesting source code.

The following software may be included in this project (last updated November 18, 2022):
To the extent required by the applicable open-source license, a complete machine-readable copy of the source code
corresponding to such code is available upon request. This offer is valid to anyone in receipt of this information and
shall expire three years following the date of the final distribution of this product version by
Progress Software Corporation. To obtain such source code, send an email to [email protected].
Please specify the product and version for which you are requesting source code.

-------------------------------------------------------------------------
Third Party Components

Apache Commons BeanUtils™ 1.9.4
Attribution Statements
Expand Down Expand Up @@ -76,7 +74,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/apache/commons-lang

Jackson Annotations 2.15.3
Jackson Annotations 2.17.2
Attribution Statements
http://wiki.fasterxml.com/JacksonHome

Expand All @@ -86,7 +84,7 @@ Copyright ©2009 FasterXML, LLC
License Text (http://spdx.org/licenses/Apache-2.0)
Made available under the Apache License 2.0. See Appendix for full text.

Jackson Core 2.15.3
Jackson Core 2.17.2
Attribution Statements
http://wiki.fasterxml.com/JacksonHome

Expand All @@ -98,7 +96,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/FasterXML/jackson-core

Jackson Databind 2.15.3
Jackson Databind 2.17.2
Attribution Statements
http://wiki.fasterxml.com/JacksonHome

Expand All @@ -116,7 +114,7 @@ License Text (http://www.apache.org/licenses/LICENSE-2.0.txt)
Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/FasterXML/jackson-databind
Jackson Dataformat CSV 2.15.3
Jackson Dataformat CSV 2.17.2
Attribution Statements
https://github.com/FasterXML/jackson-dataformat-csv

Expand Down
58 changes: 0 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,64 +49,6 @@ Full documentation is available at:
* [Java Application Developer's Guide](http://docs.marklogic.com/guide/java)
* [JavaDoc](http://docs.marklogic.com/javadoc/client/index.html)

## Including JAXB support

If you are using Java 11 or higher (including Java 17) and you wish to use [JAXB](https://docs.oracle.com/javase/tutorial/jaxb/intro/)
with the client, you'll need to include JAXB API and implementation dependencies as those are no
longer included in Java 11 and higher.

For Maven, include the following in your pom.xml file:

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0.1</version>
</dependency>

For Gradle, include the following in your build.gradle file (this can be included in the same `dependencies` block
as the one that includes the marklogic-client-api dependency):

dependencies {
implementation "javax.xml.bind:jaxb-api:2.3.1"
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
implementation "org.glassfish.jaxb:jaxb-core:2.3.0.1"
}

You are free to use any implementation of JAXB that you wish, but you need to ensure that you're using a JAXB
implementation that corresponds to the `javax.xml.bind` interfaces. JAXB 3.0 and 4.0 interfaces are packaged under
`jakarta.xml.bind`, and the Java API does not yet depend on those interfaces.

Thus, you are free to include an implementation of JAXB 3.0 or 4.0 in your project for your own use; it will not
affect the Java API. A caveat though is if you are trying to use different major versions of the same JAXB
implementation library - such as `org.glassfish.jaxb:jaxb-runtime` - then you will run into an expected dependency
conflict between the two versions of the library. This can be worked around by using a different implementation of
JAXB 3.0 or JAXB 4.0 - for example:

dependencies {
// JAXB 2 dependencies required by Java Client
implementation "javax.xml.bind:jaxb-api:2.3.1"
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
implementation "org.glassfish.jaxb:jaxb-core:2.3.0.1"
// JAXB 4 dependencies required by other application code
implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.0"
implementation "com.sun.xml.bind:jaxb-impl:4.0.1"
}

The client will soon be updated to use the newer `jakarta.xml.bind` interfaces. Until then, the above approach
or one similar to it will allow for both the old and new JAXB interfaces and implementations to exist together in the
same classpath.

## Support

The MarkLogic Java Client is maintained by [MarkLogic](https://www.marklogic.com/) Engineering and is made available under
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022 MarkLogic Corporation
// Copyright © 2024 MarkLogic Corporation. All Rights Reserved.

// We need the properties plugin to work on both marklogic-client-api and test-app. The 'plugins' Gradle syntax can't be
// used for that. So we have to add the properties plugin to the buildscript classpath and then apply the properties
Expand Down
10 changes: 2 additions & 8 deletions examples/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
// Copyright (c) 2022 MarkLogic Corporation
// Copyright © 2024 MarkLogic Corporation. All Rights Reserved.

plugins {
id "java-library"
}

dependencies {
if (JavaVersion.current().isJava9Compatible()) {
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.2'
implementation 'org.glassfish.jaxb:jaxb-core:2.3.0.1'
}
implementation project(':marklogic-client-api')

// Forcing usage of 3.4.0 instead of 3.2.0 to address vulnerability - https://security.snyk.io/vuln/SNYK-JAVA-COMSQUAREUPOKIO-5820002
Expand All @@ -21,7 +16,7 @@ dependencies {
api 'com.squareup.okhttp3:okhttp:4.11.0'
api 'io.github.rburgst:okhttp-digest:2.7'
api 'org.slf4j:slf4j-api:1.7.36'
api 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
api "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"

// hsqldb < 2.7 has a High CVE - https://nvd.nist.gov/vuln/detail/CVE-2022-41853 .
// And hsqldb 2.6+ requires Java 11+. So this is ignored, along with the associated test,
Expand All @@ -35,5 +30,4 @@ dependencies {
api 'com.opencsv:opencsv:4.6'
api 'org.springframework:spring-jdbc:5.3.29'
api 'org.apache.commons:commons-lang3:3.12.0'
api 'org.apache.httpcomponents:httpclient:4.5.14'
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
/*
* Copyright (c) 2022 MarkLogic Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
*/
package com.marklogic.client.example.cookbook;

import java.io.IOException;

import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;
import javax.xml.xpath.XPathExpressionException;

import com.marklogic.client.FailedRequestException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
/*
* Copyright (c) 2022 MarkLogic Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
*/
package com.marklogic.client.example.cookbook;

Expand All @@ -34,10 +22,7 @@ public static void main(String[] args) throws IOException {
public static void run(ExampleProperties props) {
System.out.println("example: "+ClientCreator.class.getName());

// create the client
DatabaseClient client = DatabaseClientFactory.newClient(
props.host, props.port, props.writerUser, props.writerPassword,
props.authType);
DatabaseClient client = Util.newClient(props);

// make use of the client connection
TextDocumentManager docMgr = client.newTextDocumentManager();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
/*
* Copyright (c) 2022 MarkLogic Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
*/
package com.marklogic.client.example.cookbook;

Expand All @@ -38,10 +26,7 @@ public static void run(ExampleProperties props) throws IOException {

String filename = "flipper.xml";

// create the client
DatabaseClient client = DatabaseClientFactory.newClient(
props.host, props.port, props.writerUser, props.writerPassword,
props.authType);
DatabaseClient client = Util.newClient(props);

// create a manager for XML documents
XMLDocumentManager docMgr = client.newXMLDocumentManager();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
/*
* Copyright (c) 2022 MarkLogic Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
*/
package com.marklogic.client.example.cookbook;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

import com.marklogic.client.DatabaseClient;
import com.marklogic.client.DatabaseClientFactory;
import com.marklogic.client.document.GenericDocumentManager;
import com.marklogic.client.example.cookbook.Util.ExampleProperties;
import com.marklogic.client.io.BytesHandle;
import com.marklogic.client.io.InputStreamHandle;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

/**
* DocumentFormats illustrates working with documents in multiple or unknown formats.
*/
Expand All @@ -45,10 +32,7 @@ public static void run(ExampleProperties props) throws IOException {
{"flipper.xml", "XML"}
};

// create the client
DatabaseClient client = DatabaseClientFactory.newClient(
props.host, props.port, props.writerUser, props.writerPassword,
props.authType);
DatabaseClient client = Util.newClient(props);

// iterate over the files
for (String[] fileEntry: fileEntries) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
/*
* Copyright (c) 2022 MarkLogic Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
*/
package com.marklogic.client.example.cookbook;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

import org.w3c.dom.Document;

import com.marklogic.client.DatabaseClient;
import com.marklogic.client.DatabaseClientFactory;
import com.marklogic.client.document.XMLDocumentManager;
import com.marklogic.client.example.cookbook.Util.ExampleProperties;
import com.marklogic.client.io.DOMHandle;
Expand All @@ -31,6 +12,11 @@
import com.marklogic.client.io.DocumentMetadataHandle.DocumentCollections;
import com.marklogic.client.io.DocumentMetadataHandle.DocumentMetadataValues;
import com.marklogic.client.io.InputStreamHandle;
import org.w3c.dom.Document;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

/**
* DocumentMetadataReader illustrates how to read the metadata and content of a database document
Expand All @@ -46,10 +32,7 @@ public static void run(ExampleProperties props) throws IOException {

String filename = "flipper.xml";

// create the client
DatabaseClient client = DatabaseClientFactory.newClient(
props.host, props.port, props.writerUser, props.writerPassword,
props.authType);
DatabaseClient client = Util.newClient(props);

// create a manager for XML documents
XMLDocumentManager docMgr = client.newXMLDocumentManager();
Expand Down
Loading

0 comments on commit 8cc5a64

Please sign in to comment.