public class ContentCreateOptions
extends java.lang.Object
implements java.lang.Cloneable
DocumentFormat.NONE
which indicates that server-configured defaults should be used to
determine the document format.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_ENCODING
The default character encoding (UTF-8) that will
be assumed if not explicitly set by
setEncoding(String) . |
static int |
MAX_BUFFER_SIZE
The maximum user-settable buffer size
(12MB)
|
static int |
MIN_BUFFER_SIZE
The minimum user-settable buffer size
(256)
|
Constructor and Description |
---|
ContentCreateOptions() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
int |
getBufferSize()
Return the preferred working buffer size to use
for copying the content to the server.
|
java.lang.String[] |
getCollections()
Return the set of collection URIs currently in
effect for this options object.
|
java.lang.String |
getEncoding()
Get the current charset encoding setting for
this options object.
|
DocumentFormat |
getFormat()
Return the document format value currently in
effect for this options object.
|
java.lang.String |
getGraph()
Get the RDF Graph for this options object
|
java.lang.String |
getLanguage()
Get the current language setting for this
options object.
|
java.util.Locale |
getLocale()
Get the
Locale setting for this
options object. |
java.util.Map<java.lang.String,java.lang.String> |
getMetadata()
Return the set of metadata currently in effect
for this options object.
|
java.lang.String |
getNamespace()
Return the namespace name setting current in
effect for this options object.
|
ContentPermission[] |
getPermissions()
Return the set of document permissions currently
in effect for this options object.
|
java.math.BigInteger[] |
getPlaceKeys()
Returns the set of forest placement keys (forest
IDs) currently in effect for this options object.
|
int |
getQuality()
Return the quality value currently set on this
options object.
|
DocumentRepairLevel |
getRepairLevel()
Return the current document repair level
setting.
|
int |
getResolveBufferSize()
Indicate the buffer size to use for entity
resolution.
|
boolean |
getResolveEntities()
Get the current setting of the flag which
indicates whether or not to resolve entities embedded in an XML
document to be inserted.
|
java.lang.String |
getTemporalCollection()
Get the temporal collection for this options
object.
|
java.lang.String |
getTemporalVersionURI()
Get the temporal version URI for this options
object.
|
static ContentCreateOptions |
newBinaryInstance()
Create an instance with format set to
DocumentFormat.BINARY . |
static ContentCreateOptions |
newJsonInstance()
Create an instance with format set to
DocumentFormat.JSON . |
static ContentCreateOptions |
newTextInstance()
Create an instance with format set to
DocumentFormat.TEXT . |
static ContentCreateOptions |
newXmlInstance()
Create an instance with format set to
DocumentFormat.XML . |
void |
setBufferSize(int newSize)
Set a preferred working buffer size to use for
copying to the server.
|
void |
setCollections(java.lang.String[] collections)
Set an array of URIs that represent collections
to which the document(s) will be added when inserted.
|
void |
setEncoding(java.lang.String encoding)
Set the charset encoding to be used by the
server when loading this document.
|
void |
setFormat(DocumentFormat format)
Set the format of the document to be created to
the given type.
|
void |
setFormatBinary()
Convenience method equivalent to
setFormat
(DocumentFormat.BINARY); . |
void |
setFormatJson()
Convenience method equivalent to
setFormat
(DocumentFormat.JSON); . |
void |
setFormatText()
Convenience method equivalent to
setFormat
(DocumentFormat.TEXT); . |
void |
setFormatXml()
Convenience method equivalent to
setFormat
(DocumentFormat.XML); . |
void |
setGraph(java.lang.String graph)
Set the RDF Graph for this options object
|
void |
setLanguage(java.lang.String language)
Set the language name to associate with inserted
documents.
|
void |
setLocale(java.util.Locale locale)
Set the effective
Locale value for
this options object. |
void |
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set an map of metadata key and metadata values
that represent metadata to which the document(s) will be added when
inserted.
|
void |
setNamespace(java.lang.String namespace)
Set a namespace name, which will used as the
namespace associated with inserted documents.
|
void |
setPermissions(ContentPermission[] permissions)
Set the permissions to be applied when documents
are inserted.
|
void |
setPlaceKeys(java.math.BigInteger[] forestKeys)
Set the forest placement keys for this options
object as an array of
BigInteger objects. |
void |
setPlaceKeys(long[] forestKeys)
Set the forest placement keys as long
values.
|
void |
setQuality(int quality)
Set the quality value for this options object,
which will set on inserted documents.
|
void |
setRepairLevel(DocumentRepairLevel repairLevel)
Set the document repair level for this options
object.
|
void |
setResolveBufferSize(int resolveBufferSize)
Set the entity resulution buffer size.
|
void |
setResolveEntities(boolean resolveEntities)
Set the flag indicating whether embedded
entities should be resolved during content insertion.
|
void |
setTemporalCollection(java.lang.String temporalCollection)
Set the temporal collection to associate with
inserted documents.
|
void |
setTemporalVersionURI(java.lang.String temporalVersionURI)
Set the temporal version URI to associate with
inserted documents.
|
public static final java.lang.String DEFAULT_ENCODING
setEncoding(String)
.public static final int MIN_BUFFER_SIZE
public static final int MAX_BUFFER_SIZE
public static ContentCreateOptions newXmlInstance()
DocumentFormat.XML
.public static ContentCreateOptions newTextInstance()
DocumentFormat.TEXT
.public static ContentCreateOptions newBinaryInstance()
DocumentFormat.BINARY
.public static ContentCreateOptions newJsonInstance()
DocumentFormat.JSON
.public void setFormat(DocumentFormat format)
DocumentFormat.NONE
which indicates that the server should apply its configured rules
for determining the document format. This may include choosing a
format according to the suffix of the document URI.format
- An instance of DocumentFormat
.public DocumentFormat getFormat()
DocumentFormat
public void setFormatXml()
setFormat
(DocumentFormat.XML);
.public void setFormatText()
setFormat
(DocumentFormat.TEXT);
.public void setFormatBinary()
setFormat
(DocumentFormat.BINARY);
.public void setFormatJson()
setFormat
(DocumentFormat.JSON);
.public DocumentRepairLevel getRepairLevel()
DocumentRepairLevel.DEFAULT
, but this option is only
applicable when the document format is DocumentFormat.XML
.DocumentRepairLevel
.public void setRepairLevel(DocumentRepairLevel repairLevel)
DocumentRepairLevel.DEFAULT
, but this option is only
applicable when the document format is DocumentFormat.XML
.repairLevel
- An instance of DocumentRepairLevel
.public java.util.Locale getLocale()
Locale
setting for this
options object.Locale
, or null.public void setLocale(java.util.Locale locale)
Locale
value for
this options object. The default is null, which indicates that the
local JVM default value is to be applied. Note that the server may
not support the locale configured as the local client default. In
such a case it may be necessary to explicitly set the
Locale
to a value recognized by the server for content
insertion to succeed.locale
- An instance of Locale
.public java.util.Map<java.lang.String,java.lang.String> getMetadata()
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
metadata
- A map of metadata keys and metadata
values.public boolean getResolveEntities()
DocumentFormat.XML
.public void setResolveEntities(boolean resolveEntities)
resolveEntities
- A boolean indicating whether
entities should be resolved or not.getResolveEntities()
public int getResolveBufferSize()
public void setResolveBufferSize(int resolveBufferSize)
resolveBufferSize
- The buffer size to pass the
server.public int getQuality()
public void setQuality(int quality)
quality
- An integer value.public java.lang.String getNamespace()
String
, or null.public void setNamespace(java.lang.String namespace)
namespace
- A namespace name as a
String
, or null to reset to default.public java.lang.String getLanguage()
String
, or null.public void setLanguage(java.lang.String language)
en
indicates that the document
is in english. The default is null, which indicates to use the
server default.language
- A language name as a
String
, or null to reset to the default.public java.lang.String getEncoding()
String
public void setEncoding(java.lang.String encoding)
Set the charset encoding to be used by the server when loading this document. The encoding provided will be passed to the server at document load time and must be a name that it recognizes. The document byte stream will be transcoded to UTF-8 for storage.
Note: UTF-8 encoded files may contain a three-byte Byte Order
Mark at the beginning which decodes as the Unicode character . As
of 4.0, this value is no longer ignored by the server. When it's
safe to do so, XCC will strip the BOM, which is not considered to
be part of the content. XCC will not strip the BOM if the
encoding is not UTF-8 (either explicitly set, or defaulted) and the
document format (setFormat(DocumentFormat)
)
is not text or XML. If the document format is not explicitly set,
BOM stripping will not occur (because the server may choose to
treat the content as binary) and document insertion may fail if a
BOM is present.
encoding
- The name of an encoding to be used to
interpret the document data as it is loaded by the server. A value
of null sets the encoding to the default (
DEFAULT_ENCODING
).public java.lang.String[] getCollections()
String
s, or null.public void setCollections(java.lang.String[] collections)
collections
- An array of String
s
which are collection URIs.public java.math.BigInteger[] getPlaceKeys()
Returns the set of forest placement keys (forest IDs) currently
in effect for this options object. Although forest placement keys
may be specified in two ways, as BigInteger
or and
long, they are always stored internally as BigInteger
objects.
If the URI of the document being inserted already exists exists in the contentbase, it will remain in the same forest. If a specified forest ID does not exist, that is an error. If more than one forest ID is given, the document will be placed in one of them at the server's discretion.
BigInteger
objects, or null.public void setPlaceKeys(java.math.BigInteger[] forestKeys)
Set the forest placement keys for this options object as an
array of BigInteger
objects. Forest IDs are unsigned
64-bit values generated by the server. Because Java long values are
signed longs, there is a possiblity that forest IDs cannot reliably
be represented by Java longs.
While is it not possible to specify forest placement directly by
forest name, is it very easy to map forest names to forest IDs. The
ContentbaseMetaData.getForestMap()
method will
return a Map
of the forest names and their associated
IDs.
forestKeys
- An array of BigInteger
objects or null to set default.public void setPlaceKeys(long[] forestKeys)
BigInteger
objects.forestKeys
- An array of long values.setPlaceKeys(java.math.BigInteger[])
public ContentPermission[] getPermissions()
ContentPermission
objects, or null.public void setPermissions(ContentPermission[] permissions)
permissions
- An array of ContentPermission
objects or null to reset to defaults.public int getBufferSize()
public void setBufferSize(int newSize)
MIN_BUFFER_SIZE
and
MAX_BUFFER_SIZE
. This buffer size is a maximum. If
the actual size of the content is smaller than this size, a buffer
of the smaller size will be used.newSize
- A preferred buffer size, or -1 to use
the default.public java.lang.String getTemporalCollection()
String
, or null.public void setTemporalCollection(java.lang.String temporalCollection)
temporalCollection
- A temporal collection as a
String
, or null for non-temporal.public java.lang.String getTemporalVersionURI()
String
, or null.public void setTemporalVersionURI(java.lang.String temporalVersionURI)
temporalVersionURI
- A URI as a
String
or null.public java.lang.String getGraph()
String
, or null.public void setGraph(java.lang.String graph)
graph
- A graph iri as String
.public java.lang.Object clone()
clone
in
class java.lang.Object
Copyright © 2025 MarkLogic
Corporation
Complete online documentation for MarkLogic Server,
XQuery and related components may
be found at
developer.marklogic.com