com.ibm.xsp.model.domino
Class DominoDocumentData

java.lang.Object
  extended by com.ibm.xsp.complex.ValueBindingObjectImpl
      extended by com.ibm.xsp.model.AbstractDataSource
          extended by com.ibm.xsp.model.AbstractDocumentDataSource
              extended by com.ibm.xsp.model.domino.DominoDocumentData
All Implemented Interfaces:
ComponentBindingObject, ValueBindingObject, DataPublishingObject, DataSource, DocDataSource, DocumentDataSource, javax.faces.component.StateHolder

public class DominoDocumentData
extends AbstractDocumentDataSource
implements DocDataSource

DominoDocumentData represents a Domino Document Data Source


Nested Class Summary
protected static class DominoDocumentData.DocumentProperties
          Runtime Properties for the Document Data Source
 
Nested classes/interfaces inherited from class com.ibm.xsp.model.AbstractDataSource
AbstractDataSource.RuntimeProperties
 
Field Summary
static java.lang.String NEW_NOTE_ID
           
 
Fields inherited from class com.ibm.xsp.model.AbstractDataSource
NO_VARS
 
Constructor Summary
DominoDocumentData()
          Default Constructor
 
Method Summary
protected  java.lang.String composeUniqueId()
          Compute a unique ID for shared documents.
protected  AbstractDataSource.RuntimeProperties createRuntimeProperties()
          Create a new AbstractDataSource.RuntimeProperties instance
 void doComputeDocument(javax.faces.context.FacesContext context, java.lang.Object document)
          Compute the current document
 void doDeleteDocument(javax.faces.context.FacesContext context, java.lang.Object document)
          Delete the current document
 DocumentDataContainer doNewDocument(javax.faces.context.FacesContext context)
          Create a new Document.
 DocumentDataContainer doOpenDocument(javax.faces.context.FacesContext context)
          Open the specified document
 boolean doSaveDocument(javax.faces.context.FacesContext context, java.lang.Object document)
          Save the current document
 java.lang.String getAction()
          Return the value of the actionproperty - the action to be performed when opening (newDocument, editDocument)
 java.lang.String getComputeWithForm()
          Get the value of the computeWithForm property for the Data Source
 java.lang.String getConcurrencyMode()
          Return the value of the concurrencyMode property
 java.lang.String getDatabaseName()
          Return the database name.
 java.lang.Object getDataObject()
          Return the default data object
 java.lang.String getDocumentId()
          Return the Document id.
 java.lang.String getEffectiveAction()
          Return the action (newDocument, editDocument) to perform when the document is opened.
 java.lang.String getFormName()
          First return the name of the Form associated with the Document set with setFormName, else return the value of the formName property, else retun null
 java.lang.String getParentId()
          Return the value of the parentId property
protected  DominoDocumentData.DocumentProperties getRuntimeProperties()
          Get the properties for this Data Source
 java.lang.String getSaveLinksAs()
          Return the value of the saveLinksAs property
 java.lang.String[] getVars()
          Return the request-scope attribute names under which various objects associated with this data source will be exposed, including DataSource.getVar() variable name.
 java.lang.String getWebQuerySaveAgent()
          Get the the agent name to run before the document is being saved.
protected  void initializeRuntimeProperties(AbstractDataSource.RuntimeProperties rtProps)
          Initialize Runtime Properties.
 boolean isAllowDeletedDocs()
          Is the Data Source allowed open soft deleted Documents
