Skip to content

Commit 0968329

Browse files
authored
Merge pull request #1734 from marklogic/feature/18751-docs
MLE-18751 Added docs about descriptors and content versioning
2 parents e1778ba + 9fba4be commit 0968329

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

marklogic-client-api/src/main/java/com/marklogic/client/document/DocumentDescriptor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
import com.marklogic.client.io.Format;
77

88
/**
9-
* A Document Descriptor describes a database document.
9+
* A Document Descriptor describes a database document. If content versioning is enabled on the app server used
10+
* to retrieve a document via an instance of this class, note that you may receive a null return value if the
11+
* corresponding document has not been modified.
1012
*/
1113
public interface DocumentDescriptor extends ContentDescriptor {
1214
/**

marklogic-client-api/src/main/java/com/marklogic/client/document/DocumentManager.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ <T extends R> T read(String docId, T contentHandle, ServerTransform transform)
240240
* @param desc a descriptor for the URI identifier, format, and mimetype of the document
241241
* @param contentHandle a handle for reading the content of the document
242242
* @param <T> the type of content handle to return
243-
* @return the content handle populated with the content of the document in the database
243+
* @return the content handle populated with the content of the document in the database, or null if content
244+
* versioning is enabled and the document has not been modified.
244245
* @throws ResourceNotFoundException if the document is not found
245246
*/
246247
<T extends R> T read(DocumentDescriptor desc, T contentHandle)
@@ -254,7 +255,8 @@ <T extends R> T read(DocumentDescriptor desc, T contentHandle)
254255
* @param contentHandle a handle for reading the content of the document
255256
* @param transform a server transform to modify the document content
256257
* @param <T> the type of content handle to return
257-
* @return the content handle populated with the content of the document in the database
258+
* @return the content handle populated with the content of the document in the database, or null if content
259+
* versioning is enabled and the document has not been modified.
258260
* @throws ResourceNotFoundException if the document is not found
259261
*/
260262
<T extends R> T read(DocumentDescriptor desc, T contentHandle, ServerTransform transform)
@@ -298,7 +300,8 @@ <T extends R> T read(String docId, DocumentMetadataReadHandle metadataHandle, T
298300
* @param metadataHandle a handle for reading the metadata of the document
299301
* @param contentHandle a handle for reading the content of the document
300302
* @param <T> the type of content handle to return
301-
* @return the content handle populated with the content of the document in the database
303+
* @return the content handle populated with the content of the document in the database, or null if content
304+
* versioning is enabled and the document has not been modified.
302305
* @throws ResourceNotFoundException if the document is not found
303306
*/
304307
<T extends R> T read(DocumentDescriptor desc, DocumentMetadataReadHandle metadataHandle, T contentHandle)
@@ -313,7 +316,8 @@ <T extends R> T read(DocumentDescriptor desc, DocumentMetadataReadHandle metadat
313316
* @param contentHandle a handle for reading the content of the document
314317
* @param transform a server transform to modify the document content
315318
* @param <T> the type of content handle to return
316-
* @return the content handle populated with the content of the document in the database
319+
* @return the content handle populated with the content of the document in the database, or null if content
320+
* versioning is enabled and the document has not been modified.
317321
* @throws ResourceNotFoundException if the document is not found
318322
*/
319323
<T extends R> T read(DocumentDescriptor desc, DocumentMetadataReadHandle metadataHandle, T contentHandle, ServerTransform transform)
@@ -357,7 +361,8 @@ <T extends R> T read(String docId, T contentHandle, ServerTransform transform, T
357361
* @param contentHandle a handle for reading the content of the document
358362
* @param transaction a open transaction under which the document may have been created or deleted
359363
* @param <T> the type of content handle to return
360-
* @return the content handle populated with the content of the document in the database
364+
* @return the content handle populated with the content of the document in the database, or null if content
365+
* versioning is enabled and the document has not been modified.
361366
* @throws ResourceNotFoundException if the document is not found
362367
*/
363368
<T extends R> T read(DocumentDescriptor desc, T contentHandle, Transaction transaction)
@@ -372,7 +377,8 @@ <T extends R> T read(DocumentDescriptor desc, T contentHandle, Transaction trans
372377
* @param transform a server transform to modify the document content
373378
* @param transaction a open transaction under which the document may have been created or deleted
374379
* @param <T> the type of content handle to return
375-
* @return the content handle populated with the content of the document in the database
380+
* @return the content handle populated with the content of the document in the database, or null if content
381+
* versioning is enabled and the document has not been modified.
376382
* @throws ResourceNotFoundException if the document is not found
377383
*/
378384
<T extends R> T read(DocumentDescriptor desc, T contentHandle, ServerTransform transform, Transaction transaction)
@@ -419,7 +425,8 @@ <T extends R> T read(String docId, DocumentMetadataReadHandle metadataHandle, T
419425
* @param contentHandle a handle for reading the content of the document
420426
* @param transaction a open transaction under which the document may have been created or deleted
421427
* @param <T> the type of content handle to return
422-
* @return the content handle populated with the content of the document in the database
428+
* @return the content handle populated with the content of the document in the database, or null if content
429+
* versioning is enabled and the document has not been modified.
423430
* @throws ResourceNotFoundException if the document is not found
424431
*/
425432
<T extends R> T read(DocumentDescriptor desc, DocumentMetadataReadHandle metadataHandle, T contentHandle, Transaction transaction)
@@ -435,7 +442,8 @@ <T extends R> T read(DocumentDescriptor desc, DocumentMetadataReadHandle metadat
435442
* @param transform a server transform to modify the document content
436443
* @param transaction a open transaction under which the document may have been created or deleted
437444
* @param <T> the type of content handle to return
438-
* @return the content handle populated with the content of the document in the database
445+
* @return the content handle populated with the content of the document in the database, or null if content
446+
* versioning is enabled and the document has not been modified.
439447
* @throws ResourceNotFoundException if the document is not found
440448
*/
441449
<T extends R> T read(DocumentDescriptor desc, DocumentMetadataReadHandle metadataHandle, T contentHandle, ServerTransform transform, Transaction transaction)

0 commit comments

Comments
 (0)