com.marklogic.xdmp
Class XDMPDocOptions

java.lang.Object
  extended bycom.marklogic.xdmp.XDMPDocOptions

public class XDMPDocOptions
extends Object

Describes the creation options to apply when loading a document into the contentbase.

See Also:
XDMPConnection.openDocInsertStream(String, XDMPDocOptions)

Field Summary
static int XDMP_DOC_FORMAT_BINARY
          Insert document as binary() format.
static int XDMP_DOC_FORMAT_NONE
          No declared document format, use server default.
static int XDMP_DOC_FORMAT_TEXT
          Insert document as text() format.
static int XDMP_DOC_FORMAT_XML
          Insert document as XML.
static int XDMP_ERROR_CORRECTION_FULL
          Document insert error correction level: indicates that the server attempts to insert missing tags and ignore extraneous tags if necessary to make the loaded document be well-formed.
static int XDMP_ERROR_CORRECTION_NONE
          Document insert error correction level: indicates that an error is signaled by the server if a non-well-formed document is loaded.
 
Constructor Summary
XDMPDocOptions()
           
XDMPDocOptions(Locale locale)
           
XDMPDocOptions(Locale locale, boolean resolveEntities)
           
XDMPDocOptions(Locale locale, boolean resolveEntities, XDMPPermission[] permissions)
           
XDMPDocOptions(Locale locale, boolean resolveEntities, XDMPPermission[] permissions, String[] collections)
           
XDMPDocOptions(Locale locale, boolean resolveEntities, XDMPPermission[] permissions, String[] collections, int quality)
           
XDMPDocOptions(Locale locale, boolean resolveEntities, XDMPPermission[] permissions, String[] collections, int quality, String namespace)
           
XDMPDocOptions(Locale locale, boolean resolveEntities, XDMPPermission[] permissions, String[] collections, int quality, String namespace, int repair)
           
XDMPDocOptions(Locale locale, boolean resolveEntities, XDMPPermission[] permissions, String[] collections, int quality, String namespace, int repair, String[] placeKeys)
           
XDMPDocOptions(Locale locale, boolean resolveEntities, XDMPPermission[] permissions, String[] collections, int quality, String namespace, int repair, String[] placeKeys, int format)
           
XDMPDocOptions(Locale locale, boolean resolveEntities, XDMPPermission[] permissions, String[] collections, int quality, String namespace, int repair, String[] placeKeys, int format, String language)
           
 
Method Summary
 String[] getCollections()
          Get the list of collections to which a document should be added when it's loaded.
 int getFormat()
          Get the document format to apply to a loaded document.
 String getLanguage()
          Get the language to apply when a document is loaded.
 Locale getLocale()
          Get the Locale to associate with the loaded document.
 String getNamespace()
          Get the namespace that should apply to a document when it's loaded.
 XDMPPermission[] getPermissions()
          Get the list of permissions to be applied to the document when it is loaded.
 String[] getPlaceKeys()
          Get the list of forest placement keys.
 int getQuality()
          Get the quality setting to apply to a document when it's loaded.
 int getRepair()
          Get the document repair level setting.
 boolean getResolveEntities()
          Get the Resolve Entities On Load setting.
 void setCollections(String[] collections)
          Set the list of collections to which a document should be added when loaded.
 void setFormat(int format)
          Set the document format to apply when a document is loaded into the contentbase.
 void setLanguage(String language)
          Get the language to apply when a document is loaded.
 void setLocale(Locale locale)
          Set the Locale to associate with the loaded document.
 void setNamespace(String namespace)
          Set the namespace to apply to a document when it's loaded.
 void setPermissions(XDMPPermission[] permissions)
          Set the list of permissions to apply to a document when loaded.
 void setPlaceKeys(String[] placeKeys)
          Set the list of forest keys to indicate which data forest may be used to store a loaded document.
 void setQuality(int quality)
          Set the quality value that should be applied to a docuemnt when it's loaded.
 void setRepair(int repair)
          Set the document repair level the server should apply to a document when it's loaded.
 void setResolveEntities(boolean resolveEntities)
          Specify whether entity references should be resolved (inserted into the document in place of the reference) or not (leave the entity reference in the document).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XDMP_ERROR_CORRECTION_NONE

public static final int XDMP_ERROR_CORRECTION_NONE
Document insert error correction level: indicates that an error is signaled by the server if a non-well-formed document is loaded.

See Also:
Constant Field Values

XDMP_ERROR_CORRECTION_FULL

public static final int XDMP_ERROR_CORRECTION_FULL
Document insert error correction level: indicates that the server attempts to insert missing tags and ignore extraneous tags if necessary to make the loaded document be well-formed.

See Also:
Constant Field Values

XDMP_DOC_FORMAT_NONE

public static final int XDMP_DOC_FORMAT_NONE
No declared document format, use server default.

See Also:
Constant Field Values

XDMP_DOC_FORMAT_BINARY

public static final int XDMP_DOC_FORMAT_BINARY
Insert document as binary() format.

See Also:
Constant Field Values

XDMP_DOC_FORMAT_TEXT

public static final int XDMP_DOC_FORMAT_TEXT
Insert document as text() format.

See Also:
Constant Field Values

XDMP_DOC_FORMAT_XML

public static final int XDMP_DOC_FORMAT_XML
Insert document as XML.

See Also:
Constant Field Values
Constructor Detail

XDMPDocOptions

public XDMPDocOptions()

