Document (Java)

Represents a document in a database.

Syntax

public class Document extends Base

Containment

Contained by: Database, DocumentCollection, Newsletter, View

Contains: DateTime, EmbeddedObject, Item, MimeEntity, RichTextItem

Properties

Authors through getAuthors

ColumnValues through getColumnValues

Created through getCreated

EmbeddedObjects through getEmbeddedObjects

EncryptionKeys through getEncryptionKeys and setEncryptionKeys

FolderReferences through getFolderReferences

FTSearchScore through getFTSearchScore

HasEmbedded through hasEmbedded

HttpURL through getHttpURL

IsDeleted through isDeleted

IsEncrypted through isEncrypted

IsEncryptOnSend through isEncryptOnSend and setEncryptOnSend

IsNewNote through isNewNote

IsProfile through isProfile

IsResponse through isResponse

IsSaveMessageOnSend through isSaveMessageOnSend and setSaveMessageOnSend

IsSentByAgent through isSentByAgent

IsSigned through isSigned

IsSignOnSend through isSignOnSend and setSignOnSend

IsValid through isValid

Items through getItems

Key through getKey

LastAccessed through getLastAccessed

LastModified through getLastModified

LockHolders through getLockHolders

NameOfProfile through getNameOfProfile

NoteID through getNoteID

NotesURL through getNotesURL

ParentDatabase through getParentDatabase

ParentDocumentUNID through getParentDocumentUNID

ParentView through getParentView

Responses through getResponses

Signer through getSigner

Size through getSize

UniversalID through getUniversalID and setUniversalID

Verifier through getVerifier

Methods

appendItemValue

attachVCard

closeMIMEEntities

computeWithForm

convertToMIME

copyAllItems

copyItem

copyToDatabase

createMIMEEntity

createReplyMessage

createRichTextItem

encrypt

generateXML

getAttachment

getFirstItem

getItemValue

getItemValueCustomData

getItemValueCustomDataBytes

getItemValueDateTimeArray

getItemValueDouble

getItemValueInteger

getItemValueString

getMIMEEntity

getRead method

getReceivedItemText

getURL

hasItem

lock

lockProvisional

makeResponse

markRead

markUnread

putInFolder

recycle

remove

removeFromFolder

removeItem

removePermanently

renderToRTItem

replaceItemValue

replaceItemValueCustomData

replaceItemValueCustomDataBytes

save

send

Sign

toString

unlock

Creation

To create a new Document object, use createDocument in Database.

Access

To access existing documents:

  • To get all the documents in a database, use getAllDocuments in Database.
  • To get a document based on its position in a view, use a View object.
  • To get a document based on its position in a response hierarchy, use a View object. To get all documents that are responses to a particular document, use getResponses in Document. To get a response document's parent document, use getParentDocumentUNID in Document followed by getDocumentByUNID in Database.
  • To get all the documents that match a full-text search query, use FTSearch in Database or FTSearch in View.
  • To get all the documents in a database that meet search criteria, where the criteria are defined using the formula language, use search in Database.
  • To get documents in a database not yet processed by the current agent, use getUnprocessedDocuments, unprocessedFTSearch, and unprocessedSearch in AgentContext.
  • To get a document based on its note ID or UNID, use getDocumentByID or getDocumentByUNID in Database.

Once you have a view, you can navigate to a specific document using methods in the View class.

Once you have a collection of documents, you can navigate to a specific document using methods in the DocumentCollection class.

Saving changes

After you create, modify, or delete a document, you must save the changes by calling the save method. If you don't call save before the program finishes, all of your changes to a Document are lost.

If you create and save a new document without adding any items to it, the document is saved with one item "$UpdatedBy." This item contains the name of the creator of the document.

Encryption

A program attempts to decrypt an encrypted document the first time the program accesses one of the Document properties or methods. If decryption fails, an exception is thrown.

Language cross-reference

MailSend @command of formula language

Example