|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DDatabase
Represents a Notes database.
Field Summary | |
---|---|
static int |
FT_DATE_ASCENDING
Sorts by document creation date in ascending order. |
static int |
FT_DATE_DESCENDING
Sorts by document creation date in descending order. |
static int |
FT_DATECREATED_ASCENDING
Sorts by document date in ascending order. |
static int |
FT_DATECREATED_DESCENDING
Sorts by document date in descending order. |
static int |
FT_FUZZY
Specifies a fuzzy search. |
static int |
FT_SCORES
Sorts by relevance score. |
static int |
FT_STEMS
Uses stem words as the basis of the search. |
Method Summary | |
---|---|
DDatabase |
createDatabaseFromTemplate(java.lang.String serverName,
java.lang.String newDatabaseName,
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 filePath)
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 docId)
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. |
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. |
void |
updateFTIndex(boolean create)
Updates the full-text index of a database. |
Methods inherited from interface de.bea.domingo.DBase |
---|
equals, hashCode, toString |
Field Detail |
---|
static final int FT_SCORES
DDocument.getFTSearchScore()
property in Document.
static final int FT_DATE_DESCENDING
static final int FT_DATE_ASCENDING
static final int FT_DATECREATED_DESCENDING
static final int FT_DATECREATED_ASCENDING
static final int FT_FUZZY
static final int FT_STEMS
Method Detail |
---|
DSession getSession()
boolean replicate(java.lang.String server)
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 occurboolean remove()
true
if the database was removed successfully, else false
java.util.Iterator getAllDocuments()
DDocument getDocumentByUNID(java.lang.String docId)
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.
docId
- Universal ID of a document
null
if the document was not foundDDocument 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.
noteId
- NoteID
DProfileDocument getProfileDocument(java.lang.String profileName, java.lang.String profileKey)
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 foundDDocument createDocument()
DView getView(java.lang.String viewName)
viewName
- name of a view
java.lang.String getFilePath()
java.lang.String getFileName()
DDatabase createDatabaseFromTemplate(java.lang.String serverName, java.lang.String newDatabaseName, boolean inherit) throws DNotesException
serverName
- notes server namenewDatabaseName
- 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 createReplica(java.lang.String server, java.lang.String filePath) 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.
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.filePath
- The file name of the replica.
DNotesException
- if creation of the new replica failedint 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
DACL
java.lang.String getServer()
If the database is on a workstation, the property returns an empty string.
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.
name
- the name of the agent.
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.
true
if the database is a Domino Directory,
false
if the database is not a Domino Directoryboolean 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.
true
if the database is a Personal Address Book,
false
if the database is not Personal Address Bookboolean isOpen()
Usage
A database must be open to use the Database methods except:
getCategories()
,
isDelayUpdates()
,
getDesignTemplateName()
,
getFileName()
,
getFilePath()
,
isOpen()
,
isPrivateAddressBook()
,
isPublicAddressBook()
,
getSession()
,
getReplicaID()
,
getServer()
,
getSizeQuota()
,
getTemplateName()
, and
getTitle()
.
The following methods do not open a database: DbDirectory.getFirstDatabase, DbDirectory.getNextDatabase, and Session.getAddressBooks. You must explicitly call Database.open.
true
if the database is open,
false
if the database is not openboolean 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.
true
if the database exists and is opened,
false
if no database with this name existsjava.lang.String getCategories()
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.
true
if server delays updates,
false
if server posts updates immediatelyjava.lang.String getReplicaID()
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.
java.lang.String getTemplateName()
java.lang.String getTitle()
void setTitle(java.lang.String title)
title
- new database titlejava.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.
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.
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.).
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.
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.
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.
formula
- Notes @-function formula that specifies the selection criteria
boolean isFTIndexed()
true
if the database has a full-text index, else false
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.
create
- Specify true
if you want to create an index
if none exists (valid only for local databases). Otherwise,
specify false
.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
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 isFTIndexed()
property. To create an index on a local database, use the
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.
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: FT_SCORES
,
FT_DATECREATED_DESCENDING
,
FT_DATE_DESCENDING
or
FT_DATE_ASCENDING
otheropt
- Use the following constants to specify additional search
options. To specify more than one option, use a logical or
operation: FT_FUZZY
or
FT_STEMS
start
- The starting document to return.
java.util.Iterator fullTextSearch(java.lang.String query)
See fullTextSearch(String, int, int, int)
for more details.
query
- The full-text query. See the "Query Syntax" for details
java.util.Iterator fullTextSearch(java.lang.String query, int max)
See fullTextSearch(String, int, int, int)
for more details.
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)
java.util.Iterator fullTextSearch(java.lang.String query, int max, int sortopt, int otheropt)
Usage
This method is the same the same as
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
isFTIndexed()
property. To create an index on a local database,
use the 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.
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: FT_SCORES
,
FT_DATECREATED_DESCENDING
,
FT_DATE_DESCENDING
or
FT_DATE_ASCENDING
otheropt
- Use the following constants to specify additional search
options. To specify more than one option, use a logical or
operation: FT_FUZZY
or
FT_STEMS
boolean isDocumentLockingEnabled()
true
if document locking is enabled,
false
if document locking is not enabledvoid setDocumentLockingEnabled(boolean flag)
flag
- true
if document locking is enabled,
false
if document locking is not enabledboolean 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.
true
maintains folder references,
false
doesn'tvoid 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.
flag
- true
maintains folder references,
false
doesn'tjava.util.List getViews()
java.util.List getForms()
DForm
DForm getForm(java.lang.String name)
name
- name of the form
DForm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |