com.adobe.idp
Class Document

java.lang.Object
  extended by com.adobe.idp.Document
All Implemented Interfaces:
java.io.Serializable

public class Document
extends java.lang.Object
implements java.io.Serializable

The Document class passes data of arbitrary size between different Adobe Experience Manager forms services and components via remote RMI calls. The Document can also be used to store the data in process maps.

These are the main features of the Document class:

Below are some examples how to use the Document class.

  1. Here is a simple usage scenario:
    java.io.InputStream is = new java.io.StringBufferInputStream("..."));
    Document input = new Document(is);
    input.passivate(); // save all data supplied by the input stream
    someAdobe Experience Manager formsService.loadInputData(input);
    someAdobe Experience Manager formsService.someBusinessMethod();
    Document output = someAdobe Experience Manager formsService.saveOutputData();
    java.io.InputStream resultStream = output.getInputStream();
    ...
    Note that the input.passivate call is optional. It simply guarantees that the input stream was fully read and detached from the Document instance. Without this call, reading the input stream is delayed until the data is requested, which in this case happens somewhere inside the someAdobe Experience Manager formsService.loadInputData call.
  2. Here is a more complex usage scenario demonstrating various Document APIs:
    Document input = new Document(new File("..."), true); // intending to own this file
    // ensure that the input document is disposed of upon the transaction end
    input.setTransactionBound(true);
    input.passivate(); // save all data supplied by the file and take over the file
    someAdobe Experience Manager formsService.loadInputData(data);
    someAdobe Experience Manager formsService.someBusinessMethod();
    Document middle = someAdobe Experience Manager formsService.saveOutputData();
    // ensure that the middle document is available for a long enough period of time
    middle.setDisposalTimeout(middle.getDisposalTimeout() + 60); // add extra 60 seconds
    anotherAdobe Experience Manager formsService.loadInputData(data);
    anotherAdobe Experience Manager formsService.loadInputData2(middle);
    anotherAdobe Experience Manager formsService.anotherBusinessMethod();
    Document output = anotherAdobe Experience Manager formsService.saveOutputData();
    com.adobe.service.DataBuffer dataBuffer = output.getDataBuffer();
    ...

As an indication of an error condition, any method of the Document class may throw a DocumentError exception. The DocumentError class is a runtime exception (it inherits from java.lang.RuntimeException). Runtime exceptions are also known as unchecked exceptions, as they don't need to be defined in the signature of the method throwing it. The unchecked exceptions (as opposed to checked exceptions which inherit from java.lang.Exception) simplify the user's code by trading off some type safety.

The following Document parameters are exposed through an external configuration:

NameTypeDefaultDescription
localDocumentStorageSweepIntervalpositive integer15 The amount of time in seconds between attempts to delete any files that are no longer needed and that were used to pass the document data between Adobe Experience Manager forms components running on the same machine.
globalDocumentStorageSweepIntervalpositive integer30 The amount of time in seconds between attempts to delete any files that are no longer needed that were used to pass the document data between Adobe Experience Manager forms components running on different machines. Specify this property only when deploying Adobe Experience Manager forms products in a clustered environment.
globalDocumentStorageRootDirstring pathnone A path to an NFS shared directory used to store long-lived documents (the documents that are involved in a workflow process) and to share them among all cluster nodes. Specify this property only when deploying Adobe Experience Manager forms products in a clustered environment.
globalDocumentStorageForceNFStrue/falsefalse A switch controlling whether to use the NFS protocol to pass documents between different Adobe Experience Manager forms components. The NFS protocol must be used when deploying Adobe Experience Manager forms products in a clustered environment on Microsoft Windows. Note that additional NFS software should be installed on your Windows machine before enabling this option. This option does not affect UNIX deployments.
defaultDocumentMaxInlineSizepositive integer65536 The maximum number of bytes that are kept in memory when passing documents between different Adobe Experience Manager forms components. The documents that exceed this maximum are swapped out to the disk drive. Use this property for performance tuning.
defaultDocumentDisposalTimeoutpositive integer600 The maximum amount of time in seconds during which a document, which is passed between different Adobe Experience Manager forms components, is considered alive. After this time has passed, any files used to store this document are subject to removal. Use this property to control the use of disk space.

