de.bea.domingo.mock
Class MockDocument

java.lang.Object
  extended by de.bea.domingo.mock.MockDocument
All Implemented Interfaces:
DBase, DBaseDocument, DDocument, java.io.Serializable

public final class MockDocument
extends java.lang.Object
implements DDocument

Transient mock implementation of interface DDocument.

Author:
Christian Wied, Kurt Riede
See Also:
Serialized Form

Constructor Summary
MockDocument()
           
 
Method Summary
 DItem appendItemValue(java.lang.String name)
          Creates a new empty item in a document.
 DItem appendItemValue(java.lang.String name, java.util.Calendar value)
          Creates a new item in a document and sets the item value.
 DItem appendItemValue(java.lang.String name, double value)
          Creates a new item in a document and sets the item value.
 DItem appendItemValue(java.lang.String name, int value)
          Creates a new item in a document and sets the item value.
 DItem appendItemValue(java.lang.String name, java.util.List values)
          Creates a new item in a document and sets the item value.
 DItem appendItemValue(java.lang.String name, java.lang.String value)
          Creates a new item in a document and sets the item value.
 boolean computeWithForm()
          Validates a document by executing the default value, translation, and validation formulas, if any are defined in the document form.
 boolean computeWithForm(boolean raiseError)
          Validates a document by executing the default value, translation, and validation formulas, if any are defined in the document form.
 void copyAllItems(DBaseDocument doc, boolean replace)
          Copies all items in the current document into the destination document.
 DBaseItem copyItem(DBaseItem item)
          Copies an item into the current document and optionally assigns the copied item a new name.
 DBaseItem copyItem(DBaseItem item, java.lang.String s)
          Copies an item into the current document and optionally assigns the copied item a new name.
 DDocument copyToDatabase(DDatabase database)
          Copies a document to a specified database.
 DDocument createReplyMessage(boolean flag)
          Creates a new document that is formatted as a reply to the current document.
 DRichTextItem createRichTextItem(java.lang.String name)
          Creates a new rich text item in a document.
 void encrypt()
          Encrypts a document.
 java.lang.String generateXML()
          Generates an XML representation of a document to the Writer.
 void generateXML(java.io.Writer writer)
          Generates an XML representation of a document to the Writer.
 DEmbeddedObject getAttachment(java.lang.String filename)
          Returns a representation of a file attachment.
 java.util.List getAttachments()
          Returns all embedded objects that are attachments.
 java.util.List getAuthors()
          The names of the people who have saved a document.
 java.util.List getColumnValues()
          A list of values, each element of which corresponds to a column value in the document's parent view.
 java.util.Calendar getCreated()
          The date a document was created.
 java.util.Iterator getEmbeddedObjects()
          Returns all embedded objects.
 java.util.List getEncryptionKeys()
          Returns the key(s) used to encrypt a document.
 DBaseItem getFirstItem(java.lang.String name)
          Returns the first item of a specified name in a document.
 java.util.List getFolderReferences()
          The names of the folders containing a document.
 int getFTSearchScore()
          The full-text search score of a document, if it was retrieved as part of a full-text search.
 java.lang.String getHttpURL()
          The Domino URL of a form when HTTP protocols are in effect.
 java.util.Iterator getItems()
          Iterator for all items in a document.
 java.util.List getItemValue(java.lang.String name)
          Returns the value of an item.
 java.lang.Object getItemValueCustomData(java.lang.String name)
          Returns as an object the value of an item containing custom data.
 java.lang.Object getItemValueCustomData(java.lang.String name, java.lang.String dataTypeName)
          Returns as an object the value of an item containing custom data.
 byte[] getItemValueCustomDataBytes(java.lang.String name, java.lang.String dataTypeName)
          Returns as a byte array the value of an item containing custom data.
 java.util.Calendar getItemValueDate(java.lang.String name)
          Returns the value of an item with a single Calendar value.
 DDateRange getItemValueDateRange(java.lang.String name)
          Returns the value of an item with two Calendar value.
 java.util.List getItemValueDateTimeArray(java.lang.String name)
          Returns the value of a date-time item in a document.
 java.lang.Double getItemValueDouble(java.lang.String name)
          Returns the value of an item with a single double value.
 java.lang.Integer getItemValueInteger(java.lang.String name)
          Returns the value of an item with a single int value.
 int getItemValueSize(java.lang.String name)
          Returns the number of values of an item.
 java.lang.String getItemValueString(java.lang.String name)
          Returns the value of an item with a single text value.
 java.util.Calendar getLastAccessed()
          The date a document was last modified or read.
 java.util.Calendar getLastModified()
          The date a document was last modified.
 java.util.List getLockHolders()
          The names of the holders of a lock.
 java.lang.String getNoteID()
          The note ID of a document, which is a hexadecimal value of up to 8 characters that uniquely identifies a document within a particular database.
 java.lang.String getNotesURL()
          The Domino URL of a form when Notes protocols are in effect.
 DDatabase getParentDatabase()
          Return the database that contains a document.
 DDocument getParentDocument()
          The parent document if the document is a response document.
 java.lang.String getParentDocumentUNID()
          The universal ID of a document's parent, if the document is a response.
 DView getParentView()
          The view from which a document was retrieved, if any.
 java.util.List getReceivedItemText()
          Gets the text values of the Received items in a mail document.
 java.util.Iterator getResponses()
          The immediate responses to a document.
 java.lang.String getSigner()
          The name of the person who created the signature, if a document is signed.
 int getSize()
          The size of a database, in bytes.
 java.lang.String getUniversalID()
          The universal ID, which uniquely identifies a document across all replicas of a database.
 java.lang.String getURL()
          Returns the Domino URL for its parent object.
 java.lang.String getVerifier()
          The name of the certificate that verified a signature, if a document is signed.
 boolean hasEmbedded()
          Indicates whether a document contains one or more embedded objects, object links, or file attachments.
 boolean hasItem(java.lang.String name)
          Indicates whether an item exists in the document.
 boolean isDeleted()
          Indicates whether a Document object represents an existing document (not a deletion stub) on an ongoing basis.
 boolean isEncrypted()
          Indicates whether a document is encrypted.
 boolean isEncryptOnSend()
          Indicates whether a document is encrypted when mailed.
 boolean isNewNote()
          Indicates whether a document is new.
 boolean isProfile()
          Indicates whether a Document object is a profile document.
 boolean isResponse()
          Indicates whether a document is a response to another document.
 boolean isSaveMessageOnSend()
          Indicates whether a document is saved to a database when mailed.
 boolean isSentByAgent()
          Indicates whether a document was mailed by a Domino program.
 boolean isSigned()
          Indicates whether a document contains a signature.
 boolean isSignOnSend()
          Indicates whether a document is signed when mailed.
 boolean isValid()
          Indicates whether a Document object represents an existing document (not a deletion stub) initially.
 boolean lock()
          Locks a document.
 boolean lock(boolean provisionalOk)
          Locks a document.
 boolean lock(java.util.List names)
          Locks a document.
 boolean lock(java.util.List names, boolean provisionalOk)
          Locks a document.
 boolean lock(java.lang.String name)
          Locks a document.
 boolean lock(java.lang.String name, boolean provisionalOk)
          Locks a document.
 boolean lockProvisional()
          Locks a document provisionally.
 boolean lockProvisional(java.util.List names)
          Locks a document provisionally.
 boolean lockProvisional(java.lang.String name)
          Locks a document provisionally.
 void makeResponse(DDocument doc)
          Makes one document a response to another.
 void putInFolder(java.lang.String s)
          Adds a document to a folder.
 void putInFolder(java.lang.String s, boolean flag)
          Adds a document to a folder.
 void recycle()
          The recycle method unconditionally destroys an object and returns its memory to the system.
 boolean remove()
          Permanently removes a document from a database.
 boolean remove(boolean force)
          Permanently removes a document from a database.
 void removeFromFolder(java.lang.String s)
          Removes a document from a folder.
 void removeItem(java.lang.String name)
          Removes an item from a document.
 boolean removePermanently(boolean flag)
          Permanently deletes a document from a database, doing a hard deletion even if soft deletions are enabled.
 boolean renderToRTItem(DRichTextItem richtextitem)
          Creates a picture of a document and places it into a rich-text item that you specify.
 void replaceHTML(java.lang.String name, java.lang.String value)
          Replaces a MIMEEntity item with a new item with the given HTML code.
 DItem replaceItemValue(java.lang.String name, java.util.Calendar value)
          Replaces all items of the specified name with one new item, which is assigned the specified value.
 DItem replaceItemValue(java.lang.String name, java.util.Calendar calendar1, java.util.Calendar calendar2)
          Replaces all items of the specified name with one new item, which is assigned the specified value.
 DItem replaceItemValue(java.lang.String name, DDateRange value)
          Replaces all items of the specified name with one new item, which is assigned the specified value.
 DItem replaceItemValue(java.lang.String name, double value)
          Replaces all items of the specified name with one new item, which is assigned the specified value.
 DItem replaceItemValue(java.lang.String name, java.lang.Double value)
          Replaces all items of the specified name with one new item, which is assigned the specified value.
 DItem replaceItemValue(java.lang.String name, int value)
          Replaces all items of the specified name with one new item, which is assigned the specified value.
 DItem replaceItemValue(java.lang.String name, java.lang.Integer value)
          Replaces all items of the specified name with one new item, which is assigned the specified value.
 DItem replaceItemValue(java.lang.String name, java.util.List values)
          Replaces all items of the specified name with one new item, which is assigned the specified value.
 DItem replaceItemValue(java.lang.String name, java.lang.String value)
          Replaces all items of the specified name with one new item, which is assigned the specified value.
 DItem replaceItemValue(java.lang.String name, java.util.TimeZone value)
          Replaces all items of the specified name with one new item, which is assigned the specified value.
 DItem replaceItemValueCustomData(java.lang.String s, java.lang.Object obj)
          Replaces all items of the specified name with one new item, which is assigned custom data from a byte array.
 DItem replaceItemValueCustomData(java.lang.String s, java.lang.String s1, java.lang.Object obj)
          Replaces all items of the specified name with one new item, which is assigned custom data from a byte array.
 DItem replaceItemValueCustomDataBytes(java.lang.String s, java.lang.String s1, byte[] abyte0)
          Replaces all items of the specified name with one new item, which is assigned custom data from a byte array.
 boolean save()
          Saves any changes you have made to a document.
 boolean save(boolean force)
          Saves any changes you have made to a document.
 boolean save(boolean force, boolean makeresponse)
          Saves any changes you have made to a document.
 void send(java.util.List recipients)
          Mails a document.
 void send(java.lang.String recipient)
          Mails a document.
 void setEncryptionKeys(java.util.List keys)
          Sets the key(s) used to encrypt a document.
 void setEncryptOnSend(boolean flag)
          Indicates if a document is encrypted when mailed.
 void setSaveMessageOnSend(boolean saveMessageOnSend)
          Indicates if a document is saved to a database when mailed.
 void setSignOnSend(boolean flag)
          Indicates if a document is signed when mailed.
 void setUniversalID(java.lang.String unid)
          The universal ID, which uniquely identifies a document across all replicas of a database.
 void sign()
          Signs a document.
 java.lang.String toString()
          Returns a short description of an instance.
 void unlock()
          Unlocks a document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.bea.domingo.DBase
