|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.xsp.model.domino.wrapped.DominoDocument
public class DominoDocument
NotesXspDocument represents a Domino Document in XPages
Nested Class Summary | |
---|---|
static class |
DominoDocument.AttachmentValueHolder
Stores information about an attachment to a field and the operation performed on that attachment. |
class |
DominoDocument.FieldValueHolder
Stores information about a field (a Domino Item proxy) and the operation performed on that field. |
static class |
DominoDocument.JsonDocument
Experimental JSON support (DO NOT USE) |
static class |
DominoDocument.XmlDocument
Experimental XML support (DO NOT USE) |
Constructor Summary | |
---|---|
DominoDocument()
This method is provided for object serialization/deserialization and should only be used for those purposes. |
Method Summary | |
---|---|
protected lotus.domino.Document |
_getDocument()
|
protected lotus.domino.Document |
_getDocument(boolean applyChanges)
|
lotus.domino.Document |
_getValidDocument()
|
void |
afterDeserializing(com.ibm.xsp.model.domino.DominoDocumentDataContainer container)
Serialization mechanism. |
void |
beforeSerializing()
Serialization mechanism. |
void |
checkDocumentValidity()
Check if the document is still valid as an action might have deleted it |
void |
closeMIMEEntities(boolean persist,
java.lang.String fieldName)
If the fieldName is a RichTextItem - close the MIME Entities for the field |
void |
discardWrappedObject()
Discards the wrapped Document. |
java.lang.Object |
getAttachmentAsJson(java.lang.String fieldName,
java.lang.String attachmentName)
|
java.lang.Object |
getAttachmentAsJson(java.lang.String fieldName,
java.lang.String attachmentName,
boolean readOnly)
Gets the content of a field attachment as an in memory JSON object. |
java.lang.Object |
getAttachmentAsJson(java.lang.String fieldName,
java.lang.String attachmentName,
boolean readOnly,
JsonFactory jsonFactory)
|
org.w3c.dom.Document |
getAttachmentAsXML(java.lang.String fieldName,
java.lang.String attachmentName,
boolean readOnly)
Gets the content of a field attachment as an in memory XML Document. |
java.util.List<FileRowData> |
getAttachmentList(java.lang.String fieldName)
Get the list of attachments for the field specified |
java.util.Map<java.lang.String,DominoDocument.FieldValueHolder> |
getChangedFields()
Return list of changed fields |
java.lang.String |
getComputeWithFormNamed()
Return the Form name for ComputeWithForm |
java.lang.String |
getDBName()
Return the name of Database that stores the Document |
static JsonFactory |
getDefaultJsonFactory()
Return the default factory as used by DominoDocument. |
lotus.domino.Document |
getDocument()
Return the wrapped Document |
lotus.domino.Document |
getDocument(boolean applyChanges)
Return the wrapped document |
java.lang.String |
getDocumentId()
Return the Note Id |
java.util.List<FileRowData> |
getEmbeddedImagesList(java.lang.String fieldName)
Return the List of images attached to this Document |
java.lang.Object |
getFieldAsJson(java.lang.String fieldName)
DO NOT USE |
java.lang.Object |
getFieldAsJson(java.lang.String fieldName,
boolean readOnly)
DO NOT USE |
java.lang.Object |
getFieldAsJson(java.lang.String fieldName,
boolean readOnly,
JsonFactory jsonFactory)
|
java.lang.Object |
getFieldAsJson(java.lang.String fieldName,
JsonFactory jsonFactory)
|
org.w3c.dom.Document |
getFieldAsXml(java.lang.String fieldName)
DO NOT USE |
org.w3c.dom.Document |
getFieldAsXml(java.lang.String fieldName,
boolean readOnly)
DO NOT USE |
java.lang.String |
getForm()
Get the name of the Form associated with this Document |
java.util.Vector |
getItemValue(java.lang.String name)
Return the value(s) stored in the field name |
com.ibm.jscript.std.ArrayObject |
getItemValueArray(java.lang.String name)
Return the value(s) for a field name as an Array |
java.util.Date |
getItemValueDate(java.lang.String name)
Return the value stored in field name as a Date
Returns null if the field is not a DataTime. |
lotus.domino.DateTime |
getItemValueDateTime(java.lang.String name)
Return the values stored in field name as a DateTime
Returns null if the field is not a number. |
double |
getItemValueDouble(java.lang.String name)
Return the values stored in field name as a double
Returns 0 if the field is not a number. |
int |
getItemValueInteger(java.lang.String name)
Return the values stored in field name as an int
Returns 0 if the fields is not a number. |
java.lang.String |
getItemValueString(java.lang.String name)
Returns the value stored in field name as a String. |
java.lang.String |
getNoteID()
Return the Note Id |
lotus.domino.Database |
getParentDatabase()
Return the Database that stores the Document |
java.lang.String |
getParentDatabaseFileName()
Return the File Path for the Database that stores the Document |
java.lang.String |
getParentId()
Return the parent id of the Document |
java.lang.String |
getPersistenceFolder(java.lang.String fieldName)
Get the Folder name for persistence data in the form DominoDoc-[9999]-[filedName] |
DominoRichTextItem |
getRichTextItem(java.lang.String fieldName)
Get the RichTextItem for this field. |
java.lang.String |
getSaveLinksAs()
Save links in the document as HTTP:(UseWeb) or NOTES:(UseNotes) |
java.lang.Class |
getType(java.lang.Object key)
Return the data type of the specified key |
lotus.domino.Document |
getValidDocument()
Check if the document is valid and the we return it else, return a null pointer in that case |
java.lang.Object |
getValue(java.lang.Object fieldName)
Return the value of the Item named fieldName . |
boolean |
hasItem(java.lang.String fieldName)
Return true if the document has a field fieldName |
boolean |
isAllowDeletedDocs()
Return true if deleted documents are allowed. |
boolean |
isEditable()
Returns true if the document is editable |
boolean |
isNewNote()
Return true if the Document is a new Document |
boolean |
isReadOnly(java.lang.Object key)
Indicate whether this Document is ReadOnly or is Editable |
boolean |
isResponse()
Return true if the Document is a response Document |
void |
recycle()
Recycle. |
void |
removeAllAttachments(java.lang.String fieldName)
Remove all attachement from the specified field |
boolean |
removeAttachment(java.lang.String fieldName,
java.lang.String attachmentName)
Remove an attachment associated with a field |
void |
removeItem(java.lang.String fieldName)
Removes the item fieldName from the document |
void |
replaceItemValue(java.lang.String fieldName,
java.lang.Object value)
Replace the current value of item fieldName in the document
with value |
void |
restoreWrappedDocument()
Restore the wrapped document from the Database. |
boolean |
save()
Save any changes to the Document (and compute any fields, if required) |
void |
setAllowDeletedDocs(boolean deletedDocs)
Set whether Document is allowed deleted documents |
void |
setDocument(lotus.domino.Document document)
Set this document to be the wrapped document |
void |
setEditable(boolean isEditable)
Set true the document can be edited |
void |
setRichTextItem(java.lang.String fieldName,
DominoRichTextItem drti)
Add this field name and its RichTextItem value o the list of RichTextsItems |
void |
setValue(java.lang.Object fieldName,
java.lang.Object value)
DataObject setValue implementation. |
static DominoDocument |
wrap(java.lang.String database,
lotus.domino.Database db,
java.lang.String parentId,
java.lang.String form,
java.lang.String computeWithForm,
java.lang.String concurrencyMode,
boolean allowDeletedDocs,
java.lang.String saveLinksAs)
Deprecated. |
static DominoDocument |
wrap(java.lang.String database,
lotus.domino.Database db,
java.lang.String parentId,
java.lang.String form,
java.lang.String computeWithForm,
java.lang.String concurrencyMode,
boolean allowDeletedDocs,
java.lang.String saveLinksAs,
java.lang.String webQuerySaveAgent)
Create a new DominoDocument(NotesXspDocument) that wraps a lotus.domino.document. |
static DominoDocument |
wrap(java.lang.String database,
lotus.domino.Document document,
java.lang.String computeWithForm,
java.lang.String concurrencyMode,
boolean allowDeletedDocs,
java.lang.String saveLinksAs)
Deprecated. |
static DominoDocument |
wrap(java.lang.String database,
lotus.domino.Document document,
java.lang.String computeWithForm,
java.lang.String concurrencyMode,
boolean allowDeletedDocs,
java.lang.String saveLinksAs,
java.lang.String webQuerySaveAgent)
Create a new DominoDocument(NotesXspDocument) that wraps a lotus.domino.document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DominoDocument()
Method Detail |
---|
public static DominoDocument wrap(java.lang.String database, lotus.domino.Document document, java.lang.String computeWithForm, java.lang.String concurrencyMode, boolean allowDeletedDocs, java.lang.String saveLinksAs, java.lang.String webQuerySaveAgent)
database
- document
- computeWithForm
- concurrencyMode
- allowDeletedDocs
- saveLinksAs
- Save links in the document as HTTP:(UseWeb) or NOTES:(UseNotes)
public static DominoDocument wrap(java.lang.String database, lotus.domino.Document document, java.lang.String computeWithForm, java.lang.String concurrencyMode, boolean allowDeletedDocs, java.lang.String saveLinksAs)
public static DominoDocument wrap(java.lang.String database, lotus.domino.Database db, java.lang.String parentId, java.lang.String form, java.lang.String computeWithForm, java.lang.String concurrencyMode, boolean allowDeletedDocs, java.lang.String saveLinksAs, java.lang.String webQuerySaveAgent)
database
- db
- parentId
- form
- computeWithForm
- concurrencyMode
- allowDeletedDocs
- saveLinksAs
-
public static DominoDocument wrap(java.lang.String database, lotus.domino.Database db, java.lang.String parentId, java.lang.String form, java.lang.String computeWithForm, java.lang.String concurrencyMode, boolean allowDeletedDocs, java.lang.String saveLinksAs)
public java.lang.String getPersistenceFolder(java.lang.String fieldName)
fieldName
-
public java.lang.String getDBName()
public java.lang.String getComputeWithFormNamed()
public boolean isAllowDeletedDocs()
true
if deleted documents are allowed.
true
if deleted documents are allowedpublic java.lang.String getSaveLinksAs()
public void setAllowDeletedDocs(boolean deletedDocs)
deletedDocs
- public lotus.domino.Document getDocument()
protected lotus.domino.Document _getDocument()
public final lotus.domino.Document getValidDocument() throws lotus.domino.NotesException
lotus.domino.NotesException
public final lotus.domino.Document _getValidDocument() throws lotus.domino.NotesException
lotus.domino.NotesException
public void checkDocumentValidity()
public void setDocument(lotus.domino.Document document)
document
- public lotus.domino.Document getDocument(boolean applyChanges) throws lotus.domino.NotesException
applyChanges
- Apply any changes to the wrapped document before returning it
lotus.domino.NotesException
protected lotus.domino.Document _getDocument(boolean applyChanges) throws lotus.domino.NotesException
lotus.domino.NotesException
public void restoreWrappedDocument()
public void recycle() throws lotus.domino.NotesException
lotus.domino.NotesException
public void discardWrappedObject()
public void closeMIMEEntities(boolean persist, java.lang.String fieldName) throws lotus.domino.NotesException
persist
- fieldName
-
lotus.domino.NotesException
public java.lang.String getForm() throws lotus.domino.NotesException
lotus.domino.NotesException
public boolean isEditable()
public void setEditable(boolean isEditable)
isEditable
- public java.lang.String getParentId()
public java.util.Vector getItemValue(java.lang.String name) throws lotus.domino.NotesException
name
lotus.domino.NotesException
public com.ibm.jscript.std.ArrayObject getItemValueArray(java.lang.String name) throws lotus.domino.NotesException, com.ibm.jscript.InterpretException
name
as an Array
lotus.domino.NotesException
com.ibm.jscript.InterpretException
public java.lang.String getItemValueString(java.lang.String name) throws lotus.domino.NotesException
name
as a String. If it is a multi-valued
field, only the first values is returned. If it is a RichTextField, then contents
are returned as text.
lotus.domino.NotesException
public int getItemValueInteger(java.lang.String name) throws lotus.domino.NotesException
name
as an int
Returns 0 if the fields is not a number.
lotus.domino.NotesException
public double getItemValueDouble(java.lang.String name) throws lotus.domino.NotesException
name
as a double
Returns 0 if the field is not a number.
lotus.domino.NotesException
public lotus.domino.DateTime getItemValueDateTime(java.lang.String name) throws lotus.domino.NotesException
name
as a DateTime
Returns null
if the field is not a number.
lotus.domino.NotesException
public java.util.Date getItemValueDate(java.lang.String name) throws lotus.domino.NotesException
name
as a Date
Returns null
if the field is not a DataTime.
lotus.domino.NotesException
public java.lang.String getNoteID() throws lotus.domino.NotesException
lotus.domino.NotesException
public java.lang.String getDocumentId()
public lotus.domino.Database getParentDatabase() throws lotus.domino.NotesException
lotus.domino.NotesException
public java.lang.String getParentDatabaseFileName() throws lotus.domino.NotesException
lotus.domino.NotesException
public boolean hasItem(java.lang.String fieldName) throws lotus.domino.NotesException
true
if the document has a field fieldName
lotus.domino.NotesException
public boolean isNewNote() throws lotus.domino.NotesException
true
if the Document is a new Document
lotus.domino.NotesException
public boolean isResponse() throws lotus.domino.NotesException
true
if the Document is a response Document
lotus.domino.NotesException
public void removeItem(java.lang.String fieldName) throws lotus.domino.NotesException
fieldName
from the document
lotus.domino.NotesException
public void replaceItemValue(java.lang.String fieldName, java.lang.Object value) throws lotus.domino.NotesException
fieldName
in the document
with value
lotus.domino.NotesException
public boolean save() throws lotus.domino.NotesException
lotus.domino.NotesException
public java.lang.Object getValue(java.lang.Object fieldName)
fieldName
. What is returned
depends on the datatype of the fields. Could be a String value, or an MIME
entity if the item is a RichTextItem.
getValue
in interface DataObject
fieldName
- key whose associated value is to be returned.
public java.lang.Class getType(java.lang.Object key)
key
getType
in interface DataObject
key
- key with which the specified value is to be associated.
public void setValue(java.lang.Object fieldName, java.lang.Object value)
setValue
in interface DataObject
fieldName
- key with which the specified value is to be associated.value
- value to be associated with the specified key.public boolean isReadOnly(java.lang.Object key)
isReadOnly
in interface DataObject
key
- key of the specified value to be tested.
public java.util.Map<java.lang.String,DominoDocument.FieldValueHolder> getChangedFields()
public java.util.List<FileRowData> getAttachmentList(java.lang.String fieldName) throws lotus.domino.NotesException
lotus.domino.NotesException
public java.util.List<FileRowData> getEmbeddedImagesList(java.lang.String fieldName) throws lotus.domino.NotesException
lotus.domino.NotesException
public boolean removeAttachment(java.lang.String fieldName, java.lang.String attachmentName) throws lotus.domino.NotesException
lotus.domino.NotesException
public void removeAllAttachments(java.lang.String fieldName) throws lotus.domino.NotesException
lotus.domino.NotesException
public DominoRichTextItem getRichTextItem(java.lang.String fieldName)
null
if the
field is not a RichTextItem
fieldName
-
public void setRichTextItem(java.lang.String fieldName, DominoRichTextItem drti)
fieldName
- drti
- public void beforeSerializing()
public void afterDeserializing(com.ibm.xsp.model.domino.DominoDocumentDataContainer container)
public static JsonFactory getDefaultJsonFactory()
public java.lang.Object getFieldAsJson(java.lang.String fieldName, boolean readOnly) throws lotus.domino.NotesException, JsonException, java.io.IOException
DO NOT USE
Gets the content of a field as an in memory JSON object.
fieldName
- the field that contains the XML as textreadOnly
- indicates if the document is readonly. If so, the changes are not saved back with the document.
lotus.domino.NotesException
JsonException
java.io.IOException
public java.lang.Object getFieldAsJson(java.lang.String fieldName, boolean readOnly, JsonFactory jsonFactory) throws lotus.domino.NotesException, JsonException, java.io.IOException
lotus.domino.NotesException
JsonException
java.io.IOException
public java.lang.Object getFieldAsJson(java.lang.String fieldName) throws lotus.domino.NotesException, JsonException, java.io.IOException
DO NOT USE
Gets the content of a field as an in memory JSON object.
fieldName
- the field that contains the XML as text
lotus.domino.NotesException
JsonException
java.io.IOException
public java.lang.Object getFieldAsJson(java.lang.String fieldName, JsonFactory jsonFactory) throws lotus.domino.NotesException, JsonException, java.io.IOException
lotus.domino.NotesException
JsonException
java.io.IOException
public java.lang.Object getAttachmentAsJson(java.lang.String fieldName, java.lang.String attachmentName, boolean readOnly) throws lotus.domino.NotesException, JsonException, java.io.IOException
fieldName
- the field that contains the XML as textattachmentName
- the attachment that contains the XML as textreadOnly
- indicates if the document is readonly. If so, the changes are not saved back with the document.
lotus.domino.NotesException
JsonException
java.io.IOException
public java.lang.Object getAttachmentAsJson(java.lang.String fieldName, java.lang.String attachmentName) throws lotus.domino.NotesException, JsonException, java.io.IOException
lotus.domino.NotesException
JsonException
java.io.IOException
public java.lang.Object getAttachmentAsJson(java.lang.String fieldName, java.lang.String attachmentName, boolean readOnly, JsonFactory jsonFactory) throws lotus.domino.NotesException, JsonException, java.io.IOException
lotus.domino.NotesException
JsonException
java.io.IOException
public org.w3c.dom.Document getFieldAsXml(java.lang.String fieldName, boolean readOnly) throws lotus.domino.NotesException, XMLException, java.io.IOException
DO NOT USE
Gets the content of a field as an in memory XML Document.
fieldName
- the field that contains the XML as textreadOnly
- indicates if the document is readonly. If so, the changes are not saved back with the document.
lotus.domino.NotesException
XMLException
java.io.IOException
public org.w3c.dom.Document getFieldAsXml(java.lang.String fieldName) throws lotus.domino.NotesException, XMLException, java.io.IOException
DO NOT USE
Gets the content of a field as an in memory XML Document.
fieldName
- the field that contains the XML as text
lotus.domino.NotesException
XMLException
java.io.IOException
public org.w3c.dom.Document getAttachmentAsXML(java.lang.String fieldName, java.lang.String attachmentName, boolean readOnly) throws lotus.domino.NotesException, XMLException, java.io.IOException
fieldName
- the field that contains the XML as textattachmentName
- the attachment that contains the XML as textreadOnly
- indicates if the document is readonly. If so, the changes are not saved back with the document.
lotus.domino.NotesException
XMLException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |