|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.bea.domingo.monitor.AbstractMonitorEnabled de.bea.domingo.http.BaseHttp de.bea.domingo.http.DatabaseHttp
public final class DatabaseHttp
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.bea.domingo.http.BaseHttp |
---|
BaseHttp.BaseHandler |
Field Summary |
---|
Fields inherited from class de.bea.domingo.http.BaseHttp |
---|
DATETIME_STRING_LENGTH, MAX_DATETIME_LENGTH, NUM_DATETIME_VALUES |
Fields inherited from interface de.bea.domingo.DDatabase |
---|
FT_DATE_ASCENDING, FT_DATE_DESCENDING, FT_DATECREATED_ASCENDING, FT_DATECREATED_DESCENDING, FT_FUZZY, FT_SCORES, FT_STEMS |
Method Summary | |
---|---|
DDatabase |
createDatabaseFromTemplate(java.lang.String serverName,
java.lang.String databaseName,
boolean inherit)
Create an empty database with the design of the given template. |
DDocument |
createDocument()
Creates a document in a database and returns a Document object that represents the new document. |
DDatabase |
createReplica(java.lang.String server,
java.lang.String fPath)
Creates a replica of the current database at a new location. |
java.util.Iterator |
fullTextSearch(java.lang.String query)
Conducts a full-text search of all the documents in a database. |
java.util.Iterator |
fullTextSearch(java.lang.String query,
int max)
Conducts a full-text search of all the documents in a database. |
java.util.Iterator |
fullTextSearch(java.lang.String query,
int max,
int sortopt,
int otheropt)
Conducts a full-text search of all the documents in a database. |
java.util.Iterator |
fullTextSearchRange(java.lang.String query,
int max,
int sortopt,
int otheropt,
int start)
Conducts a full-text search of all the documents in a database. |
DAgent |
getAgent(java.lang.String name)
Finds an agent in a database, given the agent name. |
java.util.Iterator |
getAllDocuments()
Returns an An unsorted collection containing all the documents in a database. |
java.lang.String |
getCategories()
The categories under which a database appears in the Database Library. |
int |
getCurrentAccessLevel()
The current user's access level to a database. |
java.lang.String |
getDesignTemplateName()
The name of the design template from which a database inherits its design. |
DDocument |
getDocumentByID(java.lang.String noteId)
Finds a document in a database, given the document note ID. |
DDocument |
getDocumentByUNID(java.lang.String universalId)
Finds a document in a database, given the document universal ID (UNID). |
java.lang.String |
getFileName()
The file name of a database, excluding the path. |
java.lang.String |
getFilePath()
The path and file name of a database. |
boolean |
getFolderReferencesEnabled()
Indicates whether this database maintains folder references for documents. |
DForm |
getForm(java.lang.String name)
Returns the form with a given name. |
java.util.List |
getForms()
Returns a list of all forms in a database. |
(package private) static DDatabase |
getInstance(NotesHttpFactory factory,
DBase parent,
java.lang.String filePath,
DNotesMonitor monitor)
Factory method for instances of this class. |
DProfileDocument |
getProfileDocument(java.lang.String profileName,
java.lang.String profileKey)
Retrieves or creates a profile document. |
java.lang.String |
getReplicaID()
A 16-digit hexadecimal number that represents the replica ID of a Notes database. |
java.lang.String |
getServer()
The name of the server where a database resides. |
DSession |
getSession()
The Notes session that contains a database. |
int |
getSizeQuota()
The size quota of a database, in kilobytes. |
java.lang.String |
getTemplateName()
The template name of a database, if the database is a template. |
java.lang.String |
getTitle()
The title of a database. |
DView |
getView(java.lang.String viewName)
Finds a view or folder in a database, given the name or alias of the view or folder. |
java.util.List |
getViews()
The views and folders in a database. |
boolean |
isDelayUpdates()
Indicates whether updates to a server are delayed (batched) for better performance. |
boolean |
isDocumentLockingEnabled()
Indicates whether document locking is enabled for a database. |
boolean |
isFTIndexed()
Indicates whether or not a database has a full-text index. |
boolean |
isOpen()
Indicates whether a database is open. |
boolean |
isPrivateAddressBook()
Indicates if a database is a Personal Address Book. |
boolean |
isPublicAddressBook()
Indicates if a database is a Domino Directory. |
boolean |
open()
Opens a database. |
boolean |
remove()
Permanently deletes the database. |
boolean |
replicate(java.lang.String server)
Replicates a local database with its replica(s) on a server. |
java.util.Iterator |
search(java.lang.String formula)
Given selection criteria for a document, returns all documents in a database that meet the criteria. |
java.util.Iterator |
search(java.lang.String formula,
java.util.Calendar dt)
Given selection criteria for a document, returns all documents in a database that meet the criteria. |
java.util.Iterator |
search(java.lang.String formula,
java.util.Calendar dt,
int max)
Given selection criteria for a document, returns all documents in a database that meet the criteria. |
void |
setDocumentLockingEnabled(boolean flag)
Sets whether document locking is enabled for a database. |
void |
setFolderReferencesEnabled(boolean flag)
Indicates whether this database maintains folder references for documents. |
void |
setTitle(java.lang.String title)
Sets the title of a database. |
java.lang.String |
toString()
Returns a short description of an instance. |
void |
updateFTIndex(boolean create)
Updates the full-text index of a database. |
Methods inherited from class de.bea.domingo.http.BaseHttp |
---|
execute, execute, executeDomingoDatabaseUrl, executeUrl, getDSession, getFactory, getParent, parseViewEntryDateTime, postDXL, toStringIntern |
Methods inherited from class de.bea.domingo.monitor.AbstractMonitorEnabled |
---|
getMonitor, setMonitor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.bea.domingo.DBase |
---|
equals, hashCode |
Method Detail |
---|
static DDatabase getInstance(NotesHttpFactory factory, DBase parent, java.lang.String filePath, DNotesMonitor monitor)
factory
- the controlling factoryparent
- the session that produced the databasefilePath
- file/path to the Notes databasemonitor
- the monitor that handles logging
public java.lang.String toString()
BaseHttp
toString
in interface DBase
toString
in class BaseHttp
Object.toString()
public DSession getSession()
getSession
in interface DDatabase
DDatabase.getSession()
public boolean replicate(java.lang.String server)
replicate
in interface DDatabase
server
- The name of the server with which you want to replicate.
Any replica of the source database that exists on the server
will replicate.
true
if the database replicates without errors
false
if replication errors occurDDatabase.replicate(java.lang.String)
public boolean remove()
remove
in interface DDatabase
true
if the database was removed successfully, else false
DDatabase.remove()
public java.util.Iterator getAllDocuments()
getAllDocuments
in interface DDatabase
DDatabase.getAllDocuments()
public DDocument getDocumentByUNID(java.lang.String universalId)
If the document document is already loaded, this method might return the same instance of the document or a new instance representing the same document. Mostly via local call, the same instance is returned and mostly via remote calls a new instance is returned. Your code should not rely on this behaviour.
getDocumentByUNID
in interface DDatabase
universalId
- Universal ID of a document
null
if the document was not foundDDatabase.getDocumentByUNID(java.lang.String)
public DDocument getDocumentByID(java.lang.String noteId)
If the document document is already loaded, this method might return the same instance of the document or a new instance representing the same document. Mostly via local call, the same instance is returned and mostly via remote calls a new instance is returned. Your code should not rely on this behaviour.
getDocumentByID
in interface DDatabase
noteId
- NoteID
DDatabase.getDocumentByID(java.lang.String)
public DProfileDocument getProfileDocument(java.lang.String profileName, java.lang.String profileKey)
getProfileDocument
in interface DDatabase
profileName
- name of a profileprofileKey
- The unique key associated with the profile document.
Usually the userName. Can be null
which indicates that
the returned document is a public profile.
null
if the document was not foundDDatabase.getProfileDocument(java.lang.String,
java.lang.String)
public DDocument createDocument()
createDocument
in interface DDatabase
DDatabase.createDocument()
public DView getView(java.lang.String viewName)
getView
in interface DDatabase
viewName
- name of a view
DDatabase.getView(java.lang.String)
public java.lang.String getFilePath()
getFilePath
in interface DDatabase
DDatabase.getFilePath()
public java.lang.String getFileName()
getFileName
in interface DDatabase
DDatabase.getFileName()
public DDatabase createDatabaseFromTemplate(java.lang.String serverName, java.lang.String databaseName, boolean inherit) throws DNotesException
createDatabaseFromTemplate
in interface DDatabase
serverName
- notes server namedatabaseName
- notes database filenameinherit
- Specify true
if you want the new database to
inherit future design changes from the template;
otherwise, specify false.
DNotesException
- if current database is not a templateDDatabase.createDatabaseFromTemplate(java.lang.String,
java.lang.String, boolean)
public DDatabase createReplica(java.lang.String server, java.lang.String fPath) throws DNotesException
Usage
If a database with the specified file name already exists, an exception
is thrown. Programs running on a server or making remote (IIOP) calls
to a server can't create or access databases on other servers.
In these cases, the server parameter must correspond to the server the
program is running on. There are two ways to do this:
Programs running on a workstation can access several different servers in a single program.
createReplica
in interface DDatabase
server
- The name of the server where the replica will reside.
Specify null or an empty string ("") to create a replica
on the current computer.fPath
- The file name of the replica.
DNotesException
- if creation of the new replica failedDDatabase.createReplica(java.lang.String,
java.lang.String)
public int getCurrentAccessLevel()
If a program runs on a workstation or is remote (IIOP), CurrentAccessLevel is determined by the access level of the current user.
If a program runs on a server, CurrentAccessLevel is determined by the access level of the person who last saved the program (the owner).
Legal values:
DACL.LEVEL_AUTHOR DACL.LEVEL_DEPOSITOR DACL.LEVEL_DESIGNER DACL.LEVEL_EDITOR DACL.LEVEL_MANAGER DACL.LEVEL_NOACCESS DACL.LEVEL_READER
getCurrentAccessLevel
in interface DDatabase
DDatabase.getCurrentAccessLevel()
public java.lang.String getServer()
If the database is on a workstation, the property returns an empty string.
getServer
in interface DDatabase
DDatabase.getServer()
public DAgent getAgent(java.lang.String name)
The return value is null if the current user (as obtained by
Session.getUserName
) is not the owner of the private agent.
getAgent
in interface DDatabase
name
- the name of the agent.
DDatabase.getAgent(java.lang.String)
public boolean isPublicAddressBook()
This property is available for Database objects retrieved by
DSession.getAddressBooks()
in
DSession
. For other Database objects,
this property has no value and evaluates to false.
isPublicAddressBook
in interface DDatabase
true
if the database is a Domino Directory,
false
if the database is not a Domino DirectoryDDatabase.isPublicAddressBook()
public boolean isPrivateAddressBook()
This property is available for Database objects retrieved by
DSession.getAddressBooks()
in
DSession
. For other Database objects,
this property has no value and evaluates to false.
isPrivateAddressBook
in interface DDatabase
true
if the database is a Personal Address Book,
false
if the database is not Personal Address BookDDatabase.isPrivateAddressBook()
public boolean isOpen()
Usage
A database must be open to use the Database methods except:
DDatabase.getCategories()
,
DDatabase.isDelayUpdates()
,
DDatabase.getDesignTemplateName()
,
DDatabase.getFileName()
,
DDatabase.getFilePath()
,
DDatabase.isOpen()
,
DDatabase.isPrivateAddressBook()
,
DDatabase.isPublicAddressBook()
,
DDatabase.getSession()
,
DDatabase.getReplicaID()
,
DDatabase.getServer()
,
DDatabase.getSizeQuota()
,
DDatabase.getTemplateName()
, and
DDatabase.getTitle()
.
The following methods do not open a database: DbDirectory.getFirstDatabase, DbDirectory.getNextDatabase, and Session.getAddressBooks. You must explicitly call Database.open.
isOpen
in interface DDatabase
true
if the database is open,
false
if the database is not openDDatabase.isOpen()
public boolean open()
A database must be open to use the Database properties and methods with some exceptions. Most methods that access a database open it, but some do not. See isOpen for details.
An error is returned if the user does not have access rights to the database or server.
open
in interface DDatabase
true
if the database exists and is opened,
false
if no database with this name existsDDatabase.open()
public java.lang.String getCategories()
getCategories
in interface DDatabase
DDatabase.getCategories()
public boolean isDelayUpdates()
If DelayUpdates is false, the program waits for updates to the server to be posted. If you set DelayUpdates to true, server updates are cached and the program proceeds immediately. At a convenient time, the cached updates are posted. This makes for better performance but risks losing the cached updates in the event of a crash. This method applies to save and remove operations on documents.
Set this property each time you open a database. The property is not saved.
isDelayUpdates
in interface DDatabase
true
if server delays updates,
false
if server posts updates immediatelyDDatabase.isDelayUpdates()
public java.lang.String getReplicaID()
getReplicaID
in interface DDatabase
DDatabase.getReplicaID()
public int getSizeQuota()
The size quota for a database specifies the amount of disk space that the server administrator is willing to provide for the database. Therefore, the SizeQuota property can only be set by a program that has administrator access to the server on which the database resides. The size quota is not the same as the size limit that a user specifies when creating a new database.
If the database has no size quota, this property returns 0.
getSizeQuota
in interface DDatabase
DDatabase.getSizeQuota()
public java.lang.String getTemplateName()
getTemplateName
in interface DDatabase
DDatabase.getTemplateName()
public java.lang.String getTitle()
getTitle
in interface DDatabase
DDatabase.getTitle()
public void setTitle(java.lang.String title)
setTitle
in interface DDatabase
title
- new database titleDDatabase.setTitle(String)
public java.lang.String getDesignTemplateName()
If a database inherits a specific design element (such as a form) but not its entire design from a template, this property returns an empty string.
getDesignTemplateName
in interface DDatabase
DDatabase.getDesignTemplateName()
public java.util.Iterator search(java.lang.String formula, java.util.Calendar dt, int max)
Usage
This method returns a maximum of 5,000 documents by default. The
Notes.ini variable FT_MAX_SEARCH_RESULTS overrides this limit
for indexed databases or databases that are not indexed but that are
running an agent on the client. For a database that is not indexed and
is running in an agent on the server, you must set the
TEMP_INDEX_MAX_DOC Notes.ini variable as well.
The absolute maximum value is 2,147,483,647.
search
in interface DDatabase
formula
- Notes @-function formula that specifies the selection criteriadt
- A cutoff date. The method searches only documents created or
modified since the cutoff date. Can be null to indicate no
cutoff date.max
- The maximum number of documents you want returned.
Specify 0 to receive all matching documents
(up to 5,000. See Usage section.).
DDatabase.search(java.lang.String,
java.util.Calendar, int)
public java.util.Iterator search(java.lang.String formula, java.util.Calendar dt)
Usage
This method returns a maximum of 5,000 documents by default. The
Notes.ini variable FT_MAX_SEARCH_RESULTS overrides this limit
for indexed databases or databases that are not indexed but that are
running an agent on the client. For a database that is not indexed and
is running in an agent on the server, you must set the
TEMP_INDEX_MAX_DOC Notes.ini variable as well.
The absolute maximum value is 2,147,483,647.
search
in interface DDatabase
formula
- Notes @-function formula that specifies the selection criteriadt
- A cutoff date. The method searches only documents created or
modified since the cutoff date. Can be null to indicate no
cutoff date.
DDatabase.search(java.lang.String,
java.util.Calendar)
public java.util.Iterator search(java.lang.String formula)
Usage
This method returns a maximum of 5,000 documents by default. The
Notes.ini variable FT_MAX_SEARCH_RESULTS overrides this limit
for indexed databases or databases that are not indexed but that are
running an agent on the client. For a database that is not indexed and
is running in an agent on the server, you must set the
TEMP_INDEX_MAX_DOC Notes.ini variable as well.
The absolute maximum value is 2,147,483,647.
search
in interface DDatabase
formula
- Notes @-function formula that specifies the selection criteria
DDatabase.search(java.lang.String)
public boolean isFTIndexed()
isFTIndexed
in interface DDatabase
true
if the database has a full-text index, else false
DDatabase.isFTIndexed()
public void updateFTIndex(boolean create)
Usage
An exception is thrown if you attempt to create a full-text index on a database that is not local. A database must contain at least one document in order for an index to be created, even if the create parameter is set to true.
updateFTIndex
in interface DDatabase
create
- Specify true
if you want to create an index
if none exists (valid only for local databases). Otherwise,
specify false
.DDatabase.updateFTIndex(boolean)
public java.util.Iterator fullTextSearchRange(java.lang.String query, int max, int sortopt, int otheropt, int start)
Usage
This method is the same the same as
DDatabase.fullTextSearch(String, int, int, int)
plus the start parameter. If the
database is not full-text indexed, this method works, but less
efficiently. To test for an index, use the DDatabase.isFTIndexed()
property. To create an index on a local database, use the
DDatabase.updateFTIndex(boolean)
method. This method returns a maximum of
5,000 documents by default. The Notes.ini variable
FT_MAX_SEARCH_RESULTS
overrides this limit for indexed
databases or databases that are not indexed but that are running in an
agent on the client. For a database that is not indexed and is running in
an agent on the server, you must set the TEMP_INDEX_MAX_DOC
Notes.ini variable as well. The absolute maximum is 2,147,483,647. This
method searches all documents in a database. To search only documents
found in a particular view, use the DView.fullTextSearch(String, int)
method in View. To search only documents found in a particular document
collection, use the DDocumentCollection.fullTextSearch(String, int)
method in class DDocumentCollection
. If you don't specify any
sort options, you get the documents sorted by relevance score. If you ask
for a sort by date, you don't get relevance scores. A Newsletter object
formats its doclink report with either the document creation date or the
relevance score, depending on the sort options you use in the document
collection. If the database has a multi-database index, you get a
multi-database search. Navigation through the resulting document
collection may be slow, but you can create a newsletter from the
collection.
Query syntax
To search for a word or phrase, enter the word or phrase as is, except that search keywords must be enclosed in quotes. Remember to escape quotes if you are inside a literal. Wildcards, operators, and other syntax are permitted. For the complete syntax rules, see "Finding documents in a database" in Lotus Notes 6 Help.
fullTextSearchRange
in interface DDatabase
query
- The full-text query. See the "Query Syntax" for detailsmax
- The maximum number of documents you want returned from the
query. Set this parameter to 0 to receive all matching
documentssortopt
- Use one of the following constants to specify a sorting
option: DDatabase.FT_SCORES
,
DDatabase.FT_DATECREATED_DESCENDING
,
DDatabase.FT_DATE_DESCENDING
or
DDatabase.FT_DATE_ASCENDING
otheropt
- Use the following constants to specify additional search
options. To specify more than one option, use a logical or
operation: DDatabase.FT_FUZZY
or
DDatabase.FT_STEMS
start
- The starting document to return.
DDatabase.fullTextSearchRange(java.lang.String, int,
int, int, int)
public java.util.Iterator fullTextSearch(java.lang.String query)
See DDatabase.fullTextSearch(String, int, int, int)
for more details.
fullTextSearch
in interface DDatabase
query
- The full-text query. See the "Query Syntax" for details
DDatabase.fullTextSearch(java.lang.String)
public java.util.Iterator fullTextSearch(java.lang.String query, int max)
See DDatabase.fullTextSearch(String, int, int, int)
for more details.
fullTextSearch
in interface DDatabase
query
- The full-text query. See the "Query Syntax" for detailsmax
- The maximum number of documents you want returned from the
query. Set this parameter to 0 to receive all matching
documents (up to 5,000. See Usage)
DDatabase.fullTextSearch(java.lang.String, int)
public java.util.Iterator fullTextSearch(java.lang.String query, int max, int sortopt, int otheropt)
Usage
This method is the same the same as
DDatabase.fullTextSearchRange(String, int, int, int, int)
minus the start
parameter. If the database is not full-text indexed, this method works,
but less efficiently. To test for an index, use the
DDatabase.isFTIndexed()
property. To create an index on a local database,
use the DDatabase.updateFTIndex(boolean)
method. This method returns a
maximum of 5,000 documents by default. The Notes.ini variable
FT_MAX_SEARCH_RESULTS
overrides this limit for indexed
databases or databases that are not indexed but that are running in an
agent on the client. For a database that is not indexed and is running in
an agent on the server, you must set the TEMP_INDEX_MAX_DOC
Notes.ini variable as well. The absolute maximum is 2,147,483,647. This
method searches all documents in a database. To search only documents
found in a particular view, use the DView.fullTextSearch(String, int)
method in View. To search only documents found in a particular document
collection, use the DDocumentCollection.fullTextSearch(String, int)
method in class DDocumentCollection
. If you don't specify any
sort options, you get the documents sorted by relevance score. If you ask
for a sort by date, you don't get relevance scores. A Newsletter object
formats its doclink report with either the document creation date or the
relevance score, depending on the sort options you use in the document
collection. If the database has a multi-database index, you get a
multi-database search. Navigation through the resulting document
collection may be slow, but you can create a newsletter from the
collection.
Query syntax
To search for a word or phrase, enter the word or phrase as is, except that search keywords must be enclosed in quotes. Remember to escape quotes if you are inside a literal. Wildcards, operators, and other syntax are permitted. For the complete syntax rules, see "Finding documents in a database" in Lotus Notes 6 Help.
fullTextSearch
in interface DDatabase
query
- The full-text query. See the "Query Syntax" for detailsmax
- The maximum number of documents you want returned from the
query. Set this parameter to 0 to receive all matching
documents (up to 5,000. See Usage)sortopt
- Use one of the following constants to specify a sorting
option: DDatabase.FT_SCORES
,
DDatabase.FT_DATECREATED_DESCENDING
,
DDatabase.FT_DATE_DESCENDING
or
DDatabase.FT_DATE_ASCENDING
otheropt
- Use the following constants to specify additional search
options. To specify more than one option, use a logical or
operation: DDatabase.FT_FUZZY
or
DDatabase.FT_STEMS
DDatabase.fullTextSearch(java.lang.String, int, int,
int)
public boolean isDocumentLockingEnabled()
isDocumentLockingEnabled
in interface DDatabase
true
if document locking is enabled,
false
if document locking is not enabledDDatabase.isDocumentLockingEnabled()
public void setDocumentLockingEnabled(boolean flag)
setDocumentLockingEnabled
in interface DDatabase
flag
- true
if document locking is enabled,
false
if document locking is not enabledDDatabase.setDocumentLockingEnabled(boolean)
public boolean getFolderReferencesEnabled()
The database must have the $FolderInfo and $FolderRefInfo hidden views to support folder references. These views can be copied from the mail template. This property does not return view references.
The database must be at the Release 5 file format level or greater.
Maintaining folder references impacts performance.
getFolderReferencesEnabled
in interface DDatabase
true
maintains folder references,
false
doesn'tDDatabase.getFolderReferencesEnabled()
public void setFolderReferencesEnabled(boolean flag)
The database must have the $FolderInfo and $FolderRefInfo hidden views to support folder references. These views can be copied from the mail template. This property does not return view references.
The database must be at the Release 5 file format level or greater.
Maintaining folder references impacts performance.
setFolderReferencesEnabled
in interface DDatabase
flag
- true
maintains folder references,
false
doesn'tDDatabase.setFolderReferencesEnabled(boolean)
public java.util.List getViews()
getViews
in interface DDatabase
DDatabase.getViews()
public DForm getForm(java.lang.String name)
getForm
in interface DDatabase
name
- name of the form
DForm
DDatabase.getForm(java.lang.String)
public java.util.List getForms()
getForms
in interface DDatabase
DForm
DDatabase.getForms()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |