Overview Package Class Tree Serialized Deprecated Index Help PREV class NEXT class SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
com.lotus.cs
Class DominoServicejava.lang.Object com.lotus.cs.DominoService
- All Implemented Interfaces:
- CSBaseService
- public class DominoService
- extends java.lang.Object
- implements CSBaseService
DominoService is used to retrieve data (and, in some cases, write data) from (to) Domino databases. There are 3 types of DominoService methods as follows:
- Related to views (almost all methods use HTTP)
These methods are used to display data from views. All of the view-related methods require you to create a ViewInfo object to access data.
Example methods from ViewInfo are getColumnInfo, getRowInfo, getCalendarDayInfo
- Related to directory (get lists of information, often using IIOP or Domino LDAP)
For example, getServers, getDatabases, getEmailAddress, etc.
- Related to documents (most methods use IIOP)
For example, getDocumentInfo, createDatabase, createDocument, etc.
- See Also:
- ViewInfo
Method Summary boolean addACL(java.lang.String db, java.lang.String aclName, int Acltype, int AclAccessLevel)
Adds a single ACL to an existing database.void cleanup()
Always call the cleanup() method when finished with the Service object.boolean createDatabase(java.lang.String db, java.lang.String title, java.lang.String template)
Creates a new Domino database from a database template.java.lang.String java.util.HashMap)">createDocument(java.lang.String db, java.util.HashMap fields)
Creates a document in the db.boolean deleteDocument(java.lang.String db, java.lang.String view, java.lang.String unid)
Removes a document from the given databasejava.lang.String[] getCompleteDatabases(java.lang.String templateFilter)
Return a complete list of domino database names and or directories on the given server.java.lang.String getCompleteQuickPlaceComponents(java.lang.String database)
Return a list of QuickPlace components in a QuickPlace.java.util.HashMap getDatabases(java.lang.String templateFilter, java.lang.String startDirectory)
Return a list of domino database names and directory names in the specified start directory.java.util.HashMap getDatabaseViews(java.lang.String dbName)
Return a list of views in a given domino database.java.util.HashMap getDatabaseViewsWithAliases(java.lang.String dbName, boolean showHidden, boolean showCalendar)
Return a list of views in a given domino database.java.lang.String getDistinguishedName(java.lang.String userName)
Returns the distinguished name of the user.java.util.HashMap getDocumentInfo(java.lang.String db, java.lang.String View, java.lang.String unid, java.lang.String[] fields)
Returns values for fields in a document which are of type String.java.lang.String getDominoName(java.lang.String fullName)
Converts a distinguished name into a Domino name (also referred to as the Abbreviated name) For example, "OU=CAM,O=Lotus" will be converted to "/CAM/Lotus" Note that this is simply a helper method - there is no LDAP query made.java.lang.String getEditURL(java.lang.String db, java.lang.String view, java.lang.String unid, boolean validate)
Returns a URL to the specified document.java.lang.String getEmailAddress(java.lang.String userName)
Returns the email address of the user.java.lang.String[] getMailServerFile(java.lang.String userName)
Returns the names of the Domino mail file and mail server for a valid user in the domain.java.lang.String getOpenURL(java.lang.String db, java.lang.String view, java.lang.String unid, boolean validate)
Returns a URL to the specified document.java.lang.String[] getQuickPlaceComponents(java.lang.String database)
Return a list of QuickPlace components in a QuickPlace.java.lang.String[] getQuickPlaceDatabases()
Returns the list of QuickPlace databases.java.util.HashMap getServers()
Returns a list of domino servers in the domain which have the http-hostname attribute set.lotus.domino.Session getSessionObject()
Returns the Domino Java API Session object.ViewInfo getViewInfo(java.lang.String dbName, java.lang.String viewName)
Returns view information about a view, encapsulated in a ViewInfo object.void init(CSCredentials cred, java.lang.String server, java.lang.String protocol)
Do not call the init() method.boolean java.util.HashMap)">updateDocument(java.lang.String db, java.lang.String view, java.lang.String unid, java.util.HashMap fields)
Updates a document in the db.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Method Detail init
public void init(CSCredentials cred, java.lang.String server, java.lang.String protocol)
- Do not call the init() method. init is called internally by CSFactory as part of the getService.
- Specified by:
- init in interface CSBaseService
- See Also:
- CSBaseService.init(com.lotus.cs.CSCredentials, java.lang.String, java.lang.String)
cleanup
public void cleanup()
- Always call the cleanup() method when finished with the Service object.
- Specified by:
- cleanup in interface CSBaseService
- See Also:
- CSBaseService.cleanup()
getSessionObject
public lotus.domino.Session getSessionObject()
- Returns the Domino Java API Session object. Refer to the Domino Java API documentation for usage of this object. import lotus.domino.Session in order to use this method. Note that this method uses DIIOP and always returns null when the server is Domino version ViewInfo.DOMINO_46
- Returns:
- Domino Java Session object.
getCompleteDatabases
public java.lang.String[] getCompleteDatabases(java.lang.String templateFilter)
- Return a complete list of domino database names and or directories on the given server. Note that this method uses DIIOP and always returns null when the server is Domino version ViewInfo.DOMINO_46 Use
DominoService.getDatabases if either (a) db filenames (nsf names) on the server can contain the "&" character or (b) db filenames or titles can contain the '|' character or (c) you are using the templateFilter option and you wish to consider templates with names containing "R50" separate from those with names containing "R60".
- Parameters:
- templateFilter - OPTIONAL Only databases with this template will be returned. Use null otherwise. Note that using this option with a String such as "StdR50Disc" (for Discussion dbs), will also return the dbs made with the R60 template (in this example "StdR60Disc".
- Returns:
- String array with abc&xyz&xxxx.nsf|title as the value in each element where the '&' character is used to designate a directory name (i.e., in this example, the database file name is abc\xyc\xxxx.nsf) and the '|' character is used to separate nsf file name from database title.
- See Also:
- getDatabases(java.lang.String, java.lang.String)
getDatabases
public java.util.HashMap getDatabases(java.lang.String templateFilter, java.lang.String startDirectory)
- Return a list of domino database names and directory names in the specified start directory. Note that this method uses DIIOP and always returns null when the server is Domino version ViewInfo.DOMINO_46.
- Parameters:
- templateFilter - OPTIONAL Only databases with this template will be returned. Use null otherwise.
- startDirectory - A subdirectory to start from - null indicates the top level directory.
- Returns:
- HashMap with database names as key and title as value. When the title returned does not end in .nsf, this indicates a database directory name. To traverse this directory, call this method again using that directory name for startDirectory.
- See Also:
- getCompleteDatabases(java.lang.String)
getQuickPlaceDatabases
public java.lang.String[] getQuickPlaceDatabases()
- Returns the list of QuickPlace databases. Note that this method uses DIIOP and always returns null when the server is Domino version ViewInfo.DOMINO_46
- Returns:
- String array containing the names of the QuickPlace databases.
getQuickPlaceComponents
public java.lang.String[] getQuickPlaceComponents(java.lang.String database)
- Return a list of QuickPlace components in a QuickPlace. Note that this method uses DIIOP and always returns null when the server is Domino version ViewInfo.DOMINO_46
- Parameters:
- database - Full path of quickplace directory (EX: "QuickPlace\myQP")
- Returns:
- Array of QuickPlace components (Home,Welcome,Calender...)
- See Also:
- getCompleteQuickPlaceComponents(java.lang.String)
getCompleteQuickPlaceComponents
public java.lang.String getCompleteQuickPlaceComponents(java.lang.String database)
- Return a list of QuickPlace components in a QuickPlace. Note that this method uses DIIOP and always returns null when the server is Domino version ViewInfo.DOMINO_46
- Parameters:
- database - Full path of quickplace directory (EX: "QuickPlace\myQP")
- Returns:
- QuickPlace components (Home,Welcome,Calender...)
- See Also:
- getQuickPlaceComponents(java.lang.String)
getDatabaseViewsWithAliases
public java.util.HashMap getDatabaseViewsWithAliases(java.lang.String dbName, boolean showHidden, boolean showCalendar)
- Return a list of views in a given domino database. Note that this method uses DIIOP and always returns null when the server is Domino version ViewInfo.DOMINO_46
- Parameters:
- dbName - nsf name of the database to retrieve views from. Be sure to use either '\\' or '/' between folder names.
- showHidden - if true, include views that are hidden.
- showCalendar - if true, include views that are calendar views.
- Returns:
- HashMap with view names as key and aliases as value. When there is more than 1 alias, vertical bars are used as separators.
- See Also:
- getDatabaseViews(java.lang.String)
getDatabaseViews
public java.util.HashMap getDatabaseViews(java.lang.String dbName)
- Return a list of views in a given domino database. Return does not include hidden views and does return calendar views. Note that this method always returns null when the server is Domino version ViewInfo.DOMINO_46
- Parameters:
- dbName - nsf name of the database to retrieve views from. Be sure to use either '\\' or '/' between folder names.
- Returns:
- HashMap with view names as key and view unid as value.
- See Also:
- getDatabaseViewsWithAliases(java.lang.String, boolean, boolean)
getServers
public java.util.HashMap getServers()
- Returns a list of domino servers in the domain which have the http-hostname attribute set.
- Returns:
- HashMap Where the key is the Domino server name (distinguished name) and the value is the host name. e.g., name : CN = ecat-1, O = eCAT value: ecat-1.lotus.com The fully qualified domain name of a network host, or its IP address as a set of four decimal digit groups separated by ".".
getDominoName
public java.lang.String getDominoName(java.lang.String fullName)
- Converts a distinguished name into a Domino name (also referred to as the Abbreviated name) For example, "OU=CAM,O=Lotus" will be converted to "/CAM/Lotus" Note that this is simply a helper method - there is no LDAP query made.
- Parameters:
- fullName - The distinguished name (DN).
- Returns:
- String The Domino Name (Abbreviated format).
getMailServerFile
public java.lang.String[] getMailServerFile(java.lang.String userName)
- Returns the names of the Domino mail file and mail server for a valid user in the domain.
- Parameters:
- userName - The distinguished name (DN) or the Common Name (CN) of the user. If null is passed in, it will return the logged in user's mail server and file.
- Returns:
- String[] The first entry in the array is the mail host name. The Second entry in the array is the name of the mail file.
getEmailAddress
public java.lang.String getEmailAddress(java.lang.String userName)
- Returns the email address of the user.
- Parameters:
- userName - The distinguished name (DN) or the Common Name (CN) of the user. If null is passed in, it will return the logged in user's email address.
- Returns:
- String The internet email address of the user.
getDistinguishedName
public java.lang.String getDistinguishedName(java.lang.String userName)
- Returns the distinguished name of the user.
- Parameters:
- userName - The short name (uid) or the Common Name (CN) of the user. If null is passed in, it will return the logged in user's distinguished name.
- Returns:
- String The comma separated distinguished name of the user.
- See Also:
- CSCredentials.getUserName()
getViewInfo
public ViewInfo getViewInfo(java.lang.String dbName, java.lang.String viewName)
- Returns view information about a view, encapsulated in a ViewInfo object. Every call to this function returns a new object that represents the given view.
- Parameters:
- dbName - the nsf name of the database. Be sure to use either '\\' or '/' between folder names.
- viewName - the name of the view (can be alias).
- Returns:
- a ViewInfo object containing information about the specified view.
- See Also:
- ViewInfo
getDocumentInfo
public java.util.HashMap getDocumentInfo(java.lang.String db, java.lang.String View, java.lang.String unid, java.lang.String[] fields)
- Returns values for fields in a document which are of type String. Note that this method uses DIIOP and always returns null when the server is Domino version ViewInfo.DOMINO_46
- Parameters:
- db - Full path of NSF file
- unid - Document unid
- fields - array of field names
- Returns:
- name/value pairs of requested field names
java.util.HashMap)">updateDocument
public boolean updateDocument(java.lang.String db, java.lang.String view, java.lang.String unid, java.util.HashMap fields)
- Updates a document in the db. Where a field name is supplied which is not presently in the document, creates the new field in the document. Note that this method uses DIIOP and always returns false when the server is Domino version ViewInfo.DOMINO_46 This method will only update fields of type String.
- Parameters:
- db - Full path of NSF file
- view - NOT USED view name of document to locate
- unid - Document unid
- fields - array of field names. Only String Values allowed.
- Returns:
- true if the document was successfully updated.
deleteDocument
public boolean deleteDocument(java.lang.String db, java.lang.String view, java.lang.String unid)
- Removes a document from the given database
- Parameters:
- db - Full path of NSF file
- view - NOT USED view name of document to locate
- unid - Document unid
- Returns:
- true if the document was successfully deleted
java.util.HashMap)">createDocument
public java.lang.String createDocument(java.lang.String db, java.util.HashMap fields)
- Creates a document in the db. Note that this method uses DIIOP and always returns null when the server is Domino version ViewInfo.DOMINO_46
- Parameters:
- db - Full path of NSF file
- fields - array of field names
- Returns:
- String, UNID of the document or NULL if unable to create document
addACL
public boolean addACL(java.lang.String db, java.lang.String aclName, int Acltype, int AclAccessLevel)
- Adds a single ACL to an existing database. Note: for R5 Domino versions, the Access Control property called "Maximum Internet name & password" (Advanced setting) must be manually set to "Manager" level before this method will work. For Domino versions >= 6, when using this method after a call to DominoService.createDatabase, this manual setting is not required (since the createDatabase method will automatically set this setting to "Manager." Note that this method uses DIIOP and always returns false when the server is Domino version ViewInfo.DOMINO_46
- Parameters:
- db - Full path of NSF file
- aclName - String name of acl. For a hierarchical name, the full name must be specified but can be in abbreviated format.
- Acltype - one of DOMINO defines ACLEntry (Ex ACLEntry.TYPE_MIXED_GROUP).
TYPE_MIXED_GROUP
TYPE_PERSON
TYPE_PERSON_GROUP
TYPE_SERVER
TYPE_SERVER_GROUP
TYPE_UNSPECIFIED- AclAccessLevel - one of DOMINO defines ACL (Ex ACL.LEVEL_MANAGER)
LEVEL_NOACCESS
LEVEL_DEPOSITOR
LEVEL_READER
LEVEL_AUTHOR
LEVEL_EDITOR
LEVEL_DESIGNER
LEVEL_MANAGER- Returns:
- true if successful or false otherwise
createDatabase
public boolean createDatabase(java.lang.String db, java.lang.String title, java.lang.String template)
- Creates a new Domino database from a database template. Note that this method uses DIIOP and always returns false when the server is Domino version ViewInfo.DOMINO_46 Note also that the title will not be set on Domino versions < R6!
- Parameters:
- db - the name for the database (nsf file name)
- title - the title for the database (this part of the functionality does not work on Domino versions < 6).
- template - the template name for the database (ntf file name)
- Returns:
- true if database was created or it existed; false otherwise
getOpenURL
public java.lang.String getOpenURL(java.lang.String db, java.lang.String view, java.lang.String unid, boolean validate)
- Returns a URL to the specified document. Especially useful when server protocol is unknown.
- Parameters:
- db - the name for the database (nsf file name)
- view - String, the name of the view
- unid - String, the UNID of the document (could be returned by RowInfo.getUNID or EntryInfo.getUNID)
- validate - boolean, whether or not to check if the returned url is valid. In most cases, use 'false' here since this is a significant performance hit to test this connection. Note: with https, the test might fail even if the connection is, in fact, valid. Note that validation does not include an authorization check.
- Returns:
- fully-formed URL to the Domino Open action for the specified document (or null if validate specified as 'true' and the test connection failed).
getEditURL
public java.lang.String getEditURL(java.lang.String db, java.lang.String view, java.lang.String unid, boolean validate)
- Returns a URL to the specified document. Especially useful when server protocol is unknown.
- Parameters:
- db - the name for the database (nsf file name)
- view - String, the name of the view
- unid - String, the UNID of the document (could be returned by RowInfo.getUNID or EntryInfo.getUNID)
- validate - boolean, whether or not to check if the returned url is valid. In most cases, use 'false' here since this is a significant performance hit to test this connection. Note: with https, the test might fail even if the connection is, in fact, valid. Note that validation does not include an authorization check.
- Returns:
- fully-formed URL to the Domino Edit action for the specified document (or null if validate specified as 'true' and the test connection failed).
Overview Package Class Tree Serialized Deprecated Index Help PREV class NEXT class SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.