When using the Document class in the J2EE environment, the configuration parameters above are specified using Adobe Configuration Manager. When using the Document class in a standalone Java client, specify these parameters as Java system properties with a com.adobe.idp prefix (for example, com.adobe.idp.globalDocumentStorageRootDir).

See Also:
Serialized Form

Constructor Summary
Document(byte[] data)
          Creates a new Document out of the content specified by the byte array.
Document(com.adobe.service.DataBuffer db)
          Deprecated.  
Document(Document doc)
          Creates a copy of the Document supplied as input.
Document(com.adobe.idp.DocumentStringType stringType, java.lang.String string, com.adobe.idp.DocumentPassivationClientFactory passivationClientFactory)
          Creates a new Document out of the content accessible via a URI or (in the future) other strings.
Document(com.adobe.idp.DocumentWriter writer, java.lang.Object obj)
          Deprecated.  
Document(java.io.File file, boolean own)
          Creates a new Document out of the content stored in the file.
Document(java.io.InputStream is)
          Creates a new Document with the content provided by the java.io.InputStream object.
Document(java.net.URI uri, com.adobe.idp.DocumentPassivationClientFactory passivationClientFactory)
          Creates a new Document out of the content accessible via a URI.
Document(java.net.URL url)
          Creates a new Document out of the content accessible via the URL.
 
Method Summary
 void copyToFile(java.io.File file)
          Copies the document content to a file specified by a caller.
 void dispose()
          Disposes of any local temporary storage resources (for example, file, database data, and so on) occupied by the document content.
 void doneReading()
          Closes any resources opened by the Document object while reading the content with any of the Document object's read() methods.
 java.io.Serializable getAttribute(java.lang.String name)
          Returns the value of an attribute with a given name.
 java.lang.String getContentType()
          Returns the current MIME type of the Document content.
static java.lang.String getContentTypeForFilename(java.lang.String path)
          Returns the MIME type found in the mappings for the extension found at the end of path.
 com.adobe.service.DataBuffer getDataBuffer()
          Deprecated. For internal use only.
static int getDefaultDisposalTimeout()
          Returns the default disposal timeout value.
static int getDefaultMaxInlineSize()
          Returns the default maximum size of the document content that can be embedded within the Document object.
 int getDisposalTimeout()
          Returns the timeout value if it was set using the Document.setDisposalTimeout(int) method.
 java.io.File getFile()
           
static javax.naming.InitialContext getInitialContext()
           
 java.io.InputStream getInputStream()
          Returns the document content in a java.io.InputStream object.
 int getMaxInlineSize()
          Returns the maximum size of the document content that can be embedded within the Document instance.
 java.lang.Object getObject(com.adobe.idp.DocumentReader reader)
          Deprecated. For internal use only.
 void init(java.io.File file, com.adobe.idp.DocumentFileInitMode inMode)
           
static boolean isLocalizable()
           
static boolean isPassivationLazy()
          Returns true if lazy passivation is on.
 boolean isTransactionBound()
          Returns true or false depending on whether the Document lifetime is transaction-bound.
 long length()
          Returns the Document content's length.
 java.util.Set listAttributes()
          Lists the names of all attributes associated with this Document instance.
 void passivate()
          Saves the document content into some persistent form (file, database BLOB, and so on).
 void passivateGlobally()
          Passivates the Document content (similar to the Document.passivate() method) in the global storage.
 int read(long pos)
          Reads a byte of the Document object's content at the given position.
 int read(long pos, byte[] b, int off, int len)
          Reads up to len bytes of the Document object's content into an array of bytes.
 void removeAttribute(java.lang.String name)
          Removes an attribute with the given name.
 void setAttribute(java.lang.String name, java.io.Serializable value)
          Sets the value of an attribute with a given name.
 void setContentType(java.lang.String type)
          Overwrites the current MIME type of the Document content.
 java.lang.String setContentTypeFromBasename()
          Sets the MIME type of the Document from the current basename derived from the last filename set.