equals, hashCode
 

Constructor Detail

MockDocument

public MockDocument()
Method Detail

isNewNote

public boolean isNewNote()
Indicates whether a document is new. A document is new if it has not been saved.

Specified by:
isNewNote in interface DDocument
Returns:
Boolean true if the document was created, but has not been saved
See Also:
DDocument.isNewNote()

getUniversalID

public java.lang.String getUniversalID()
The universal ID, which uniquely identifies a document across all replicas of a database.

In character format, the universal ID is a 32-character combination of hexadecimal digits (0-9, A-F). The universal ID is also known as the unique ID or UNID.

Specified by:
getUniversalID in interface DDocument
Returns:
String
See Also:
DDocument.getUniversalID()

getNoteID

public java.lang.String getNoteID()
The note ID of a document, which is a hexadecimal value of up to 8 characters that uniquely identifies a document within a particular database.

A typical note ID looks like this: 20FA. A note ID represents the location of a document within a specific database file, so documents that are replicas of one another generally have different note IDs. A note ID does not change, unless the document is deleted.

Specified by:
getNoteID in interface DDocument
Returns:
the notes ID
See Also:
DDocument.getNoteID()

send

public void send(java.lang.String recipient)
Mails a document.

The following rules apply to specification of the recipient or recipients:

If you have only Reader access to a database, you can run an agent that creates and sends a document, but the agent will not work if you attach a file to that document.

Two kinds of items can affect the mailing of the document when you use send:

The IsSaveMessageOnSend property controls whether the sent document is saved in the database. If IsSaveMessageOnSend is true and you attach the form to the document, the form is saved with the document.

The send method automatically creates an item called $AssistMail on the sent document. The SentByAgent property uses this item to determine if a document was mailed by an agent.

If a program runs on a workstation, the mailed document contains the current user's name in the From item. If a program runs as an agent on a server, the mailed document contains the server's name in the From item.

Specified by:
send in interface DDocument
Parameters:
recipient - name of recipient
See Also:
DDocument.send(java.lang.String)

send

public void send(java.util.List recipients)
Mails a document.

Specified by:
send in interface DDocument
Parameters:
recipients - list of Strings with recipients
See Also:
DDocument.send(java.util.List)

copyToDatabase

public DDocument copyToDatabase(DDatabase database)
Copies a document to a specified database.

Specified by:
copyToDatabase in interface DDocument
Parameters:
database - The database to which you want to copy the document. Cannot be null.
Returns:
The new document in the specified database or null if the document cannot be created
See Also:
DDocument.copyToDatabase(de.bea.domingo.DDatabase)

isResponse

public boolean isResponse()
Indicates whether a document is a response to another document.

Specified by:
isResponse in interface DDocument
Returns:
true if the document is a response to another document, else false
See Also:
DDocument.isResponse()

getParentDocumentUNID

public java.lang.String getParentDocumentUNID()
The universal ID of a document's parent, if the document is a response. Returns an empty string if a document doesn't have a parent.

Specified by:
getParentDocumentUNID in interface DDocument
Returns:
the universal ID
See Also:
DDocument.getParentDocumentUNID()

getParentDocument

public DDocument getParentDocument()
The parent document if the document is a response document.

Specified by:
getParentDocument in interface DDocument
Returns:
the parent document or null if the document is not a response document.
See Also:
DDocument.getParentDocument()

makeResponse

public void makeResponse(DDocument doc)
Makes one document a response to another. The two documents must be in the same database.

Specified by:
makeResponse in interface DDocument
Parameters:
doc - The document to which the current document becomes a response.
See Also:
DDocument.makeResponse(de.bea.domingo.DDocument)

getResponses

public java.util.Iterator getResponses()
The immediate responses to a document.

Each document returned is an immediate response to the first document. Responses-to-responses are not included. If the current document has no responses, the vector contains zero documents.

Responses-to-Responses
This property returns only immediate responses to a document, but you can write a recursive sub or function to access all the descendants of a particular document. A recursive sub calls itself in the same way that a non-recursive sub calls any other sub or function.

Specified by:
getResponses in interface DDocument
Returns:
The immediate responses to a document.
See Also:
DDocument.getResponses()

setSaveMessageOnSend

public void setSaveMessageOnSend(boolean saveMessageOnSend)
Indicates if a document is saved to a database when mailed. Applies only to new documents that have not yet been saved.

When SaveMessageOnSend is true, the document is saved just after being mailed.

Specified by:
setSaveMessageOnSend in interface DDocument
Parameters:
saveMessageOnSend - true if the document is saved when mailed, else false.
See Also:
DDocument.setSaveMessageOnSend(boolean)

setEncryptOnSend

public void setEncryptOnSend(boolean flag)
Indicates if a document is encrypted when mailed.

