Package com.coveo.pushapiclient
Class DocumentBuilder
java.lang.Object
com.coveo.pushapiclient.DocumentBuilder
Utility class to build a
Document-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmarshal()Marshal the document into a JSON string accepted by the push API.com.google.gson.JsonObjectMarshal the document into a JSON object accepted by the push API.withAllowAnonymousUsers(Boolean allowAnonymous) Set allowAnonymous for permissions on the document.withAllowedPermissions(SecurityIdentityBuilder allowedPermissions) Set allowed identities on the document.withAuthor(String author) Set the author on the document.withClickableUri(String clickableUri) Set the clickableURI on the document.withCompressedBinaryData(CompressedBinaryData compressedBinaryData) Set the base64 encoded, compressed binary data of the document.withCompressedBinaryDataFileId(String compressedBinaryDataFileId) Set the file container file ID for the compressed binary data of the document.Set the data of the document.Set the date of the document.Set the date of the document.Set the date of the document.withDate(org.joda.time.DateTime date) Set the date of the document.withDeniedPermissions(SecurityIdentityBuilder deniedPermissions) Set denied identities on the document.withDocumentPermissions(DocumentPermissions[] documentPermissions) Set the fully built out DocumentPermissions array.withFileExtension(String fileExtension) Set the file extension on the document.withMetadata(Map<String, Object> metadata) Set metadata on the document.withMetadataValue(String key, Integer metadataValue) Add a single metadata key and value pair on the document.withMetadataValue(String key, Integer[] metadataValue) Add a single metadata key and value pair on the document.withMetadataValue(String key, String metadataValue) Add a single metadata key and value pair on the document.withMetadataValue(String key, String[] metadataValue) Add a single metadata key and value pair on the document.withModifiedDate(Long date) Set the modified date of the document.withModifiedDate(String date) Set the modified date of the document.withModifiedDate(Date date) Set the modified date of the document.withModifiedDate(org.joda.time.DateTime date) Set the modified date of the document.withParentID(String parentID) Set the parentID on the document.withPermanentId(String permanentId) Set the permanentID of the document.
-
Constructor Details
-
DocumentBuilder
- Parameters:
uri- the URI of the document. SeeDocument.urititle- the title of the document. SeeDocument.title
-
-
Method Details
-
getDocument
-
withData
Set the data of the document. SeeDocument.data- Parameters:
data-- Returns:
-
withDate
Set the date of the document. SeeDocument.date- Parameters:
date-- Returns:
-
withDate
Set the date of the document. SeeDocument.date- Parameters:
date-- Returns:
-
withDate
Set the date of the document. SeeDocument.date- Parameters:
date-- Returns:
-
withDate
Set the date of the document. SeeDocument.date- Parameters:
date-- Returns:
-
withModifiedDate
Set the modified date of the document. SeeDocument.modifiedDate- Parameters:
date-- Returns:
-
withModifiedDate
Set the modified date of the document. SeeDocument.modifiedDate- Parameters:
date-- Returns:
-
withModifiedDate
Set the modified date of the document. SeeDocument.modifiedDate- Parameters:
date-- Returns:
-
withModifiedDate
Set the modified date of the document. SeeDocument.modifiedDate- Parameters:
date-- Returns:
-
withPermanentId
Set the permanentID of the document. SeeDocument.permanentId- Parameters:
permanentId-- Returns:
-
withCompressedBinaryData
Set the base64 encoded, compressed binary data of the document. SeeDocument.compressedBinaryData- Parameters:
compressedBinaryData-- Returns:
-
withCompressedBinaryDataFileId
Set the file container file ID for the compressed binary data of the document. SeeDocument.compressedBinaryDataFileId- Parameters:
compressedBinaryDataFileId-- Returns:
-
withFileExtension
Set the file extension on the document. SeeDocument.fileExtension- Parameters:
fileExtension-- Returns:
-
withParentID
Set the parentID on the document. SeeDocument.parentId- Parameters:
parentID-- Returns:
-
withClickableUri
Set the clickableURI on the document. SeeDocument.clickableUri- Parameters:
clickableUri-- Returns:
-
withAuthor
Set the author on the document. SeeDocument.author- Parameters:
author-- Returns:
-
withMetadataValue
Add a single metadata key and value pair on the document. SeeDocument.metadata- Parameters:
key-metadataValue-- Returns:
-
withMetadataValue
Add a single metadata key and value pair on the document. SeeDocument.metadata- Parameters:
key-metadataValue-- Returns:
-
withMetadataValue
Add a single metadata key and value pair on the document. SeeDocument.metadata- Parameters:
key-metadataValue-- Returns:
-
withMetadataValue
Add a single metadata key and value pair on the document. SeeDocument.metadata- Parameters:
key-metadataValue-- Returns:
-
withMetadata
Set metadata on the document. SeeDocument.metadata- Parameters:
metadata-- Returns:
-
withAllowedPermissions
Set allowed identities on the document. SeeDocument.permissions- Parameters:
allowedPermissions-- Returns:
-
withDeniedPermissions
Set denied identities on the document. SeeDocument.permissions- Parameters:
deniedPermissions-- Returns:
-
withAllowAnonymousUsers
Set allowAnonymous for permissions on the document. SeeDocument.permissions- Parameters:
allowAnonymous-- Returns:
-
withDocumentPermissions
Set the fully built out DocumentPermissions array. SeeDocument.permissions- Parameters:
documentPermissions-- Returns:
-
marshal
Marshal the document into a JSON string accepted by the push API.- Returns:
-
marshalJsonObject
public com.google.gson.JsonObject marshalJsonObject()Marshal the document into a JSON object accepted by the push API.- Returns:
-