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!?
-
2Are you talking about catalog.nsf? That does have the template info. – Panu Haaramo Sep 11 '13 at 09:02
-
no no, on another one but it dose not mater on witch database – MihaiRO Sep 11 '13 at 09:11
2 Answers
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

- 11,795
- 18
- 34
-
no i am sorry you don't understand i am not creating this view on the catalog.nsf, so it wont work – MihaiRO Sep 11 '13 at 13:43
-
I am sorry, I REALLY don't understand... your answer to leyrer is: "TY so much this is awsome!!! the catalog.nsf will do the trick"... and your answer for me is: "i won't use the catalog"... – Tode Sep 11 '13 at 14:06
-
I thought it will but it seems that the guys i am doing this for don't want to go to that db to see the templates. sorry! – MihaiRO Sep 11 '13 at 14:35
-
Well then you should write code to copy the data from catalog.nsf to where they want to see it! – Richard Schwartz Sep 11 '13 at 18:25
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.

- 1,444
- 7
- 9