To encrypt a document when mailed, this method looks for the public key of each recipient in the Domino Directory. If it cannot find a recipient's public key, the method sends an unencrypted copy of the document to that recipient. All other recipients receive an encrypted copy of the document.

This property has no effect on whether a document is encrypted when saved to a database.

Specified by:
setEncryptOnSend in interface DDocument
Parameters:
flag - true if the document is encrypted when mailed, else false.
See Also:
DDocument.setEncryptOnSend(boolean)

setSignOnSend

public void setSignOnSend(boolean flag)
Indicates if a document is signed when mailed.

Specified by:
setSignOnSend in interface DDocument
Parameters:
flag - true if the document is signed when mailed; else false.
See Also:
DDocument.setSignOnSend(boolean)

sign

public void sign()
Signs a document.

If you want the signature to be saved, you must call the Save method after signing the document.

If the program is running on a server, this method has no effect.

Specified by:
sign in interface DDocument
See Also:
DDocument.sign()

getFirstItem

public DBaseItem getFirstItem(java.lang.String name)
Returns the first item of a specified name in a document.

A document may contain more than one item of the same name. To access other than the first item, use the Items property.

If the value of a field is computed for display, the value is not stored as an item and is inaccessible from a Document object. In some cases, you can access the field value another way. For example, if a document has a DateComposed field computed for display with the formula @Created, use getCreated.

Using this method to get normal items (non-rich text)
To get a normal item, explicitly cast the return value from getFirstItem to DItem.

 DDocument doc;
 //...set value of doc...
 DItem item = (DItem)doc.getFirstItem("Body");
 

Using this method to get rich text items
To get a rich text item, explicitly cast the return value from getFirstItem to DRichTextItem.

 DDocument doc;
 //...set value of doc...
 DRichTextItem rtitem = (DRichTextItem)doc.getFirstItem("Body");
 

Specified by:
getFirstItem in interface DBaseDocument
Parameters:
name - name of an item
Returns:
DBaseItem
See Also:
DBaseDocument.getFirstItem(java.lang.String)

getItems

public java.util.Iterator getItems()
Iterator for all items in a document.

Note

Values set as int, are handled (by Notes) as a type Number and returned to Java as a Double.

Specified by:
getItems in interface DBaseDocument
Returns:
Iterator for all items in a document. These are normal DItem as well as DRichTextItems
See Also:
DBaseDocument.getItems()

getCreated

public java.util.Calendar getCreated()
The date a document was created.

Specified by:
getCreated in interface DBaseDocument
Returns:
Calendar created date
See Also:
DBaseDocument.getCreated()

appendItemValue

public DItem appendItemValue(java.lang.String name)
Creates a new empty item in a document. A empty item has a value of type String that is an empty String ("").

Note
In general, replaceItemValue is favored over appendItemValue. If an item of the same name already exists in a document, appendItemValue creates a second item of the same name, and the duplicate items are not accessible through most methods. If you are creating a new document, appendItemValue is safe.

Specified by:
appendItemValue in interface DBaseDocument
Parameters:
name - name of an item
Returns:
DItem
See Also:
DBaseDocument.appendItemValue(java.lang.String)

appendItemValue

public DItem appendItemValue(java.lang.String name,
                             java.lang.String value)
Creates a new item in a document and sets the item value.

Note
In general, replaceItemValue is favored over appendItemValue. If an item of the same name already exists in a document, appendItemValue creates a second item of the same name, and the duplicate items are not accessible through most methods. If you are creating a new document, appendItemValue is safe.

Specified by:
appendItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item.
Returns:
DItem
See Also:
DBaseDocument.appendItemValue(java.lang.String, java.lang.String)

appendItemValue

public DItem appendItemValue(java.lang.String name,
                             int value)
Creates a new item in a document and sets the item value.

Note
In general, replaceItemValue is favored over appendItemValue. If an item of the same name already exists in a document, appendItemValue creates a second item of the same name, and the duplicate items are not accessible through most methods. If you are creating a new document, appendItemValue is safe.

Note

The value given as int is handled (by Notes) as a type Number and returned to Java as a Double.

Specified by:
appendItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item.
Returns:
DItem
See Also:
DBaseDocument.appendItemValue(java.lang.String, int)

appendItemValue

public DItem appendItemValue(java.lang.String name,
                             double value)
Creates a new item in a document and sets the item value.

Note
In general, replaceItemValue is favored over appendItemValue. If an item of the same name already exists in a document, appendItemValue creates a second item of the same name, and the duplicate items are not accessible through most methods. If you are creating a new document, appendItemValue is safe.

Specified by:
appendItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item.
Returns:
DItem
See Also:
DBaseDocument.appendItemValue(java.lang.String, double)

appendItemValue

public DItem appendItemValue(java.lang.String name,
                             java.util.Calendar value)
Creates a new item in a document and sets the item value. The milliseconds are cut off.

Note
In general, replaceItemValue is favored over appendItemValue. If an item of the same name already exists in a document, appendItemValue creates a second item of the same name, and the duplicate items are not accessible through most methods. If you are creating a new document, appendItemValue is safe.

Specified by:
appendItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item.
Returns:
DItem
See Also:
DBaseDocument.appendItemValue(java.lang.String, java.util.Calendar)

appendItemValue

public DItem appendItemValue(java.lang.String name,
                             java.util.List values)
Creates a new item in a document and sets the item value.

Note
In general, replaceItemValue is favored over appendItemValue. If an item of the same name already exists in a document, appendItemValue creates a second item of the same name, and the duplicate items are not accessible through most methods. If you are creating a new document, appendItemValue is safe.

Specified by:
appendItemValue in interface DBaseDocument
Parameters:
name - name of an item
values - The value of the new item as a list of String, Integer, Double, or java.util.Calendar elements
Returns:
DItem
See Also:
DBaseDocument.appendItemValue(java.lang.String, java.util.List)

replaceItemValue

public DItem replaceItemValue(java.lang.String name,
                              java.lang.String value)
Replaces all items of the specified name with one new item, which is assigned the specified value.

If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

Specified by:
replaceItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item.
Returns:
DItem
See Also:
h

replaceItemValue

public DItem replaceItemValue(java.lang.String name,
                              int value)
Replaces all items of the specified name with one new item, which is assigned the specified value.

If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

Specified by:
replaceItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item.
Returns:
DItem
See Also:
DBaseDocument.replaceItemValue(java.lang.String, int)

replaceItemValue

public DItem replaceItemValue(java.lang.String name,
                              double value)
Replaces all items of the specified name with one new item, which is assigned the specified value.

If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

Specified by:
replaceItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item
Returns:
DItem
See Also:
DBaseDocument.replaceItemValue(java.lang.String, double)

replaceItemValue

public DItem replaceItemValue(java.lang.String name,
                              java.util.Calendar value)
Replaces all items of the specified name with one new item, which is assigned the specified value.

If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

The milliseconds are cut off.

Specified by:
replaceItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item
Returns:
DItem
See Also:
DBaseDocument.replaceItemValue(java.lang.String, java.util.Calendar)

replaceItemValue

public DItem replaceItemValue(java.lang.String name,
                              java.util.List values)
Replaces all items of the specified name with one new item, which is assigned the specified value.

If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

Specified by:
replaceItemValue in interface DBaseDocument
Parameters:
name - name of an item
values - The new value of the item as a list of String, Integer, Double, or java.util.Calendar elements
Returns:
DItem
See Also:
DBaseDocument.replaceItemValue(java.lang.String, java.util.List)

save

public boolean save()
Saves any changes you have made to a document.

Note If the document is a DProfileDocument, a call to the save method is only successful to a newly created document if a item was appended.

Specified by:
save in interface DBaseDocument
Returns:
true of successfully saved, else false
See Also:
DBaseDocument.save()

save

public boolean save(boolean force)
Saves any changes you have made to a document.

Note If the document is a DProfileDocument, a call to the save method is only successful to a newly created document if a item was appended.

