public interface DocumentMetadataPatchBuilder
A DocumentMetadataPatchBuilder specifies changes to the metadata of a database document. When using the newPatchBuilder() factory method of the DocumentManager to create the builder, you identify whether paths are specified with JSONPath or XPath.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
DocumentMetadataPatchBuilder.Call
A Call specifies how to apply a built-in or library function when replacing an existing fragment.
|
static interface |
DocumentMetadataPatchBuilder.CallBuilder
A CallBuilder constructs a Call to a built-in or library function to produce the replacement for an existing fragment.
|
static class |
DocumentMetadataPatchBuilder.Cardinality
The Cardinality enumeration indicates the number of times that a path can match without error (which defaults to ZERO_OR_MORE, meaning any number of matches).
|
static interface |
DocumentMetadataPatchBuilder.PatchHandle
A PatchHandle produced by the builder can produce a string representation of the patch for saving, logging, or other uses.
|
| Modifier and Type | Method and Description |
|---|---|
DocumentMetadataPatchBuilder |
addCollection(String... collections)
Adds the specified collections.
|
DocumentMetadataPatchBuilder |
addMetadataValue(String key,
String value)
Adds a new metadata-value
|
DocumentMetadataPatchBuilder |
addPermission(String role,
DocumentMetadataHandle.Capability... capabilities)
Adds a role with the specified capabilities
|
DocumentMetadataPatchBuilder |
addPropertyValue(QName name,
Object value)
Adds a new metadata property with a namespaced name.
|
DocumentMetadataPatchBuilder |
addPropertyValue(String name,
Object value)
Adds a new metadata property with a simple name.
|
DocumentMetadataPatchBuilder.PatchHandle |
build()
Builds the patch that modifies the metadata or content of the database document and provides a handle for sending the patch to the server using the patch() method of the DocumentManager.
|
DocumentMetadataPatchBuilder.CallBuilder |
call()
A factory method for building calls to modify an existing node by applying built-in functions or functions from a library.
|
DocumentMetadataPatchBuilder |
deleteCollection(String... collections)
Deletes the specified collections.
|
DocumentMetadataPatchBuilder |
deleteMetadataValue(String key)
Deletes the specified metadata-value with the given key.
|
DocumentMetadataPatchBuilder |
deletePermission(String... roles)
Deletes the specified roles.
|
DocumentMetadataPatchBuilder |
deleteProperty(QName... names)
Deletes the specified metadata properties with namespaced names.
|
DocumentMetadataPatchBuilder |
deleteProperty(String... names)
Deletes the specified metadata properties with simple names.
|
IterableNamespaceContext |
getNamespaces()
Returns the namespaces available for the paths of a patch against XML documents.
|
DocumentMetadataPatchBuilder |
library(String ns,
String at)
Specifies an XQuery library installed on the server that supplies functions for modifying existing fragments.
|
DocumentMetadataPatchBuilder |
replaceCollection(String oldCollection,
String newCollection)
Replaces the specified collection.
|
DocumentMetadataPatchBuilder |
replaceMetadataValue(String key,
String newValue)
Replaces the existing metadata-value
|
DocumentMetadataPatchBuilder |
replaceMetadataValueApply(String key,
DocumentMetadataPatchBuilder.Call call)
Specifies a replacement operation by applying a function to the metadata-value.
|
DocumentMetadataPatchBuilder |
replacePermission(String role,
DocumentMetadataHandle.Capability... newCapabilities)
Replaces the existing capabilities of a role.
|
DocumentMetadataPatchBuilder |
replacePermission(String oldRole,
String newRole,
DocumentMetadataHandle.Capability... newCapabilities)
Replaces an existing role with a new role.
|
DocumentMetadataPatchBuilder |
replacePropertyApply(QName name,
DocumentMetadataPatchBuilder.Call call)
Specifies a replacement operation by applying a function to a metadata property having a namespaced name.
|
DocumentMetadataPatchBuilder |
replacePropertyApply(String name,
DocumentMetadataPatchBuilder.Call call)
Specifies a replacement operation by applying a function to a metadata property having a simple name.
|
DocumentMetadataPatchBuilder |
replacePropertyValue(QName name,
Object newValue)
Replaces the existing value of a metadata property having a namespaced name.
|
DocumentMetadataPatchBuilder |
replacePropertyValue(QName oldName,
QName newName,
Object newValue)
Replaces an existing metadata property with a new property having a namespaced name.
|
DocumentMetadataPatchBuilder |
replacePropertyValue(String name,
Object newValue)
Replaces the existing value of a metadata property having a simple name.
|
DocumentMetadataPatchBuilder |
replacePropertyValue(String oldName,
String newName,
Object newValue)
Replaces an existing metadata property with a new property having a simple name.
|
void |
setNamespaces(IterableNamespaceContext namespaces)
Declares the namespaces available for the paths of a patch against XML documents.
|
DocumentMetadataPatchBuilder |
setQuality(int quality)
Sets the search quality of the document.
|
IterableNamespaceContext getNamespaces()
Returns the namespaces available for the paths of a patch against XML documents.
void setNamespaces(IterableNamespaceContext namespaces)
Declares the namespaces available for the paths of a patch against XML documents. You can use the EditableNamespaceContext class to edit a set of namespaces. Note that the following prefixes are predefined for internal use: rapi, prop, xsi, and xs
namespaces - the declared namespacesDocumentMetadataPatchBuilder library(String ns, String at)
Specifies an XQuery library installed on the server that supplies functions for modifying existing fragments.
ns - the XQuery library namespaceat - the XQuery library path on the serverDocumentMetadataPatchBuilder addCollection(String... collections)
Adds the specified collections.
collections - the collection identifiersDocumentMetadataPatchBuilder deleteCollection(String... collections)
Deletes the specified collections.
collections - the collection identifiersDocumentMetadataPatchBuilder replaceCollection(String oldCollection, String newCollection)
Replaces the specified collection.
oldCollection - the identifier for the existing collectionnewCollection - the identifier for the new collectionDocumentMetadataPatchBuilder addPermission(String role, DocumentMetadataHandle.Capability... capabilities)
Adds a role with the specified capabilities
role - the name of the rolecapabilities - the set of capabilitiesDocumentMetadataPatchBuilder deletePermission(String... roles)
Deletes the specified roles.
roles - the names of the rolesDocumentMetadataPatchBuilder replacePermission(String role, DocumentMetadataHandle.Capability... newCapabilities)
Replaces the existing capabilities of a role.
role - the name of the rolenewCapabilities - the replacing set of capabilitiesDocumentMetadataPatchBuilder replacePermission(String oldRole, String newRole, DocumentMetadataHandle.Capability... newCapabilities)
Replaces an existing role with a new role.
oldRole - the name of the replaced rolenewRole - the name of the replacing rolenewCapabilities - the capabilities of the replacing roleDocumentMetadataPatchBuilder addMetadataValue(String key, String value)
Adds a new metadata-value
key - the key of the metadata-valuevalue - the value of the metadata-valueDocumentMetadataPatchBuilder deleteMetadataValue(String key)
Deletes the specified metadata-value with the given key.
key - the key of the metadata-valueDocumentMetadataPatchBuilder replaceMetadataValue(String key, String newValue)
Replaces the existing metadata-value
key - the key of the existing metadata-valuenewValue - the new value to be assigned to the keyDocumentMetadataPatchBuilder replaceMetadataValueApply(String key, DocumentMetadataPatchBuilder.Call call)
Specifies a replacement operation by applying a function to the metadata-value. You must use CallBuilder to build a specification of the call.
key - the key of the existing metadata-valuecall - the specification of the function callDocumentMetadataPatchBuilder addPropertyValue(String name, Object value)
Adds a new metadata property with a simple name.
name - the name of the new propertyvalue - the value of the new propertyDocumentMetadataPatchBuilder addPropertyValue(QName name, Object value)
Adds a new metadata property with a namespaced name.
name - the namespaced name of the new propertyvalue - the value of the new propertyDocumentMetadataPatchBuilder deleteProperty(String... names)
Deletes the specified metadata properties with simple names.
names - the property namesDocumentMetadataPatchBuilder deleteProperty(QName... names)
Deletes the specified metadata properties with namespaced names.
names - the namespaced property namesDocumentMetadataPatchBuilder replacePropertyValue(String name, Object newValue)
Replaces the existing value of a metadata property having a simple name.
name - the name of the existing propertynewValue - the new value of the propertyDocumentMetadataPatchBuilder replacePropertyValue(QName name, Object newValue)
Replaces the existing value of a metadata property having a namespaced name.
name - the namespaced name of the existing propertynewValue - the new value of the propertyDocumentMetadataPatchBuilder replacePropertyValue(String oldName, String newName, Object newValue)
Replaces an existing metadata property with a new property having a simple name.
oldName - the name of the existing propertynewName - the name of the replacing propertynewValue - the value of the propertyDocumentMetadataPatchBuilder replacePropertyValue(QName oldName, QName newName, Object newValue)
Replaces an existing metadata property with a new property having a namespaced name.
oldName - the namespaced name of the existing propertynewName - the namespaced name of the replacing propertynewValue - the value of the propertyDocumentMetadataPatchBuilder.CallBuilder call()
A factory method for building calls to modify an existing node by applying built-in functions or functions from a library.
DocumentMetadataPatchBuilder replacePropertyApply(String name, DocumentMetadataPatchBuilder.Call call)
Specifies a replacement operation by applying a function to a metadata property having a simple name. You must use CallBuilder to build a specification of the call.
name - the name of the existing propertycall - the specification of the function callDocumentMetadataPatchBuilder replacePropertyApply(QName name, DocumentMetadataPatchBuilder.Call call)
Specifies a replacement operation by applying a function to a metadata property having a namespaced name. You must use CallBuilder to build a specification of the call.
name - the name of the existing propertycall - the specification of the function callDocumentMetadataPatchBuilder setQuality(int quality)
Sets the search quality of the document.
quality - the new value for search qualityDocumentMetadataPatchBuilder.PatchHandle build() throws MarkLogicIOException
Builds the patch that modifies the metadata or content of the database document and provides a handle for sending the patch to the server using the patch() method of the DocumentManager. Once the patch is built, specifying additional operation with the patch builder do not alter the patch built previously.
MarkLogicIOExceptionCopyright © 2013-2017 MarkLogic Corporation.