de.bea.domingo
Interface DAgentContext
- All Known Implementing Classes:
- AgentContextProxy
public interface DAgentContext
Represents the agent environment of the current program, if an agent is running it.
- Author:
- Kurt Riede
Method Summary |
DAgent |
getCurrentAgent()
The agent that's currently running. |
DDatabase |
getCurrentDatabase()
The database in which the current agent resides. |
DDocument |
getDocumentContext()
The in-memory document when an agent starts. |
java.lang.String |
getEffectiveUserName()
The user name that is in effect for the current agent. |
int |
getLastExitStatus()
The exit status code returned by the Agent Manager the last time the current agent ran. |
java.util.Calendar |
getLastRun()
The date and time when the current agent was last executed. |
DDocument |
getSavedData()
A document that an agent uses to store information between invocations. |
java.util.Iterator |
getUnprocessedDocuments()
The documents in a database that the current agent considers to be
unprocessed. |
java.util.Iterator |
unprocessedFTSearch(java.lang.String query,
int maxDocs)
Performs a full-text search within the unprocessed documents. |
java.util.Iterator |
unprocessedFTSearch(java.lang.String query,
int maxDocs,
int sortOpt,
int otherOpt)
Performs a full-text search within the unprocessed documents. |
java.util.Iterator |
unprocessedSearch(java.lang.String query,
java.util.Calendar dateTime,
int maxDocs)
Searches for unprocessed documents which were created or modified since the cutoff date. |
void |
updateProcessedDoc(DDocument document)
Marks a given document as processed. |
updateProcessedDoc
void updateProcessedDoc(DDocument document)
- Marks a given document as processed.
- Parameters:
document
- a document
unprocessedFTSearch
java.util.Iterator unprocessedFTSearch(java.lang.String query,
int maxDocs)
- Performs a full-text search within the unprocessed documents.
- Parameters:
query
- The full-text querymaxDocs
- The maximum number of documents you want returned; 0 means all matching documents
- Returns:
- An interator of documents that are not yet processed and match the query
unprocessedFTSearch
java.util.Iterator unprocessedFTSearch(java.lang.String query,
int maxDocs,
int sortOpt,
int otherOpt)
- Performs a full-text search within the unprocessed documents.
- sortOpt
- Use one of the following to specify a sorting option:
- Database.FT_SCORES (default) sorts by relevance score with highest relevance first.
- Database.FT_DATECREATED_DES sorts by document creation date in descending order.
- Database.FT_DATECREATED_ASC sorts by document creation date in ascending order.
- Database.FT_DATE_DES sorts by document date in descending order.
- Database.FT_DATE_ASC sorts by document date in ascending order.
- otherOpt
- Use the following constants to specify additional search options.
To specify more than one option, use a logical OR operation:
- Database.FT_DATABASE includes Lotus Domino databases in the search scope.
- Database.FT_FILESYSTEM includes files other than Lotus Domino databases in the search scope.
- Database.FT_FUZZY specifies a fuzzy search.
- Database.FT_STEMS uses stem words as the basis of the search.
- Parameters:
query
- The full-text querymaxDocs
- The maximum number of documents you want returned; 0 means all matching documentssortOpt
- sorting optionsotherOpt
- other options
- Returns:
- An iterator of documents that are not yet processed and match the query
unprocessedSearch
java.util.Iterator unprocessedSearch(java.lang.String query,
java.util.Calendar dateTime,
int maxDocs)
- Searches for unprocessed documents which were created or modified since the cutoff date.
The resulting collection is sorted by relevance with highest relevance first.
- Parameters:
query
- A Lotus Domino formula that defines the selection criteriadateTime
- A cutoff datemaxDocs
- The maximum number of documents you want returned; 0 means all matching documents
- Returns:
- An iteratorof documents that are not yet processed, match the selection criteria,
and were created or modified after the cutoff date.
getEffectiveUserName
java.lang.String getEffectiveUserName()
- The user name that is in effect for the current agent.
In general, getEffectiveUserName and
DSession.getUserName()
return the same
value for a given program.
The exceptions are agents that run on a server, where
getEffectiveUserName is the name of the script's owner and
getUserName is the name of the server on which the script is running.
If the user name is hierarchical, this property returns the fully
distinguished name.
- Returns:
- effective user name
getCurrentAgent
DAgent getCurrentAgent()
- The agent that's currently running.
- Returns:
- current agent
getCurrentDatabase
DDatabase getCurrentDatabase()
- The database in which the current agent resides.
- Returns:
- current database
getDocumentContext
DDocument getDocumentContext()
- The in-memory document when an agent starts.
Usage
For an agent activated in a view through the Notes client UI, the
in-memory document is the document highlighted in the view. For an agent
run from a browser with the OpenAgent URL command, the in-memory document
is a new document containing an item for each CGI (Common Gateway
Interface) variable supported by Lotus Domino. Each item has the name and
current value of a supported CGI variable. (No design work on your part
is needed; the CGI variables are available automatically.) For an agent
run from a browser with Command([RunAgent]) or Command[ToolsRunMacro],
the in-memory document is the current document. In the case of
WebQueryOpen, this is the document before Lotus Domino converts it to
HTML and sends it to the browser; in the case of WebQuerySave, this is
the document before Lotus Domino saves it. If the form on which the
document is based contains a field named the same as a Lotus
Domino-supported CGI variable, the in-memory document also contains the
value of that variable. (You must explicitly design the CGI variables
into the form, for example, as hidden fields.). You cannot
use the encrypt and remove methods on the Document object returned by
getDocumentContext, nor use the compact method on the Database object
that contains the Document object returned by getDocumentContext.
- Returns:
- The in-memory document when an agent starts.
getLastExitStatus
int getLastExitStatus()
- The exit status code returned by the Agent Manager the last time the current agent ran.
- Returns:
- last exit status
getLastRun
java.util.Calendar getLastRun()
- The date and time when the current agent was last executed.
- Returns:
- date and time of last run
getSavedData
DDocument getSavedData()
- A document that an agent uses to store information between invocations.
The agent can use the information in this document the next time the
agent runs.
- Returns:
- SavedData document
getUnprocessedDocuments
java.util.Iterator getUnprocessedDocuments()
- The documents in a database that the current agent considers to be
unprocessed. The type of agent determines which documents are
considered unprocessed.
- Returns:
- iterator of unprocessed documents
Domingo Java-API