protected  boolean isDataShared()
          Check if the document used by this data source can be shared.
 boolean isDocument(java.lang.Object document)
          Return true if this is the document associated with this data source
 boolean isNewDocument(javax.faces.context.FacesContext context)
          Return true if a new document should be created when the data source is loaded.
 boolean isReadonly()
          Return true if this is a read only data object
 boolean isReadOnly(java.lang.Object document)
          Is the specified document read only
 void readRequestParams(javax.faces.context.FacesContext context, java.util.Map<java.lang.String,java.lang.Object> requestMap)
          Extract the databaseName,documentId, parentId, and action from the Request Parameters.
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setAction(java.lang.String action)
          Set the value of the actionproperty - the action to be performed when opening (newDocument, editDocument)
 void setAllowDeletedDocs(boolean allowDeletedDocs)
          Set whether the Document Data Source is allowed to open soft deleted Documents
 void setComputeWithForm(java.lang.String computeWithForm)
          Set when to execute the form logic on a document.
 void setConcurrencyMode(java.lang.String concurrencyMode)
          The concurrency mode to set.
 void setDatabaseName(java.lang.String databaseName)
          Set the name of the Database
 void setDocumentId(java.lang.String documentId)
          Set the document Id
 void setFormName(java.lang.String formName)
          Set the name of the Form associated with this Domino Document Data Source
 void setParentId(java.lang.String parentId)
          Set the value of the parentId property Id of the parent Domino document if the Document is a Response.
 void setSaveLinksAs(java.lang.String saveLinksAs)
          Return the value of the saveLinksAs property
 void setWebQuerySaveAgent(java.lang.String agentName)
          Set the name of the agent to run when the document is saved
 
Methods inherited from class com.ibm.xsp.model.AbstractDocumentDataSource
computeDocument, getComputeDocument, getPostNewDocument, getPostOpenDocument, getPostSaveDocument, getQueryNewDocument, getQueryOpenDocument, getQuerySaveDocument, invoke, load, newDocument, openDocument, pushData, save, saveDocument, setComputeDocument, setPostNewDocument, setPostOpenDocument, setPostSaveDocument, setQueryNewDocument, setQueryOpenDocument, setQuerySaveDocument
 
Methods inherited from class com.ibm.xsp.model.AbstractDataSource
beginRuntimeProperties, computeUniqueBeanId, endRuntimeProperties, getBeanId, getDataContainer, getDataContainer, getEffectiveScope, getRequestParamPrefix, getScope, getUniqueId, getVar, getViewRoot, hasRuntimeProperties, isIgnoreRequestParams, isNestedInUIIterator, popData, prefixRequestParam, pushData, putDataContainer, refresh, removeBean, removeBean, save, setIgnoreRequestParams, setRequestParamPrefix, setScope, setVar
 
Methods inherited from class com.ibm.xsp.complex.ValueBindingObjectImpl
getComponent, getFacesContext, getValueBinding, isTransient, setComponent, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.xsp.model.DataSource
getBeanId, getDataContainer, getRequestParamPrefix, getScope, getUniqueId, getVar, isIgnoreRequestParams, refresh, save, setIgnoreRequestParams, setRequestParamPrefix, setScope, setVar
 
Methods inherited from interface com.ibm.xsp.model.DataPublishingObject
popData, pushData
 

Field Detail

NEW_NOTE_ID

public static final java.lang.String NEW_NOTE_ID
See Also:
Constant Field Values
Constructor Detail

DominoDocumentData

public DominoDocumentData()
Default Constructor

Method Detail

getRuntimeProperties

protected DominoDocumentData.DocumentProperties getRuntimeProperties()
Get the properties for this Data Source

Overrides:
getRuntimeProperties in class AbstractDataSource
Returns:
the current RuntimeProperties

createRuntimeProperties

protected AbstractDataSource.RuntimeProperties createRuntimeProperties()
Description copied from class: AbstractDataSource
Create a new AbstractDataSource.RuntimeProperties instance

Overrides:
createRuntimeProperties in class AbstractDataSource
Returns:
new RuntimeProperties

initializeRuntimeProperties

protected void initializeRuntimeProperties(AbstractDataSource.RuntimeProperties rtProps)
Description copied from class: AbstractDataSource
Initialize Runtime Properties. Empty method, does nothing.

Overrides:
initializeRuntimeProperties in class AbstractDataSource
Parameters:
rtProps - Runtime Properties

readRequestParams