static void setDefaultDisposalTimeout(int seconds)
          Sets the default disposal timeout value, which is used if the timeout is not set using the Document.setDisposalTimeout(int) method.
static void setDefaultMaxInlineSize(int bytes)
          Sets the default maximum size of the document content that can be embedded within the Document instance.
 void setDisposalTimeout(int seconds)
          Sets the amount of time (in seconds) before the Document object is disposed of automatically.
static void setInitialContext(javax.naming.InitialContext ic)
          Use this method to set the InitialContext needed by the Document object in order to look up an internal server EJB, which is used to upload the Document object's content to the Adobe Experience Manager forms server.
 void setMaxInlineSize(int bytes)
          Sets the maximum size of the document content that can be embedded within the Document instance.
static void setPassivationLazy(boolean enable)
          Use this method to override the default passivation behavior.
 void setTransactionBound(boolean value)
          Used to specify whether the Document is transaction-bound.
 java.lang.String toString()
          Returns a text representation of the Document internal state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Document

public Document(byte[] data)
Creates a new Document out of the content specified by the byte array.

In this case, the new Document simply keeps a reference to the input array. So, the input source should remain available until the Document content is passivated (saved to permanent storage). The passivation happens either explicitly when Document.passivate() is called, or implicitly when one tries to read the Document object's content (for example, when Document.getInputStream(), Document.getFile(), or another access method is called). Implicit passivation can be triggered either locally (when the access method is called on the same Document instance that was created with this constructor), or remotely (when the access method is called on another Document instance that is a copy of the source Document instance done via a serialization or deserialization or passed via a remote RMI call).

Parameters:
data - The byte array providing the input content.

Document

public Document(java.io.InputStream is)
Creates a new Document with the content provided by the java.io.InputStream object.

In this case, the new Document simply keeps a reference to the input stream. So, the input source should remain available until the Document content is passivated (saved to permanent storage). The passivation happens either explicitly when Document.passivate() is called, or implicitly when one tries to read the Document object's content (for example, when Document.getInputStream(), Document.getFile(), or another access method is called). Implicit passivation can be triggered either locally (when the access method is called on the same Document instance that was created with this constructor), or remotely (when the access method is called on another Document instance that is a copy of the source Document instance done via a serialization or deserialization or passed via a remote RMI call).

Parameters:
is - The java.io.InputStream object providing the input content.

Document

public Document(java.net.URL url)
Creates a new Document out of the content accessible via the URL.

In this case, the new Document simply keeps a reference to the input URL. So, the input source should remain available until the Document content is passivated (saved to permanent storage). The passivation happens either explicitly when Document.passivate() is called, or implicitly when one tries to read the Document object's content (for example, when Document.getInputStream(), Document.getFile(), or another access method is called). Implicit passivation can be triggered either locally (when the access method is called on the same Document instance that was created with this constructor), or remotely (when the access method is called on another Document instance that is a copy of the source Document instance done via a serialization or deserialization or passed via a remote RMI call).

Parameters:
url - The URL to the input content.

Document

public Document(com.adobe.idp.DocumentStringType stringType,
                java.lang.String string,
                com.adobe.idp.DocumentPassivationClientFactory passivationClientFactory)
Creates a new Document out of the content accessible via a URI or (in the future) other strings. A string interface is provided as the java.net.URI class can be quite pedantic about URI syntax where other consumers of URIs may not be as pedantic.

In the case of a URI, the new Document simply keeps a reference to the input URI. So, the input source should remain available until the Document content is passivated. The passivation happens either explicitly when Document.passivate() is called, or implicitly when one tries to read the Document object's content (for example, when Document.getInputStream(), Document.getFile(), or another access method is called). Implicit passivation can be triggered either locally (when the access method is called on the same Document instance that was created with this constructor), or remotely (when the access method is called on another Document instance that is a copy of the source Document instance done via a serialization or deserialization or passed via a remote RMI call).

Parameters:
stringType - a DocumentStringType value, presently only DocumentStringType.URI_STRING.
string - The uri to look up.
passivationClientFactory - The passivationFactory to use, or null if it is known that the Document will be passed to the server before passivation. Can be left null on the server.

Document

