|
XCC/J 4.1-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.marklogic.xcc.ContentCreateOptions
public class ContentCreateOptions
A set of creation options to be applied to a document when it is inserted into a contentbase. By
default, the document format is set to DocumentFormat.NONE which indicates that
server-configured defaults should be used to determine the document format.
| Field Summary | |
|---|---|
static 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 Summary | |
|---|---|
ContentCreateOptions()
|
|
| Method Summary | |
|---|---|
int |
getBufferSize()
Return the preferred working buffer size to use for copying the content to the server. |
String[] |
getCollections()
Return the set of collection URIs currently in effect for this options object. |
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. |
String |
getLanguage()
Get the current language setting for this options object. |
Locale |
getLocale()
Get the Locale setting for this options object. |
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. |
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 the flag which indicates whether or not to resolve entities embedded in an XML document to be inserted. |
static ContentCreateOptions |
newBinaryInstance()
Create an instance with format set to DocumentFormat.BINARY. |
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(String[] collections)
Set an array of URIs that represent collections to which the document(s) will be added when inserted. |
void |
setEncoding(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 |
setFormatText()
Convenience method equivalent to setFormat (DocumentFormat.TEXT);. |
void |
setFormatXml()
Convenience method equivalent to setFormat (DocumentFormat.XML);. |
void |
setLanguage(String language)
Set the language name to associate with inserted documents. |
void |
setLocale(Locale locale)
Set the effective Locale value for this options object. |
void |
setNamespace(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(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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_ENCODING
setEncoding(String).
public static final int MIN_BUFFER_SIZE
public static final int MAX_BUFFER_SIZE
| Constructor Detail |
|---|
public ContentCreateOptions()
| Method Detail |
|---|
public static ContentCreateOptions newXmlInstance()
DocumentFormat.XML.
public static ContentCreateOptions newTextInstance()
DocumentFormat.TEXT.
public static ContentCreateOptions newBinaryInstance()
DocumentFormat.BINARY.
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()
DocumentFormatpublic void setFormatXml()
setFormat (DocumentFormat.XML);.
public void setFormatText()
setFormat (DocumentFormat.TEXT);.
public void setFormatBinary()
setFormat (DocumentFormat.BINARY);.
public DocumentRepairLevel getRepairLevel()
DocumentRepairLevel.FULL, but this option is only applicable when the document format
is DocumentFormat.XML.
DocumentRepairLevel.public void setRepairLevel(DocumentRepairLevel repairLevel)
DocumentRepairLevel.FULL, but this option is only applicable when the document format
is DocumentFormat.XML.
repairLevel - An instance of DocumentRepairLevel.public Locale getLocale()
Locale setting for this options object.
Locale, or null.public void setLocale(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 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 the server.public int getQuality()
public void setQuality(int quality)
quality - An integer value.public String getNamespace()
String, or null.public void setNamespace(String namespace)
namespace - A namespace name as a String, or null to reset to default.public String getLanguage()
String, or null.public void setLanguage(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 String getEncoding()
Stringpublic void setEncoding(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 String[] getCollections()
Strings, or null.public void setCollections(String[] collections)
collections - An array of Strings which are collection URIs.public 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(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.
|
XCC/J 4.1-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com