public void readRequestParams(javax.faces.context.FacesContext context,
                              java.util.Map<java.lang.String,java.lang.Object> requestMap)
Extract the databaseName,documentId, parentId, and action from the Request Parameters.

Specified by:
readRequestParams in class AbstractDataSource

getDataObject

public java.lang.Object getDataObject()
Description copied from class: AbstractDataSource
Return the default data object

Specified by:
getDataObject in class AbstractDataSource
Returns:

isReadonly

public boolean isReadonly()
Description copied from class: AbstractDataSource
Return true if this is a read only data object

Specified by:
isReadonly in interface DataSource
Specified by:
isReadonly in class AbstractDataSource

getVars

public java.lang.String[] getVars()
Description copied from interface: DataSource
Return the request-scope attribute names under which various objects associated with this data source will be exposed, including DataSource.getVar() variable name.

Specified by:
getVars in interface DataSource
Overrides:
getVars in class AbstractDataSource

isDocument

public boolean isDocument(java.lang.Object document)
Description copied from interface: DocumentDataSource
Return true if this is the document associated with this data source

Specified by:
isDocument in interface DocumentDataSource

getComputeWithForm

public java.lang.String getComputeWithForm()
Get the value of the computeWithForm property for the Data Source

Returns:
Returns the computeWithForm mode.

setAllowDeletedDocs

public void setAllowDeletedDocs(boolean allowDeletedDocs)
Set whether the Document Data Source is allowed to open soft deleted Documents

Parameters:
allowDeletedDocs - true if allowed open soft deletes

isAllowDeletedDocs

public boolean isAllowDeletedDocs()
Is the Data Source allowed open soft deleted Documents

Returns:
Return true if Data Source is allowed to open Soft Deleted Documents.

setComputeWithForm

public void setComputeWithForm(java.lang.String computeWithForm)
Set when to execute the form logic on a document.

Parameters:
computeWithForm - onload, onsave, both.

getConcurrencyMode

public java.lang.String getConcurrencyMode()
Return the value of the concurrencyMode property

Returns:
Returns the concurrency mode.

getSaveLinksAs

public java.lang.String getSaveLinksAs()
Return the value of the saveLinksAs property

Returns:
Returns the choice for rendering links on page

setSaveLinksAs

public void setSaveLinksAs(java.lang.String saveLinksAs)
Return the value of the saveLinksAs property

Parameters:
saveLinksAs - UseWeb, UseNotes

setConcurrencyMode

public void setConcurrencyMode(java.lang.String concurrencyMode)
The concurrency mode to set.

Parameters:
concurrencyMode - createResposne, fail, exception, force

getAction

public java.lang.String getAction()
Return the value of the actionproperty - the action to be performed when opening (newDocument, editDocument)

Returns:
Returns the action.

setAction

public void setAction(java.lang.String action)
Set the value of the actionproperty - the action to be performed when opening (newDocument, editDocument)

Parameters:
action - The action to set (DatabaseConstants.ACTION_NEW, DatabaseConstants.ACTION_EDIT)

getEffectiveAction

public java.lang.String getEffectiveAction()
Return the action (newDocument, editDocument) to perform when the document is opened. Returns DatabaseConstants.ACTION_NEW is action is not set.

Returns:
The effective action to perform when the document is opened

isDataShared

protected boolean isDataShared()
Description copied from class: AbstractDataSource
Check if the document used by this data source can be shared. This happens when multiple data sources share the same document, within a global scope like the session or application scope

Overrides:
isDataShared in class AbstractDataSource

composeUniqueId

protected java.lang.String composeUniqueId()
Description copied from class: AbstractDataSource
Compute a unique ID for shared documents.

Specified by:
composeUniqueId in class AbstractDataSource
Returns:

getDocumentId

public java.lang.String getDocumentId()
Return the Document id. If it is not set by the RuntimeProperties, return the value set by setDocumentId(). If this is not set return the value of the documentId property. Is that is not set, return null