public Document(java.net.URI uri,
                com.adobe.idp.DocumentPassivationClientFactory passivationClientFactory)
Creates a new Document out of the content accessible via a URI.

In the case of a URI, the new Document simply keeps a reference to the input URI. So, the input source should remain available until the Document content is passivated. The passivation happens either explicitly when Document.passivate() is called, or implicitly when one tries to read the Document object's content (for example, when Document.getInputStream(), Document.getFile(), or another access method is called). Implicit passivation can be triggered either locally (when the access method is called on the same Document instance that was created with this constructor), or remotely (when the access method is called on another Document instance that is a copy of the source Document instance done via a serialization or deserialization or passed via a remote RMI call).

Since some URIs such as repository URIs may require contacting the server and may also require authentication and authorization a com.adobe.idp.dsc.clientsdk.ServiceClientFactory can be supplied as the DocumentPassivationClientFactory to provide authentication and server connection information.

Parameters:
string - The uri to look up.
passivationClientFactory - The passivationFactory to use, or null if it is known that the Document will be passed to the server before passivation. Can be left null on the server.

Document

public Document(java.io.File file,
                boolean own)
Creates a new Document out of the content stored in the file.

In this case, the new Document simply keeps a reference to the input file. So, the input source should remain available until the Document content is passivated (saved to permanent storage). The passivation happens either explicitly when Document.passivate() is called, or implicitly when one tries to read the Document object's content (for example, when Document.getInputStream(), Document.getFile(), or another access method is called). Implicit passivation can be triggered either locally (when the access method is called on the same Document instance that was created with this constructor), or remotely (when the access method is called on another Document instance that is a copy of the source Document instance done via a serialization or deserialization or passed via a remote RMI call).

Setting the own flag to true means that the file will be deleted automatically when the Document instance is passivated. This can help to optimize IO, since the file can be moved rather than copied (which happens when the own flag is false) into the managed area on the disk.

Parameters:
file - The file providing the input content.
own - The boolean flag controlling whether the new Document should take over the file when the Document is passivated.

Document

public Document(com.adobe.service.DataBuffer db)
Deprecated. 

Do not use.


Document

public Document(com.adobe.idp.DocumentWriter writer,
                java.lang.Object obj)
Deprecated. 

Do not use.


Document

public Document(Document doc)
Creates a copy of the Document supplied as input.

Parameters:
doc - The source Document instance.
Method Detail

init

public void init(java.io.File file,
                 com.adobe.idp.DocumentFileInitMode inMode)

passivate

public void passivate()
Saves the document content into some persistent form (file, database BLOB, and so on). After this method is called, the Document no longer keeps a reference to the object that provided the input for the document content (for example, the byte array, the java.io.InputStream, or the file provided by the corresponding Document constructor calls).


passivateGlobally

public void passivateGlobally()
Passivates the Document content (similar to the Document.passivate() method) in the global storage.


read

public int read(long pos)
Reads a byte of the Document object's content at the given position.

Parameters:
pos - The position from which to read the byte.
Returns:
The value of the byte, which can be in the range of 0 to 255, or -1 if the end of the data has been reached.

doneReading

public void doneReading()
Closes any resources opened by the Document object while reading the content with any of the Document object's read() methods.

This method is also called by the Document.dispose() method.

See Also:
Document.read(long), Document.read(long, byte[], int, int), Document.dispose()

read

public int read(long pos,
                byte[] b,
                int off,
                int len)
Reads up to len bytes of the Document object's content into an array of bytes. While this method attempts to read as many as len bytes, a smaller number (0 to len bytes) may be read.

The very first call of this method passivates the Document. If the content is not stored in memory as part of the Document object, the very first call of this method also opens an internal resource, such as java.io.RandomAccessFile, to read the data. Thus, to help prevent resource leakage, it is important to call Document.doneReading() when finished reading.

Parameters:
pos - The position from which to read the bytes.
b - The buffer into which the data is read.
off - The starting index in the buffer (b) to which the data is written.
len - The maximum number of bytes to read.
Returns:
The total number of bytes read into the buffer, or -1 if the end of the data has been reached.

length