XDMPDocOptions

public XDMPDocOptions(Locale locale)

XDMPDocOptions

public XDMPDocOptions(Locale locale,
                      boolean resolveEntities)

XDMPDocOptions

public XDMPDocOptions(Locale locale,
                      boolean resolveEntities,
                      XDMPPermission[] permissions)

XDMPDocOptions

public XDMPDocOptions(Locale locale,
                      boolean resolveEntities,
                      XDMPPermission[] permissions,
                      String[] collections)

XDMPDocOptions

public XDMPDocOptions(Locale locale,
                      boolean resolveEntities,
                      XDMPPermission[] permissions,
                      String[] collections,
                      int quality)

XDMPDocOptions

public XDMPDocOptions(Locale locale,
                      boolean resolveEntities,
                      XDMPPermission[] permissions,
                      String[] collections,
                      int quality,
                      String namespace)

XDMPDocOptions

public XDMPDocOptions(Locale locale,
                      boolean resolveEntities,
                      XDMPPermission[] permissions,
                      String[] collections,
                      int quality,
                      String namespace,
                      int repair)

XDMPDocOptions

public XDMPDocOptions(Locale locale,
                      boolean resolveEntities,
                      XDMPPermission[] permissions,
                      String[] collections,
                      int quality,
                      String namespace,
                      int repair,
                      String[] placeKeys)

XDMPDocOptions

public XDMPDocOptions(Locale locale,
                      boolean resolveEntities,
                      XDMPPermission[] permissions,
                      String[] collections,
                      int quality,
                      String namespace,
                      int repair,
                      String[] placeKeys,
                      int format)

XDMPDocOptions

public XDMPDocOptions(Locale locale,
                      boolean resolveEntities,
                      XDMPPermission[] permissions,
                      String[] collections,
                      int quality,
                      String namespace,
                      int repair,
                      String[] placeKeys,
                      int format,
                      String language)
Method Detail

getLocale

public Locale getLocale()
Get the Locale to associate with the loaded document.

Returns:
The Locale setting for this instance.

setLocale

public void setLocale(Locale locale)
Set the Locale to associate with the loaded document.

Parameters:
locale - A Locale object.

getResolveEntities

public boolean getResolveEntities()
Get the Resolve Entities On Load setting.

Returns:
True if entities should be resolved, false if not.

setResolveEntities

public void setResolveEntities(boolean resolveEntities)
Specify whether entity references should be resolved (inserted into the document in place of the reference) or not (leave the entity reference in the document).

Parameters:
resolveEntities - True if entities should be resolved, false if not.

getPermissions

public XDMPPermission[] getPermissions()
Get the list of permissions to be applied to the document when it is loaded.

Returns:
An array of XDMPPermission objects.

setPermissions

public void setPermissions(XDMPPermission[] permissions)
Set the list of permissions to apply to a document when loaded.

Parameters:
permissions - An array of XDMPPermission objects.

getCollections

public String[] getCollections()
Get the list of collections to which a document should be added when it's loaded.

Returns:
An array collection names.

setCollections

public void setCollections(String[] collections)
Set the list of collections to which a document should be added when loaded.

Parameters:
collections - An array of colleciton names.

getQuality

public int getQuality()
Get the quality setting to apply to a document when it's loaded.

Returns:
An int quality value.

setQuality

public void setQuality(int quality)
Set the quality value that should be applied to a docuemnt when it's loaded.

Parameters:
quality - An integer quality value.

getNamespace

public String getNamespace()
Get the namespace that should apply to a document when it's loaded.

Returns:
A namespace String.

setNamespace

public void setNamespace(String namespace)
Set the namespace to apply to a document when it's loaded.

Parameters:
namespace - A namespace as a String.

getRepair

public int getRepair()
Get the document repair level setting.

Returns:
XDMP_ERROR_CORRECTION_FULL or XDMP_ERROR_CORRECTION_NONE.

setRepair

public void setRepair(int repair)
Set the document repair level the server should apply to a document when it's loaded.

Parameters:
repair - XDMP_ERROR_CORRECTION_FULL or XDMP_ERROR_CORRECTION_NONE.

getPlaceKeys

public String[] getPlaceKeys()
Get the list of forest placement keys.

Returns:
A list of keys, as Strings, specifying which forests may be used to store a loaded document.

setPlaceKeys

public void setPlaceKeys(String[] placeKeys)
Set the list of forest keys to indicate which data forest may be used to store a loaded document. The key (id) may be obtained for a particular forest name with the xdmp:forest() XQuery function.

Parameters:
placeKeys - A list of forest keys, as Strings, specifying the allowed forests.

getFormat

public int getFormat()
Get the document format to apply to a loaded document.

Returns:
One of XDMP_DOC_FORMAT_XML, XDMP_DOC_FORMAT_TEXT, XDMP_DOC_FORMAT_BINARY or XDMP_DOC_FORMAT_NONE.

setFormat

public void setFormat(int format)
Set the document format to apply when a document is loaded into the contentbase.

Parameters:
format - One of XDMP_DOC_FORMAT_XML, XDMP_DOC_FORMAT_TEXT, XDMP_DOC_FORMAT_BINARY or XDMP_DOC_FORMAT_NONE.

getLanguage

public String getLanguage()
Get the language to apply when a document is loaded.

Returns:
The language as a String.

setLanguage

public void setLanguage(String language)
Get the language to apply when a document is loaded.

Parameters:
language - The language as a String.