Returns:
Returns the documentId.

setDocumentId

public void setDocumentId(java.lang.String documentId)
Set the document Id

Parameters:
documentId - The documentId to set.

doNewDocument

public DocumentDataContainer doNewDocument(javax.faces.context.FacesContext context)
                                    throws FacesExceptionEx
Create a new Document. First it checks if the user can create a new document so user does not find out when they go to save that they do not have the permission. API works differently for Server and Local Databases, so for access granted through Groups, the API will not find the Server defined Group access for the Local Database. ACL checking is not used locally, skip the check for local databases. (non-Javadoc)

Specified by:
doNewDocument in class AbstractDocumentDataSource
Throws:
FacesExceptionEx
See Also:
AbstractDocumentDataSource.doNewDocument(javax.faces.context.FacesContext)

doOpenDocument

public DocumentDataContainer doOpenDocument(javax.faces.context.FacesContext context)
                                     throws FacesExceptionEx
Description copied from class: AbstractDocumentDataSource
Open the specified document

Specified by:
doOpenDocument in class AbstractDocumentDataSource
Throws:
FacesExceptionEx

doDeleteDocument

public void doDeleteDocument(javax.faces.context.FacesContext context,
                             java.lang.Object document)
                      throws FacesExceptionEx
Description copied from class: AbstractDocumentDataSource
Delete the current document

Specified by:
doDeleteDocument in class AbstractDocumentDataSource
Throws:
FacesExceptionEx

doSaveDocument

public boolean doSaveDocument(javax.faces.context.FacesContext context,
                              java.lang.Object document)
                       throws FacesExceptionEx
Description copied from class: AbstractDocumentDataSource
Save the current document

Specified by:
doSaveDocument in class AbstractDocumentDataSource
Returns:
TODO
Throws:
FacesExceptionEx

doComputeDocument

public void doComputeDocument(javax.faces.context.FacesContext context,
                              java.lang.Object document)
                       throws FacesExceptionEx
Description copied from class: AbstractDocumentDataSource
Compute the current document

Specified by:
doComputeDocument in class AbstractDocumentDataSource
Throws:
FacesExceptionEx

isReadOnly

public boolean isReadOnly(java.lang.Object document)
Description copied from class: AbstractDocumentDataSource
Is the specified document read only

Specified by:
isReadOnly in class AbstractDocumentDataSource
Returns:

isNewDocument

public boolean isNewDocument(javax.faces.context.FacesContext context)
Description copied from interface: DocumentDataSource
Return true if a new document should be created when the data source is loaded.

Specified by:
isNewDocument in interface DocumentDataSource

getParentId

public java.lang.String getParentId()
Return the value of the parentId property

Returns:
Returns the parentId.

setParentId

public void setParentId(java.lang.String parentId)
Set the value of the parentId property Id of the parent Domino document if the Document is a Response.


getDatabaseName

public java.lang.String getDatabaseName()
Return the database name. First try the runtime properties, next try the value set by setDatabaseName(), next try the values of the databaseName property, else return null

Returns:
the databaseName

setDatabaseName

public void setDatabaseName(java.lang.String databaseName)
Set the name of the Database

Parameters:
databaseName - the databaseName to set

getFormName

public java.lang.String getFormName()
First return the name of the Form associated with the Document set with setFormName, else return the value of the formName property, else retun null

Returns:
the formName

setFormName

public void setFormName(java.lang.String formName)
Set the name of the Form associated with this Domino Document Data Source

Parameters:
formName - the formName to set

getWebQuerySaveAgent

public java.lang.String getWebQuerySaveAgent()
Get the the agent name to run before the document is being saved.

Returns:
the name of the agent to execute when a document is saved

setWebQuerySaveAgent

public void setWebQuerySaveAgent(java.lang.String agentName)
Set the name of the agent to run when the document is saved

Parameters:
agentName - the name of the agent

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class AbstractDocumentDataSource

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class AbstractDocumentDataSource