public long length()
Returns the Document content's length. This method passivates the Document content internally using the Document.passivate() method to cover the cases when the length is not known a priori (for example, when the Document is created with data whose length is unknown until the content is fully read, such as java.io.InpuStream or java.net.URL).

Returns:
The Document content's length.
See Also:
Document.passivate()

getInputStream

public java.io.InputStream getInputStream()
Returns the document content in a java.io.InputStream object.

Returns:
The java.io.InputStream object containing the document content.

getFile

public java.io.File getFile()

copyToFile

public void copyToFile(java.io.File file)
Copies the document content to a file specified by a caller. If the specified file already exists, it will be overwritten.

Note that after this method returns, it becomes the caller's responsibility to remove the file.

Parameters:
file - The file to which to copy the document content. If the file exists, this method will overwrite it. If the file does not exist, this method will create one.

getDataBuffer

public com.adobe.service.DataBuffer getDataBuffer()
Deprecated. For internal use only.

Do not use.


getObject

public java.lang.Object getObject(com.adobe.idp.DocumentReader reader)
Deprecated. For internal use only.

Do not use.


setDisposalTimeout

public void setDisposalTimeout(int seconds)
Sets the amount of time (in seconds) before the Document object is disposed of automatically. Use this method to guarantee disposal of any local temporary storage resources (for example, file, database data, and so on) occupied by the document content after a particular time elapsed. After the Document is disposed of, its content will no longer be available.

The recommended usage is document.setDisposalTimeout(document.getDisposalTimeout() + extraTime). Thus, changing the default disposal timeout at start-up can still affect the local disposal timeout.

The Document can also be disposed of either explicitly, when the Document.dispose() method is called, or implicitly, when the current transaction ends and the Document is set as transaction-bound using the Document.setTransactionBound(boolean) method.

If this method is never called, the Document is assigned a default disposal timeout (see the static Document.getDefaultDisposalTimeout() method).

Parameters:
seconds - The new disposal timeout in seconds.
See Also:
Document.dispose(), Document.setTransactionBound(boolean)

getDisposalTimeout

public int getDisposalTimeout()
Returns the timeout value if it was set using the Document.setDisposalTimeout(int) method. Otherwise, it returns the default timeout value (see the static Document.getDefaultDisposalTimeout() method).

Returns:
The current disposal timeout.
See Also:
Document.setDisposalTimeout(int)

setDefaultDisposalTimeout

public static void setDefaultDisposalTimeout(int seconds)
Sets the default disposal timeout value, which is used if the timeout is not set using the Document.setDisposalTimeout(int) method.

Parameters:
seconds - The new default disposal timeout.

getDefaultDisposalTimeout

public static int getDefaultDisposalTimeout()
Returns the default disposal timeout value. If the default disposal timeout is not set, this method uses a value of a configurable defaultDocumentDisposalTimeout property. The default timeout is 600 seconds.

Returns:
The default disposal timeout in seconds.
See Also:
Document.setDefaultDisposalTimeout(int)

setTransactionBound

public void setTransactionBound(boolean value)
Used to specify whether the Document is transaction-bound.

If this method is called with value set to true, the Document instance is automatically disposed of upon the end of the transaction associated with the current thread (the Document becomes transaction-bound). By default, the Document is not transaction-bound.

When calling this method with the value set to true, make sure that the calling thread is associated with a J2EE transaction context. Otherwise, a DocumentError exception will be thrown.

The Document can also be disposed of in a few other ways. It can be disposed of explicitly, via the Document.dispose() method call, or automatically: when the disposal timeout expires, or when the transaction ends (whichever happens earlier).

Parameters:
value - The boolean value specifying whether the Document is transaction-bound.
See Also:
Document.dispose(), Document.setDisposalTimeout(int)

isTransactionBound

public boolean isTransactionBound()
Returns true or false depending on whether the Document lifetime is transaction-bound.

Returns:
The boolean value indicating if the Document is transaction-bound.
See Also:
Document.setTransactionBound(boolean)

setMaxInlineSize

public void setMaxInlineSize(int bytes)
Sets the maximum size of the document content that can be embedded within the Document instance. If this value is not set, the default value controlled by the Document.setDefaultMaxInlineSize(int) method is used.

