Question

I need to create a view in a BD(a admin db kinnd) that shows me the template version of all the other databases! can anyone help me with this please!?

Was it helpful?

Solution

You don't need to create a database for this purpose, there is already one. It is called "catalog.nsf" and contains the Information you want. You just need to create a view and modify the selection- formula slightly: Original:

SELECT  @IsAvailable(ReplicaID)& @IsUnavailable(RepositoryType)& !(DBListInCatalog = "0")

New:

SELECT  @IsAvailable(ReplicaID)& @IsUnavailable(RepositoryType)

That way you see all databases, even the ones that normally are not visible in catalog.

The information you are looking for is in the "DbInheritTemplateName"- Field.

If you want to code this yourself, you can either run through all documents in the catalog.nsf and read it from there or you use a NotesDBDirectory, run through it and read the "DesignTemplateName"- property of NotesDatabase- Class.

Example code for catalog:

Dim dbCatalog as NotesDatabase
Dim dc as NotesDocumentCollection
Dim doc as NotesDocument
Dim strTemplate as String
Set dbCatalog = New NotesDatabase( "YourServerName" , "catalog.nsf" )
Set dc = dbCatalog.Search( "@IsAvailable(ReplicaID)& @IsUnavailable(RepositoryType)", Nothing, 0 )
Set doc = dc.GetFirstDocument()
While not doc is Nothing
    strTemplate = doc.GetItemValue( "DBInheritTemplateName" )(0)
    '- do whatever you want: create a document in your database, create a list...
    Set doc = dc.GetNextDocument(doc)
Wend

Example code for NotesDBDirectory

Dim dbDirectory as New NotesDBDirectory( "YourServerName" )
Dim db as NotesDatabase
Dim strTemplate as String

Set db = dbDirectory.GetFirstDatabase( DATABASE )
While not db is Nothing
    strTemplate = db.DesignTemplateName
    '- do whatever you want: create a document in your database, create a list...
    Set db = dbDirectory.GetNextDatabase
Wend

OTHER TIPS

As Panu stated, a database catalog provides a list of all databases on a server. You use the server Catalog task to create a database catalog. The Catalog task bases the catalog file (CATALOG.NSF) on the CATALOG.NTF template and adds the appropriate entries to the catalog's ACL. All databases on a server are included in the catalog when the Catalog task runs.

To help users locate databases across an organization, or to keep track of all the replicas for each database, you must set up a Domain Catalog -- a catalog that combines the information from the database catalogs of multiple servers -- on one of your servers. You can set up a Domain Catalog regardless of whether you plan to implement Domino's Domain Search capability.

Besides allowing users to see what databases are on a particular server, catalogs provide useful information about databases. For each database in a view, a Database Entry document provides information such as file name, replica ID, design template, database activity, replication, full-text index, and ACL, as well as buttons that let users browse the database or add it to their bookmarks. In addition, the document displays a link to the database's Policy (About This Database) document, which, for databases users are not authorized to access, they can view by sending an e-mail request to the database manager.

See the Domino Admin Help for more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top