com.ibm.notes.java.api.data
Class NotesDocumentData

java.lang.Object
  extended by com.ibm.notes.java.api.data.NotesData
      extended by com.ibm.notes.java.api.data.NotesDocumentData

public class NotesDocumentData
extends NotesData

Class that contains data that would be associated with a Notes document.


Field Summary
 
Fields inherited from class com.ibm.notes.java.api.data.NotesData
baseUrl, ENCODE_ERR, NOTES_COMMAND_SEPARATOR, NOTES_PARAMETER_SEPARATOR, NOTES_PATH_SEPARATOR, NOTES_PROTOCOL, NULL_ERR
 
Constructor Summary
NotesDocumentData(Document document)
          Construct a NotesDocumentData object from a lotus.domino.Document.
NotesDocumentData(NotesDatabaseData database, String documentUnid)
          Construct a NotesDocumentData object from a NotesDatabaseData object and a document unid.
NotesDocumentData(NotesViewData view, String documentUnid)
          Construct a NotesDocumentData object from a NotesViewData object and a document string that is not encoded.
NotesDocumentData(String url)
          Construct a NotesDocumentData from an encoded Notes URL.
 
Method Summary
 boolean equals(Object obj)
          Determines whether two NotesDocumentData objects are equals to each other.
 String getEditUrl()
          Gets the Notes URL to open this document in edit mode.
 String getOpenUrl()
          Gets the encoded Notes URL to open the NotesData object.
 String getUnid()
          Get the document.
 NotesViewData getViewData()
           
 Document open(Session session)
          Opens the lotus.domino.Document using a given session.
protected  void setBaseUrl()
          Constructs the Notes URL of the data object from the given information.
 
Methods inherited from class com.ibm.notes.java.api.data.NotesData
encode, getBaseUrl, getParser, removeCommandAndParams
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotesDocumentData

public NotesDocumentData(String url)
                  throws NotesException 
Construct a NotesDocumentData from an encoded Notes URL. The URL should be UTF-8 encoded, and should not be null.

Parameters:
url - the encoded Notes URL to construct a NotesDocumentData from
Throws:
NotesException - thrown when the URL cannot be used to construct the NotesDocumentData object
Since:
1.5.1

NotesDocumentData

public NotesDocumentData(NotesViewData view,
                         String documentUnid)
                  throws NotesException 
Construct a NotesDocumentData object from a NotesViewData object and a document string that is not encoded.

Parameters:
view - the view containing the document
documentUNID - the document in the view
Throws:
NotesException - thrown when the NotesDocumentData cannot be constructed from the parameters
Since:
1.5.1

NotesDocumentData

public NotesDocumentData(NotesDatabaseData database,
                         String documentUnid)
                  throws NotesException 
Construct a NotesDocumentData object from a NotesDatabaseData object and a document unid.

Parameters:
database - the database containing the document
documentUnid - UNID of the document string of the document in the database
Throws:
NotesException - thrown when the object cannot be constructed from the given parameters
Since:
1.5.1

NotesDocumentData

public NotesDocumentData(Document document)
                  throws NotesException 
Construct a NotesDocumentData object from a lotus.domino.Document.

Parameters:
document - the lotus.domino.Document to use to construct the object
Throws:
NotesException - thrown when the lotus.domino.Document cannot be used to construct the object
Since:
1.5.1
Method Detail

setBaseUrl

protected void setBaseUrl()
                   throws UnsupportedEncodingException
Description copied from class: NotesData
Constructs the Notes URL of the data object from the given information. The URL constructed should only contain the parameters passed in, no commands, or parameters should be added to the URL in this method.

Specified by:
setBaseUrl in class NotesData
Throws:
UnsupportedEncodingException - thrown when the URL cannot be encoded

getUnid

public String getUnid()
Get the document. The returned string is not encoded.

Returns:
the document string
Since:
1.5.1

equals

public boolean equals(Object obj)
Determines whether two NotesDocumentData objects are equals to each other.

Overrides:
equals in class Object
Parameters:
obj - object to test for equality
Returns:
true if the two objects are equal, false otherwise
Since:
1.5.1

getOpenUrl

public String getOpenUrl()
Description copied from class: NotesData
Gets the encoded Notes URL to open the NotesData object. The URL is UTF-8 encoded.

Specified by:
getOpenUrl in class NotesData
Returns:
the encoded Notes URL to open the NotesData object

getEditUrl

public String getEditUrl()
Gets the Notes URL to open this document in edit mode. The returned URL is UTF-8 encoded.

Returns:
the Notes URL to open this document in edit mode
Since:
1.5.1

open

public Document  open(Session session)
                           throws NotesException 
Opens the lotus.domino.Document using a given session.

Parameters:
session - the session to use to get the document
Returns:
the lotus.domino.Document from the parameters in this object
Throws:
NotesException - thrown when the Document cannot be retrieved from the session
Since:
1.5.1

getViewData

public NotesViewData getViewData()