Parameters:
bytes - The maximum inline size in bytes.
See Also:
Document.getMaxInlineSize(), Document.setDefaultMaxInlineSize(int)

getMaxInlineSize

public int getMaxInlineSize()
Returns the maximum size of the document content that can be embedded within the Document instance. If this value is not set with the Document.setMaxInlineSize(int) method, the default value is controlled by the Document.setDefaultMaxInlineSize(int) method.

Returns:
The maximum inline size in bytes.
See Also:
Document.setMaxInlineSize(int), Document.setDefaultMaxInlineSize(int)

setDefaultMaxInlineSize

public static void setDefaultMaxInlineSize(int bytes)
Sets the default maximum size of the document content that can be embedded within the Document instance.

Parameters:
bytes - The default maximum inline size in bytes.
See Also:
Document.setMaxInlineSize(int), Document.getDefaultMaxInlineSize()

getDefaultMaxInlineSize

public static int getDefaultMaxInlineSize()
Returns the default maximum size of the document content that can be embedded within the Document object.

If the default inline size is not set using the Document.setDefaultMaxInlineSize(int) method, this method uses a value of a configurable defaultDocumentMaxInlineSize property. The default value is 64 Kbytes.

Returns:
The default maximum inline size in bytes.
See Also:
Document.getMaxInlineSize(), Document.setDefaultMaxInlineSize(int)

setContentType

public void setContentType(java.lang.String type)
Overwrites the current MIME type of the Document content.

The content type is a MIME string identifying the Document content (for example, "application/octet-stream", "text/plain", and so on).

Parameters:
type - The new content type.
See Also:
Document.getContentType()

setContentTypeFromBasename

public java.lang.String setContentTypeFromBasename()
Sets the MIME type of the Document from the current basename derived from the last filename set.

Returns:
the mime type set, or null if no basename was previously set.

getContentTypeForFilename

public static java.lang.String getContentTypeForFilename(java.lang.String path)
Returns the MIME type found in the mappings for the extension found at the end of path.

Parameters:
path - a filename/path.
Returns:
The MIME type found according to the mappings in effect for the extension found on the filename/path.

getContentType

public java.lang.String getContentType()
Returns the current MIME type of the Document content.

The content type is a MIME string identifying the Document content (for example, "application/octet-stream", "text/plain", and so on). The content type is set either explicitly using the #setContentType() method, or implicitly when the Document.Document(java.net.URL), Document.Document(File, boolean), or Document.Document(java.io.InputStream) constructor is called. To determine the content type, the first and second constructors use a file/URL extension to map it to the MIME content type using a default javax.activation.FileTypeMap instance. The third constructor requests the content type from DataBuffer using the DataBuffer.getContentType() method.

If the Document is created using the Document.Document(java.net.URL) constructor, this method will return null unless/until the Document is passivated. This allows the source of the content to specify the content type. If such behavior is not acceptable, consider setting the content type on the new Document instance explicitly, using the #setContentType() method, perhaps in conjunction with the #Document.getContentTypeForFilename(String path) method.

The difference in treatment compared to the URI constructor is for legacy code compatibility.

If the Document is created using the #com.adobe.idp.Document.Document(DocumentStringType, String, DocumentPassivationClientFactory) constructor or the #com.adobe.idp.Document.Document(URI, DocumentPassivationClientFactory) constructor then the string/URI will be internally passivated so that the repository can supply the content type.

Returns:
The current MIME content type. It can return null if the content type is unknown.
See Also:
#setContentType()

setAttribute

public void setAttribute(java.lang.String name,
                         java.io.Serializable value)
Sets the value of an attribute with a given name.

Parameters:
name - The attribute name.
value - The attribute value.
See Also:
#getAttribute(), #removeAttribute(), Document.listAttributes()

getAttribute

public java.io.Serializable getAttribute(java.lang.String name)
Returns the value of an attribute with a given name.

An attribute is an arbitrary (preferably small) serializable object passed along with the Document instance. Every attribute should have a unique name. The predefined attributes are:

AttributeDescription
fileThe original file name (as a string), if the Document was created with the Document.Document(File, boolean) constructor, or the "file" attribute was set explicitly.
wsfilenameA legacy compatibility alias for the "file" attribute. New code should use the "file" attribute. The "file" and "wsfilename" attributes will always have the same value. Setting either one will reset the value of the "basename" attribute. Setting the "basename" attribute will reset both "file" and "wsfilename" to the same value as "basename".
basenameThe original base file name (as a string) if either the file or url attributes are available. The base file name is the name without any leading path information, i.e. the part of the filename after the last '\' or '/' (whichever comes later). If no '/' or '\' is present the whole filename will be used as the base name. This attribute is set whenever the file, wsfilename, or url attributes are set. Setting this attribute will set the file and wsfilename attributes to the same value.
urlThe original URL (as a string), if the Document was created with the Document.Document(java.net.URL) constructor, or the "url" attribute was set explicitly. Setting this attribute will reset "basename" as well. If the part of the URL after the last '/' if any can be interpretted as a URI and decoded, that value will be used as the basename. Otherwise the part of the URL after the last '/' if any will be used as-is. If no '/' is present the whole URL is used as the base name.
NOTE: removing any of the file, wsfilename or basename attributes will remove all three filename related attributes. To clear all potential file/url source related information remove file and url attributes.

Parameters:
name - The attribute name.
Returns:
The attribute value.
See Also:
#setAttribute(), #removeAttribute(), Document.listAttributes()

removeAttribute

public void removeAttribute(java.lang.String name)
Removes an attribute with the given name.

Parameters:
name - The attribute name.
See Also:
#setAttribute(), #getAttribute(), Document.listAttributes()

listAttributes

public java.util.Set listAttributes()
Lists the names of all attributes associated with this Document instance.

Returns:
The set of all attribute names.
See Also:
#getAttribute(), #setAttribute(), #removeAttribute()

dispose

public void dispose()
Disposes of any local temporary storage resources (for example, file, database data, and so on) occupied by the document content. Once disposed, the Document instance becomes invalid, meaning that it becomes impossible to use the Document for any purpose.

In a few cases the Document can also be disposed of automatically. This occurs when the disposal timeout ends, which is set using the Document.setDisposalTimeout(int) method, or when the current transaction ends and the Document is set as transaction-bound using the Document.setTransactionBound(boolean) method.

See Also:
Document.setDisposalTimeout(int), Document.setTransactionBound(boolean)

isLocalizable

public static boolean isLocalizable()

isPassivationLazy

public static boolean isPassivationLazy()
Returns true if lazy passivation is on. If this is the case, the Document content is not passivated until the receiving side requests the content (unless it is passivated explicitly via the passivate() call). If it is off, the Document is passivated during its serialization (for example, when making an RMI/EJB call with a Document object as an input parameter).

Lazy passivation is a default behavior within the J2EE environment. For standalone J2SE applications, lazy passivation is off by default. This is because the lazy passivation might require a remote callback from the side receiving the Document object to the side supplying one. Such a callback might be problematic for standalone J2SE applications (for example, because the supplier side is behind a network firewall, or because the secure connection is a must but the supplier side does not support the SSL protocol in the callback direction).

Returns:
true if the lazy passivation is on; false otherwise.
See Also:
Document.setPassivationLazy(boolean)

setPassivationLazy

public static void setPassivationLazy(boolean enable)
Use this method to override the default passivation behavior.

Parameters:
enable - Set to true to enable lazy passivation.
See Also:
Document.isPassivationLazy()

toString

public java.lang.String toString()
Returns a text representation of the Document internal state. Use this method for debugging only.

Overrides:
toString in class java.lang.Object
Returns:
A java.lang.String with the Document internal state in XML format.

setInitialContext

public static void setInitialContext(javax.naming.InitialContext ic)
Use this method to set the InitialContext needed by the Document object in order to look up an internal server EJB, which is used to upload the Document object's content to the Adobe Experience Manager forms server. This method should be called by standalone client applications at initialization time. If this method is not called, the Document object will use an InitialContext object created with an empty constructor.


getInitialContext

public static javax.naming.InitialContext getInitialContext()