Specified by:
save in interface DBaseDocument
Parameters:
force - If true, the document is saved even if someone else edits and saves the document while the program is running. The last version of the document that was saved wins; the earlier version is discarded. If false, and someone else edits the document while the program is running, the makeresponse argument determines what happens.
Returns:
true of successfully saved, else false
See Also:
DBaseDocument.save(boolean)

save

public boolean save(boolean force,
                    boolean makeresponse)
Saves any changes you have made to a document.

Note If the document is a DProfileDocument, a call to the save method is only successful to a newly created document if a item was appended.

Specified by:
save in interface DBaseDocument
Parameters:
force - If true, the document is saved even if someone else edits and saves the document while the program is running. The last version of the document that was saved wins; the earlier version is discarded. If false, and someone else edits the document while the program is running, the makeresponse argument determines what happens.
makeresponse - If true, the current document becomes a response to the original document (this is what the replicator does when there's a replication conflict). If false, the save is canceled. If the force parameter is true, the makeresponse parameter has no effect.
Returns:
true of successfully saved, else false
See Also:
DBaseDocument.save(boolean, boolean)

getAttachment

public DEmbeddedObject getAttachment(java.lang.String filename)
Returns a representation of a file attachment. You can use this method to find file attachments that are not contained in a rich text item (such as an attachment in a Release 2 database) as well as file attachments that are contained in a rich text item.

The Parent property for the returned EmbeddedObject returns null, since it was not accessed through a RichTextItem.

Specified by:
getAttachment in interface DBaseDocument
Parameters:
filename - The file name of the file attachment.
Returns:
A representation of the file attachment. Returns null if an attachment with the specified name is not found.
See Also:
DBaseDocument.getAttachment(java.lang.String)

getEmbeddedObjects

public java.util.Iterator getEmbeddedObjects()
Returns all embedded objects. This method does include OLE/2 and OLE/1 objects created in Release 4 and higher. It also includes objects in the document that were originally embedded in the document's form. Such objects must have been activated, modified, and re-saved in order to be returned by this property (otherwise they remain a part of the form, not the document).

The list is empty if the document contains no embedded objects.

Note:

Embedded objects and object links are not supported for OS/2, UNIX, and the Macintosh. File attachments are supported on all platforms.

Specified by:
getEmbeddedObjects in interface DBaseDocument
Returns:
an iterator supplying all embedded objects
See Also:
DBaseDocument.getEmbeddedObjects()

getAttachments

public java.util.List getAttachments()
Returns all embedded objects that are attachments. The list is empty if the document contains no attachments.

Specified by:
getAttachments in interface DBaseDocument
Returns:
a list of all embedded objects
See Also:
DBaseDocument.getAttachments()

removeItem

public void removeItem(java.lang.String name)
Removes an item from a document.

Specified by:
removeItem in interface DBaseDocument
Parameters:
name - The name of the item to remove from the document. If more than one item has the specified name, all items with this name are removed. If there is no item with the specified name, the method does nothing.

You can achieve the same result with remove in Item. To keep the changes to the document, you must call save after removing the item.

See Also:
DBaseDocument.removeItem(java.lang.String)

remove

public boolean remove()
Permanently removes a document from a database. If another user modifies the document after your program opens it, the document is not removed.

Specified by:
remove in interface DBaseDocument
Returns:
true if the document is successfully removed or if the document is not contained in a database (then a exception should be logged), false if the document is not deleted because another user modified it and the force parameter is set to false.
See Also:
DBaseDocument.remove()

remove

public boolean remove(boolean force)
Permanently removes a document from a database.

Specified by:
remove in interface DBaseDocument
Parameters:
force - If true, the document is removed even if another user modifies the document after your program opens it. If false, the document is not removed if another user modifies it.
Returns:
true if the document is successfully removed or if the document is not contained in a database (then a exception should be logged), false if the document is not deleted because another user modified it and the force parameter is set to false.
See Also:
DBaseDocument.remove(boolean)

createRichTextItem

public DRichTextItem createRichTextItem(java.lang.String name)
Creates a new rich text item in a document.

Specified by:
createRichTextItem in interface DBaseDocument
Parameters:
name - The name of the new rich-text item.
Returns:
The newly created item.
See Also:
DBaseDocument.createRichTextItem(java.lang.String)

getItemValue

public java.util.List getItemValue(java.lang.String name)
Returns the value of an item.

If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.

If the item has no value, this method returns an empty vector.

If no item with the specified name exists, this method returns an empty vector. It does not throw an exception. Use hasItem to verify the existence of an item.

This property returns the same value(s) for an item as getValues in Item.

Specified by:
getItemValue in interface DBaseDocument
Parameters:
name - name of an item
Returns:
The value or values contained in the item. The data type of the value depends on the data type of the item.
See Also:
DBaseDocument.getItemValue(java.lang.String)

getItemValueString

public java.lang.String getItemValueString(java.lang.String name)
Returns the value of an item with a single text value.

If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.

The value of the item cannot be null, but if the value is numeric or Calendar, this method returns an empty String.

If no item with the specified name exists, this method returns null. It does not throw an exception. Use hasItem to verify the existence of an item.

If the item has multiple values, this method returns the first value.

Specified by:
getItemValueString in interface DBaseDocument
Parameters:
name - The name of the item.
Returns:
The value of the item as a String.
See Also:
DBaseDocument.getItemValueString(java.lang.String)

getItemValueDate

public java.util.Calendar getItemValueDate(java.lang.String name)
Returns the value of an item with a single Calendar value. The date/time value of the item is stored in the calendar in the default time zone of the client.

If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.

If value is numeric or text, this method returns null.

If no item with the specified name exists, this method returns null. It does not throw an exception. Use hasItem to verify the existence of an item.

If the item has multiple values, this method returns the first value.

Specified by:
getItemValueDate in interface DBaseDocument
Parameters:
name - The name of the item.
Returns:
The value of the item as a Calendar or null if the item doesn't contain a date/time value
See Also:
DBaseDocument.getItemValueDate(java.lang.String)

getItemValueInteger

public java.lang.Integer getItemValueInteger(java.lang.String name)
Returns the value of an item with a single int value.

If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.

If the value is text and is empty, this method returns null.

If the value is text and cannot be converted to am integer, this method returns null.

If no item with the specified name exists, this method returns null. It does not throw an exception. Use hasItem to verify the existence of an item.

If the item has multiple values, this method returns the first value.

A decimal number is rounded down if the fraction is less than 0.5 and up if the fraction is 0.5 or greater.

Specified by:
getItemValueInteger in interface DBaseDocument
Parameters:
name - The name of the item.
Returns:
The value of the item, rounded to the nearest integer or null
See Also:
DBaseDocument.getItemValueInteger(java.lang.String)

getItemValueDouble

public java.lang.Double getItemValueDouble(java.lang.String name)
Returns the value of an item with a single double value.

If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.

If the value is text and is empty, this method returns null.

If the value is text and cannot be converted to a double, this method returns null.

If no item with the specified name exists, this method returns null. It does not throw an exception. Use hasItem to verify the existence of an item.

If the item has multiple values, this method returns the first value.

Specified by:
getItemValueDouble in interface DBaseDocument
Parameters:
name - The name of the item.
Returns:
The value of the item as a Double or null
See Also:
DBaseDocument.getItemValueDouble(java.lang.String)

hasItem

public boolean hasItem(java.lang.String name)
Indicates whether an item exists in the document.

Specified by:
hasItem in interface DBaseDocument
Parameters:
name - The name of an item.
Returns:
true if an item with name exists in the document, else false
See Also:
DBaseDocument.hasItem(java.lang.String)

getAuthors

public java.util.List getAuthors()
The names of the people who have saved a document.

If a name is hierarchical, this property returns the fully distinguished name.

This property does not return the names of people who have permission to edit a document (as found in an item of type Authors). Therefore, the people returned by the Authors property and the people listed in an Authors item may differ.

Specified by:
getAuthors in interface DBaseDocument
Returns:
List of Strings with authors names. In case of a normal document this method call returns a empty list for a not-saved-document. In case of a profile document, this method call returns a list with one entry, even if the profile document is requested for the first time.
See Also:
DBaseDocument.getAuthors()

getLastAccessed

public java.util.Calendar getLastAccessed()
The date a document was last modified or read.

The value returned is exact only to the day, not the hour. If the document is edited, the property is always updated. If the document is read more than once during the same 24hour period, the value is only updated the first time accessed.

Specified by:
getLastAccessed in interface DBaseDocument
Returns:
last accessed date
See Also:
DBaseDocument.getLastAccessed()

getLastModified

public java.util.Calendar getLastModified()
The date a document was last modified.

Specified by:
getLastModified in interface DBaseDocument
Returns:
last modified date. In case of a normal document this method call returns a empty list for a not-saved-document. In case of a profile document, this method call returns a list with one entry, even if the profile document is requested for the first time.
See Also:
DBaseDocument.getLastModified()

replaceItemValue

public DItem replaceItemValue(java.lang.String name,
                              java.lang.Integer value)
Replaces all items of the specified name with one new item, which is assigned the specified value.

If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

Specified by:
replaceItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item.
Returns:
DItem
See Also:
DBaseDocument.replaceItemValue(java.lang.String, java.lang.Integer)

replaceItemValue

public DItem replaceItemValue(java.lang.String name,
                              java.lang.Double value)
Replaces all items of the specified name with one new item, which is assigned the specified value.

If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

Specified by:
replaceItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item
Returns:
DItem
See Also:
DBaseDocument.replaceItemValue(java.lang.String, java.lang.Double)

getItemValueSize

public int getItemValueSize(java.lang.String name)
Returns the number of values of an item.

If multiple items have the same name, this method returns the number of values in the first item. Use the Items property to get all the items.

If the item has no value, this method returns 0.

If no item with the specified name exists, this method returns 0. It does not throw an exception. Use hasItem to verify the existence of an item.

This property returns the same value for an item as getSize() in DItem.

Specified by:
getItemValueSize in interface DBaseDocument
Parameters:
name - name of an item
Returns:
The number of values contained in the item.
See Also:
DBaseDocument.getItemValueSize(java.lang.String)

getParentDatabase

public DDatabase getParentDatabase()
Return the database that contains a document.

Specified by:
getParentDatabase in interface DBaseDocument
Returns:
the database that contains a document
See Also:
DBaseDocument.getParentDatabase()

toString

public java.lang.String toString()
Returns a short description of an instance.

Specified by:
toString in interface DBase
Overrides:
toString in class java.lang.Object
Returns:
short description of an instance
See Also:
Object.toString()

copyAllItems

public void copyAllItems(DBaseDocument doc,
                         boolean replace)
Copies all items in the current document into the destination document. The item names are unchanged.

If you are not copying to a newly created document, you should probably specify true for the second parameter. See appendItemValue for a note about appending items to existing documents.

Specified by:
copyAllItems in interface DBaseDocument
Parameters:
doc - The destination document
replace - If true, the items in the destination document are replaced. If false, the items in the destination document are appended.
See Also:
DBaseDocument.copyAllItems(de.bea.domingo.DBaseDocument, boolean)

recycle

public void recycle()
The recycle method unconditionally destroys an object and returns its memory to the system.

Different to the Notes Java-API, usually it is not necessary to use this method. One remaining case might be a document that was changed in another session (e.g. by a server agent) while still keeping a reference to the document.

Specified by:
recycle in interface DBaseDocument
See Also:
DBaseDocument.recycle()

replaceItemValue

public DItem replaceItemValue(java.lang.String name,
                              DDateRange value)
Replaces all items of the specified name with one new item, which is assigned the specified value.

If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

If both calendars are null, an item with an empty string is created. If only one calendar is not null, this calendar is stored as a single date value.

The milliseconds are cut off.

Specified by:
replaceItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item
Returns:
DItem
See Also:
DBaseDocument.replaceItemValue(java.lang.String, de.bea.domingo.DDateRange)

replaceItemValue

public DItem replaceItemValue(java.lang.String name,
                              java.util.TimeZone value)
Replaces all items of the specified name with one new item, which is assigned the specified value.

If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

Specified by:
replaceItemValue in interface DBaseDocument
Parameters:
name - name of an item
value - The value of the new item
Returns:
DItem
See Also:
DBaseDocument.replaceItemValue(java.lang.String, java.util.TimeZone)

getItemValueDateRange

public DDateRange getItemValueDateRange(java.lang.String name)
Returns the value of an item with two Calendar value.

If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.

If value is numeric or text, this method returns null.

If no item with the specified name exists, this method returns null. It does not throw an exception. Use hasItem to verify the existence of an item.

Specified by:
getItemValueDateRange in interface DBaseDocument
Parameters:
name - The name of the item.
Returns:
The value of the item as DDateRange or null if the item doesn't contain any date/time information.The second value may be null if only one date/time was specified.
See Also:
DBaseDocument.getItemValueDateRange(java.lang.String)

replaceItemValue

public DItem replaceItemValue(java.lang.String name,
                              java.util.Calendar calendar1,
                              java.util.Calendar calendar2)
Replaces all items of the specified name with one new item, which is assigned the specified value.

If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

If both calendars are null, an item with an empty string is created. If only one calendar is not null, this calendar is stored as a single date value.

The milliseconds are cut off.

Specified by:
replaceItemValue in interface DBaseDocument
Parameters:
name - name of an item
calendar1 - start date/time of range
calendar2 - end date/time of range
Returns:
DItem
See Also:
DBaseDocument.replaceItemValue(java.lang.String, java.util.Calendar, java.util.Calendar)

replaceHTML

public void replaceHTML(java.lang.String name,
                        java.lang.String value)
Replaces a MIMEEntity item with a new item with the given HTML code.

If the document does not contain an item with the specified name, this method creates a new MIMEEntity item and adds it to the document.

Specified by:
replaceHTML in interface DDocument
Parameters:
name - name of an item
value - HTML code for the new item
See Also:
DDocument.replaceHTML(java.lang.String, java.lang.String)

computeWithForm

public boolean computeWithForm(boolean raiseError)
Validates a document by executing the default value, translation, and validation formulas, if any are defined in the document form.

Usage

The form is as follows:

  1. The form stored in the document, if any.
  2. The value of the Form item, if no form is stored in the document.
  3. The database default form, if the document does not have a Form item.
In the user interface, you must use a form to create a document. The document must meet the form requirements for input validation, and the user interface informs you if the document does not meet these requirements. Programatically you can create a document without a form. The computeWithForm method provides a means of checking that the data you placed in a document meets the requirements of a form, although (unlike in the user interface) you can still save a document if computeWithForm returns false or throws an exception.

Specified by:
computeWithForm in interface DBaseDocument
Parameters:
raiseError - If true, an error is raised if the validation fails. If false, no error is raised; instead, the method returns false if validation fails.
Returns:
true if there are no errors in the document, else false
See Also:
DBaseDocument.computeWithForm(boolean)

computeWithForm

public boolean computeWithForm()
Validates a document by executing the default value, translation, and validation formulas, if any are defined in the document form.

Usage

The form is as follows:

  1. The form stored in the document, if any.
  2. The value of the Form item, if no form is stored in the document.
  3. The database default form, if the document does not have a Form item.
In the user interface, you must use a form to create a document. The document must meet the form requirements for input validation, and the user interface informs you if the document does not meet these requirements. Programatically you can create a document without a form. The computeWithForm method provides a means of checking that the data you placed in a document meets the requirements of a form, although (unlike in the user interface) you can still save a document if computeWithForm returns false or throws an exception.

Specified by:
computeWithForm in interface DBaseDocument
Returns:
true if there are no errors in the document, else false
See Also:
DBaseDocument.computeWithForm()

getFTSearchScore

public int getFTSearchScore()
The full-text search score of a document, if it was retrieved as part of a full-text search.

Usage

The score is determined by the number of target words that are found in the document, the term weights assigned to the target words, and any proximity operators in the search query. If the document is not retrieved as part of a full-text search, returns 0. If the document is retrieved using an FTSearch method on a database without a full-text index, returns an unpredictable number.

If a document is in more than one DocumentCollection or ViewEntryCollection, its score is that of the last collection from which it was retrieved. The score is correct unless you get the score from the current object after retrieving the same document from another collection.

Documents added to a collection have a search score of 0.

Documents deleted from a view have a search score of 0.

Specified by:
getFTSearchScore in interface DDocument
Returns:
The full-text search score of a document, if it was retrieved as part of a full-text search
See Also:
DDocument.getFTSearchScore()

getParentView

public DView getParentView()
The view from which a document was retrieved, if any.

If the document was retrieved directly from the database or a document collection, getParentView returns null.

Specified by:
getParentView in interface DDocument
Returns:
view from which a document was retrieved
See Also:
DDocument.getParentView()

getFolderReferences

public java.util.List getFolderReferences()
The names of the folders containing a document.

The database must have the hidden views $FolderInfo and $FolderRefInfo to support folder references. These views can be copied from the mail template. This property does not return view references.

Folder references must be enabled for the database. See the FolderReferencesEnabled property of Database.

Specified by:
getFolderReferences in interface DDocument
Returns:
names of the folders containing a document
See Also:
DDocument.getFolderReferences()

putInFolder

public void putInFolder(java.lang.String s)
Adds a document to a folder. If the folder does not exist, it is created.

If the document is already inside the folder you specify, putInFolder does nothing. If you specify a path to a folder, and none of the folders exists, the method creates all of them for you. For example:

doc.putInFolder( "Vehicles\\Bikes" );

If neither Vehicles nor Bikes exists, putInFolder creates both, placing the Bikes folder inside the Vehicles folder.

This method cannot add the first document to a folder that is "Shared, Personal on first use."

Specified by:
putInFolder in interface DDocument
Parameters:
s - The name of the folder in which to place the document. The folder may be personal if the program is running on a workstation. If the folder is within another folder, specify a path to it, separating folder names with backslashes. For example: "Vehicles\\Bikes"
See Also:
DDocument.putInFolder(java.lang.String)

putInFolder

public void putInFolder(java.lang.String s,
                        boolean flag)
Adds a document to a folder. If the folder does not exist, it is created.

If the document is already inside the folder you specify, putInFolder does nothing. If you specify a path to a folder, and none of the folders exists, the method creates all of them for you. For example:

doc.putInFolder( "Vehicles\\Bikes" );

If neither Vehicles nor Bikes exists, putInFolder creates both, placing the Bikes folder inside the Vehicles folder.

This method cannot add the first document to a folder that is "Shared, Personal on first use."

Specified by:
putInFolder in interface DDocument
Parameters:
s - The name of the folder in which to place the document. The folder may be personal if the program is running on a workstation. If the folder is within another folder, specify a path to it, separating folder names with backslashes. For example: "Vehicles\\Bikes"
flag - If true (default), creates the folder if it does not exist.
See Also:
DDocument.putInFolder(java.lang.String, boolean)

removeFromFolder

public void removeFromFolder(java.lang.String s)
Removes a document from a folder.

The method does nothing if the document is not in the folder you specify, or if the folder you specify does not exist.

Specified by:
removeFromFolder in interface DDocument
Parameters:
s - The name of the folder from which to remove the document. The folder may be personal if the program is running on a workstation. If the folder is within another folder, specify a path to it, separating folder names with backslashes. For example: "Vehicles\\Bikes"
See Also:
DDocument.removeFromFolder(java.lang.String)

getURL

public java.lang.String getURL()
Returns the Domino URL for its parent object.

See DSession.resolve(String) for additional information and examples.

Specified by:
getURL in interface DDocument
Returns:
Domino URL
See Also:
DDocument.getURL()

getNotesURL

public java.lang.String getNotesURL()
The Domino URL of a form when Notes protocols are in effect.

If Notes protocols are not available, this property returns an empty string.

See DSession.resolve(String) for additional information and examples.

Specified by:
getNotesURL in interface DDocument
Returns:
Domino Notes URL
See Also:
DDocument.getNotesURL()

getHttpURL

public java.lang.String getHttpURL()
The Domino URL of a form when HTTP protocols are in effect.

If HTTP protocols are not available, this property returns an empty string.

See DSession.resolve(String) for additional information and examples.

Specified by:
getHttpURL in interface DDocument
Returns:
The Domino HTTP URL
See Also:
DDocument.getHttpURL()

copyItem

public DBaseItem copyItem(DBaseItem item,
                          java.lang.String s)
Copies an item into the current document and optionally assigns the copied item a new name.

Specified by:
copyItem in interface DBaseDocument
Parameters:
item - The item, usually from another document, that you want to copy. Cannot be null.
s - The name to assign to the copied item. Specify null to retain the existing name of the item.
Returns:
A copy of the specified item parameter, identical except for its newname.
See Also:
DBaseDocument.copyItem(de.bea.domingo.DBaseItem, java.lang.String)

copyItem

public DBaseItem copyItem(DBaseItem item)
Copies an item into the current document and optionally assigns the copied item a new name.

Specified by:
copyItem in interface DBaseDocument
Parameters:
item - The item, usually from another document, that you want to copy. Cannot be null.
Returns:
A copy of the specified item parameter
See Also:
DBaseDocument.copyItem(de.bea.domingo.DBaseItem)

createReplyMessage

public DDocument createReplyMessage(boolean flag)
Creates a new document that is formatted as a reply to the current document.

The new document does not contain a Subject item. If you want one, the program must explicitly add it to the document.

The new document does not automatically get mailed. If you want to mail it, the program must explicitly call the send method.

Specified by:
createReplyMessage in interface DBaseDocument
Parameters:
flag - If true, the new document recipient list contains all the recipients of the original. If false, the new document recipient list contains only the sender of the original.
Returns:
A reply to the current document.
See Also:
DBaseDocument.createReplyMessage(boolean)

encrypt

public void encrypt()
Encrypts a document.

The encrypted document is not saved until you call save. Only the items for which isEncrypted is true are encrypted. Items for which isEncrypted is false remain visible to any user, even if the user does not have the proper encryption key.

If the EncryptionKeys property is set with one or more named keys, those keys are used to encrypt the document. Any user who has one of the encryption keys can decrypt the document. If there are no encryption keys specified, the document is encrypted with the user's public key, in which case only the user who encrypted the document can decrypt it.

If the program is running on a server, it must have permission to use Encrypt.

Since mail encryption works differently, do not use this method if you want to mail an encrypted document. Instead, set the EncryptOnSend property to true, and use the send method.

You cannot use the encrypt method on a Document object returned by getDocumentContext.

Specified by:
encrypt in interface DBaseDocument
See Also:
DBaseDocument.encrypt()

getColumnValues

public java.util.List getColumnValues()
A list of values, each element of which corresponds to a column value in the document's parent view. The first value in the vector is the value that appears in the view's first column for the document, the second value is the one that appears in the second column, and so on. The value of each element of the vector is the result of the corresponding column's formula and the items on the current document. Some elements in the vector might have no value.

Specified by:
getColumnValues in interface DBaseDocument
Returns:
column values
See Also:
DBaseDocument.getColumnValues()

getEncryptionKeys

public java.util.List getEncryptionKeys()
Returns the key(s) used to encrypt a document. The encrypt method uses these keys when it encrypts the document.

Each element in EncryptionKeys contains the name of an encryption key that you want to use to encrypt the document. The document can be decrypted by any user who posesses one of the keys. If there are no encryption keys specified for a document, the document is encrypted with the current user's public key and can only be decrypted by that user.

You must call the encrypt and save methods to actually encrypt the document. Since encryption works differently when a document is mailed, the EncryptionKeys property has no effect when a document is encrypted when mailed.

The name of each encryption key in a document is stored in a text item called SecretEncryptionKeys. This property returns the contents of the item.

Specified by:
getEncryptionKeys in interface DBaseDocument
Returns:
the key(s) used to encrypt a document
See Also:
DBaseDocument.getEncryptionKeys()

setEncryptionKeys

public void setEncryptionKeys(java.util.List keys)
Sets the key(s) used to encrypt a document. The encrypt method uses these keys when it encrypts the document.

Specified by:
setEncryptionKeys in interface DBaseDocument
Parameters:
keys - the key(s) used to encrypt a document
See Also:
DBaseDocument.setEncryptionKeys(java.util.List)

getItemValueCustomData

public java.lang.Object getItemValueCustomData(java.lang.String name)
Returns as an object the value of an item containing custom data.

Specified by:
getItemValueCustomData in interface DBaseDocument
Parameters:
name - The name of the item.
Returns:
An object that receives the value of the item. Must have the same class definition as the object written to the item.
See Also:
DBaseDocument.getItemValueCustomData(java.lang.String)

getItemValueCustomData

public java.lang.Object getItemValueCustomData(java.lang.String name,
                                               java.lang.String dataTypeName)
Returns as an object the value of an item containing custom data.

Specified by:
getItemValueCustomData in interface DBaseDocument
Parameters:
name - The name of the item.
dataTypeName - The name of the data type. If specified, this name must match the data type name specified when the item was written. If omitted, no name checking occurs
Returns:
An object that receives the value of the item. Must have the same class definition as the object written to the item.
See Also:
DBaseDocument.getItemValueCustomData(java.lang.String, java.lang.String)

getItemValueCustomDataBytes

public byte[] getItemValueCustomDataBytes(java.lang.String name,
                                          java.lang.String dataTypeName)
Returns as a byte array the value of an item containing custom data.

Specified by:
getItemValueCustomDataBytes in interface DBaseDocument
Parameters:
name - The name of the item.
dataTypeName - The name of the data type. If specified, this name must match the data type name specified when the item was written. If omitted, no name checking occurs
Returns:
Array of type Byte. The value of the item.
See Also:
DBaseDocument.getItemValueCustomDataBytes(java.lang.String, java.lang.String)

getItemValueDateTimeArray

public java.util.List getItemValueDateTimeArray(java.lang.String name)
Returns the value of a date-time item in a document.

Specified by:
getItemValueDateTimeArray in interface DBaseDocument
Parameters:
name - The name of the item.
Returns:
The value or values contained in the item. Each element in the vector corresponds to a value in the item and is of type DateTime or DateRange. If the item contains a single value, the vector has one element.
See Also:
DBaseDocument.getItemValueDateTimeArray(java.lang.String)

getSigner

public java.lang.String getSigner()
The name of the person who created the signature, if a document is signed.

If a document is not signed, returns an empty string.

If the signer is not trusted, returns an empty string.

Specified by:
getSigner in interface DBaseDocument
Returns:
the signer
See Also:
DBaseDocument.getSigner()

getSize

public int getSize()
The size of a database, in bytes.

Specified by:
getSize in interface DBaseDocument
Returns:
size of a database, in bytes
See Also:
DBaseDocument.getSize()

setUniversalID

public void setUniversalID(java.lang.String unid)
The universal ID, which uniquely identifies a document across all replicas of a database. In character format, the universal ID is a 32-character combination of hexadecimal digits (0-9, A-F).

If two documents in replica databases share the same universal ID, the documents are replicas.

If you modify the UNID of an existing document, it becomes a new document.

Saving a document with the same UNID as an existing document an exception.

Specified by:
setUniversalID in interface DBaseDocument
Parameters:
unid - The universal ID is also known as the unique ID or UNID.
See Also:
DBaseDocument.setUniversalID(java.lang.String)

getVerifier

public java.lang.String getVerifier()
The name of the certificate that verified a signature, if a document is signed.

This property is an empty string if the document is not signed.

This property is an empty string if the signer is not trusted.

Specified by:
getVerifier in interface DBaseDocument
Returns:
name of the certificate that verified a signature
See Also:
DBaseDocument.getVerifier()

hasEmbedded

public boolean hasEmbedded()
Indicates whether a document contains one or more embedded objects, object links, or file attachments.

Note Embedded objects and object links are not supported for OS/2, UNIX, and the Macintosh. File attachments are.

Specified by:
hasEmbedded in interface DBaseDocument
Returns:
true if the document contains one or more embedded objects, object links, or file attachments , else false
See Also:
DBaseDocument.hasEmbedded()

isEncrypted

public boolean isEncrypted()
Indicates whether a document is encrypted.

Specified by:
isEncrypted in interface DBaseDocument
Returns:
true if the document is encrypted, else false
See Also:
DBaseDocument.isEncrypted()

isEncryptOnSend

public boolean isEncryptOnSend()
Indicates whether a document is encrypted when mailed.

Specified by:
isEncryptOnSend in interface DBaseDocument
Returns:
true if the document is encrypted when mailed, else false
See Also:
DBaseDocument.isEncryptOnSend()

isProfile

public boolean isProfile()
Indicates whether a Document object is a profile document.

Specified by:
isProfile in interface DBaseDocument
Returns:
true if the document is a profile document, else false
See Also:
DBaseDocument.isProfile()

isSigned

public boolean isSigned()
Indicates whether a document contains a signature.

Specified by:
isSigned in interface DBaseDocument
Returns:
true if the document contains one or more signatures, else false
See Also:
DBaseDocument.isSigned()

isValid

public boolean isValid()
Indicates whether a Document object represents an existing document (not a deletion stub) initially.

Specified by:
isValid in interface DBaseDocument
Returns:
true if the document represents an existing document, else false
See Also:
DBaseDocument.isValid()

isSaveMessageOnSend

public boolean isSaveMessageOnSend()
Indicates whether a document is saved to a database when mailed. Applies only to new documents that have not yet been saved.

Specified by:
isSaveMessageOnSend in interface DBaseDocument
Returns:
true if the document is saved when mailed, else false
See Also:
DBaseDocument.isSaveMessageOnSend()

isSentByAgent

public boolean isSentByAgent()
Indicates whether a document was mailed by a Domino program.

Specified by:
isSentByAgent in interface DBaseDocument
Returns:
true if the document was mailed by a program, else false
See Also:
DBaseDocument.isSentByAgent()

isSignOnSend

public boolean isSignOnSend()
Indicates whether a document is signed when mailed.

Specified by:
isSignOnSend in interface DBaseDocument
Returns:
true if the document is signed when mailed, else false
See Also:
DBaseDocument.isSignOnSend()

isDeleted

public boolean isDeleted()
Indicates whether a Document object represents an existing document (not a deletion stub) on an ongoing basis.

Specified by:
isDeleted in interface DBaseDocument
Returns:
true if the document is a deletion stub false if the document exists
See Also:
DBaseDocument.isDeleted()

removePermanently

public boolean removePermanently(boolean flag)
Permanently deletes a document from a database, doing a hard deletion even if soft deletions are enabled.

This method does a hard deletion even if "Allow soft deletions" is enabled. See remove to do a soft deletion.

If you access a NotesDocument object through the Document property of NotesUIDocument, you can't delete the back-end document. If you could, the UI rendition would have no basis. You must access the document strictly through the back-end.

A deleted document cannot be used as a basis for navigation in a view or a document collection.

You cannot use the remove method on a Document object returned by DAgentContext.getDocumentContext().

Specified by:
removePermanently in interface DBaseDocument
Parameters:
flag - If true, the document is deleted even if another user modifies the document after the program opens it. If false, the document is not deleted if another user modifies it.
Returns:
true if the document is successfully deleted, false if the document is not deleted, because another user modified it and the force parameter is set to false
See Also:
DBaseDocument.removePermanently(boolean)

renderToRTItem

public boolean renderToRTItem(DRichTextItem richtextitem)
Creates a picture of a document and places it into a rich-text item that you specify.

The picture is created using both the document and its form. Therefore, the input translation and validation formulas of the form are executed.

If the target rich text item is in a new document, you must save the document before calling renderToRTItem.

Specified by:
renderToRTItem in interface DBaseDocument
Parameters:
richtextitem - The destination for the picture. Cannot be null.
Returns:
If true, the method is successful. If false, the method is not successful and the rich text item remains unchanged. This can happen if an input validation formula fails on the document form.
See Also:
DBaseDocument.renderToRTItem(de.bea.domingo.DRichTextItem)

replaceItemValueCustomData

public DItem replaceItemValueCustomData(java.lang.String s,
                                        java.lang.String s1,
                                        java.lang.Object obj)
Replaces all items of the specified name with one new item, which is assigned custom data from a byte array. If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

Specified by:
replaceItemValueCustomData in interface DBaseDocument
Parameters:
s - the name of the item
s1 - name for the data type. When getting custom data, use this name for verification.
obj - object that contains the custom data. The class that defines this object must implement Serializable. If desired, you can override readObject and writeObject.
Returns:
DItem
See Also:
DBaseDocument.replaceItemValueCustomData(java.lang.String, java.lang.String, java.lang.Object)

replaceItemValueCustomData

public DItem replaceItemValueCustomData(java.lang.String s,
                                        java.lang.Object obj)
Replaces all items of the specified name with one new item, which is assigned custom data from a byte array. If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

Specified by:
replaceItemValueCustomData in interface DBaseDocument
Parameters:
s - the name of the item
obj - object that contains the custom data. The class that defines this object must implement Serializable. If desired, you can override readObject and writeObject.
Returns:
DItem
See Also:
DBaseDocument.replaceItemValueCustomData(java.lang.String, java.lang.Object)

replaceItemValueCustomDataBytes

public DItem replaceItemValueCustomDataBytes(java.lang.String s,
                                             java.lang.String s1,
                                             byte[] abyte0)
Replaces all items of the specified name with one new item, which is assigned custom data from a byte array. If the document does not contain an item with the specified name, this method creates a new item and adds it to the document.

Specified by:
replaceItemValueCustomDataBytes in interface DBaseDocument
Parameters:
s - the name of the item
s1 - name for the data type. When getting custom data, use this name for verification.
abyte0 - byte array that contains the custom data
Returns:
DItem
See Also:
DBaseDocument.replaceItemValueCustomDataBytes(java.lang.String, java.lang.String, byte[])

generateXML

public java.lang.String generateXML()
Generates an XML representation of a document to the Writer. The XML conforms to the Domino Document DTD.

This method takes the same arguments as the transformXML method in EmbeddedObject, Item, MIMEEntity, and RichTextItem. The transformXML method reads the XML from an item, attachment, MIMEEntity, or rich text item and transforms the XML. The generateXML method generates the XML from the document and then transforms it.

The generateXML method supports the following simple items: Text, Text list, Number, Number list, Datetime, Datetime list

To generate form semantics, you must call computeWithForm method before calling the generateXML method.

Specified by:
generateXML in interface DBaseDocument
Returns:
The XML representation of the document.
See Also:
DBaseDocument.generateXML()

generateXML

public void generateXML(java.io.Writer writer)
Generates an XML representation of a document to the Writer. The XML conforms to the Domino Document DTD.

This method takes the same arguments as the transformXML method in EmbeddedObject, Item, MIMEEntity, and RichTextItem. The transformXML method reads the XML from an item, attachment, MIMEEntity, or rich text item and transforms the XML. The generateXML method generates the XML from the document and then transforms it.

The generateXML method supports the following simple items: Text, Text list, Number, Number list, Datetime, Datetime list

To generate form semantics, you must call computeWithForm method before calling the generateXML method.

Specified by:
generateXML in interface DBaseDocument
Parameters:
writer - The Writer that will receive the result XML.
See Also:
DBaseDocument.generateXML(java.io.Writer)

getReceivedItemText

public java.util.List getReceivedItemText()
Gets the text values of the Received items in a mail document.

This method applies to Received items generated from an Internet mail message. The items can be in MIME or Notes format.

If the document has no Received items, this method returns a vector of one element whose value is an empty string.

A Received item with an incorrect format (not an Internet mail message) throws an exception.

Specified by:
getReceivedItemText in interface DBaseDocument
Returns:
List of strings. The text values of the Received items, one item per element.
See Also:
DBaseDocument.getReceivedItemText()

getLockHolders

public java.util.List getLockHolders()
The names of the holders of a lock.

If the document is locked, the vector contains the names of the lock holders. The document can be locked by one or more users or groups.

If the document is not locked, the vector contains one element whose value is an empty string ("").

Specified by:
getLockHolders in interface DBaseDocument
Returns:
names of the holders of a lock.
See Also:
DBaseDocument.getLockHolders()

lock

public boolean lock()
Locks a document.

Specified by:
lock in interface DBaseDocument
Returns:
true if the lock is placed, false if the lock is not placed
See Also:
DBaseDocument.lock()

lock

public boolean lock(boolean provisionalOk)
Locks a document.

Specified by:
lock in interface DBaseDocument
Parameters:
provisionalOk - true to permit the placement of a provisional lock, false (default) to not permit a provisional lock
Returns:
true if the lock is placed, false if the lock is not placed
See Also:
DBaseDocument.lock(boolean)

lock

public boolean lock(java.lang.String name)
Locks a document.

Specified by:
lock in interface DBaseDocument
Parameters:
name - the name of the lock holder
Returns:
true if the lock is placed, false if the lock is not placed
See Also:
DBaseDocument.lock(java.lang.String)

lock

public boolean lock(java.lang.String name,
                    boolean provisionalOk)
Locks a document.

Specified by:
lock in interface DBaseDocument
Parameters:
name - the name of the lock holder
provisionalOk - true to permit the placement of a provisional lock, false (default) to not permit a provisional lock
Returns:
true if the lock is placed, false if the lock is not placed
See Also:
DBaseDocument.lock(java.lang.String, boolean)

lock

public boolean lock(java.util.List names)
Locks a document.

Specified by:
lock in interface DBaseDocument
Parameters:
names - the names of the lock holders
Returns:
true if the lock is placed, false if the lock is not placed
See Also:
DBaseDocument.lock(java.util.List)

lock

public boolean lock(java.util.List names,
                    boolean provisionalOk)
Locks a document.

IsDocumentLockingEnabled in Database must be true or this method throws an exception.

This method:

The following actions occur depending on the current lock status:

If the document is modified by another user before the lock can be placed, this method throws an exception.

Specified by:
lock in interface DBaseDocument
Parameters:
names - The names of the lock holders. Each lock holder must be a user or group. Defaults to one lock holder: the effective user. The empty string ("") is not permitted.
provisionalOk - true to permit the placement of a provisional lock, false (default) to not permit a provisional lock
Returns:
true if the lock is placed, false if the lock is not placed
See Also:
DBaseDocument.lock(java.util.List, boolean)

lockProvisional

public boolean lockProvisional()
Locks a document provisionally.

Specified by:
lockProvisional in interface DBaseDocument
Returns:
true if the lock is placed, false if the lock is not placed
See Also:
DBaseDocument.lockProvisional()

lockProvisional

public boolean lockProvisional(java.lang.String name)
Locks a document provisionally.

Specified by:
lockProvisional in interface DBaseDocument
Parameters:
name - The name of the lock holders. The lock holder must be a user or group. Defaults to the effective user. The empty string ("") is not permitted.
Returns:
true if the lock is placed, false if the lock is not placed
See Also:
DBaseDocument.lockProvisional(java.lang.String)

lockProvisional

public boolean lockProvisional(java.util.List names)
Locks a document provisionally.

Specified by:
lockProvisional in interface DBaseDocument
Parameters:
names - The names of the lock holders. Each lock holder must be a user or group. Defaults to one lock holder: the effective user. The empty string ("") is not permitted.
Returns:
true if the lock is placed, false if the lock is not placed
See Also:
DBaseDocument.lockProvisional(java.util.List)

unlock

public void unlock()
Unlocks a document.

DDatabase.isDocumentLockingEnabled() in Database must be true or this method throws an exception. This method throws an exception if the current user is not one of the lock holders and does not have lock breaking authority.

Specified by:
unlock in interface DBaseDocument
See Also:
DBaseDocument.unlock()


Domingo Java-API