Replacing the design of a Lotus Notes template with that of a database (or making the database a template)

12,666

Solution 1

The "Replace design" dialog filters by extension. It only shows "Templates". Templates are defined as databases with the extension "ntf". They do NOT have to have template name assigned. Master Templates DO have a template name (properties of the database) and mostly are ntf files but they can also be nsf- files (as you already realized).

That is the difference between templates and master templates. In Addition "Templates" appear with a blue database- icon at the top of the list in the replace design- dialog, "Master Templates" have a green template- icon and appear below the list of "Templates". Therefor the list is divided in two separately sorted parts.

Databases created from templates loose their connection to the template after design replace, a "design refresh" afterwards is not possible anymore, for databases created from Master Templates you can choose whether to "Link" it to the template or not...

If you manually enter the Template- Name of your database (nsf or ntf), then you can refresh design (via menu or using a load design -f yourfile.nsf on the server console).

SO the answer to your main question is (as you already found out): Yes, a template can inherit its design from a database.

Now to Bonus 1: ntf- files are exactly the same as nsf- files (structurewise).. You can use them to store documents, profiles, whatever you want. You can not:

  • Open an ntf in a browser
  • See an ntf in the "Open Database"- Dialog in the Notes- Client
  • (Admin relevant only) Compact an ntf using placeholders without using -* as Parameter...

That is the only difference.

Having documents in a template can be a bonus: Every database you create from a template, contains all documents that have been in the template at that time. Like that you can "populate" some default configurations etc. for every new database you create. This copy only occurs ONCE when creating new databases, it does not occur with design replace / design refresh.

Response to your Edit: Just use "replace design" and give both nsfs a different template name. If you don't select "Inherit Future design changes" in the dialog, then the "Inherit design from master template - Template name" property of the ntf will not be set, it will not be "linked" to any of the development databases..

In fact: this is wrong, as I myself wrote above... NSFs will never appear in the "Replace Design"- Window... So the right solution for you will be:

  • News1.nsf has the Template name "News 1 Template"
  • News2.nsf has the Template name "News 2 Template"

If Designer 1 now needs to update the template then he does the following steps:

  1. Enter "News 1 Template" in the "Inherit Design From Master Template" field of newstemplate.ntf
  2. Use "File -> Application -> Refresh Design
  3. Remove TemplateName from newstemplate.ntf

Solution 2

With Refresh Design you can replace design from nsf to ntf.

Bonus 1: Not really because you cannot access ntf with a browser.

Bonus 2: The db property is called "Master template". In the Admin help you linked using a "template" means refreshing the design manually and "master template" means using the Designer server task to refresh the design.

To your edit: I think you need to have the master template field empty for both dev databases and set it when you want to refresh the design.

Share:
12,666
Øystein Grande Jaren
Author by

Øystein Grande Jaren

Software developer.

Updated on June 18, 2022

Comments

  • Øystein Grande Jaren
    Øystein Grande Jaren almost 2 years

    Short version: In Lotus Notes, is it possible to replace the design of a template with the design of a regular database? I tried to make the database a template, so it would show up in the Replace design dialog, but it does not.

    Long version: Let's say I have a template called NewsTemplate.ntf on my dev. server which replicates to staging and prod. servers on demand. I do all development work in a database DevNews.nsf on the dev. server, which enables me to easily test the application in the web browser during development. When I want to deploy changes, this starts with manually copy-pasting changes from DevNews.nsf to NewsTemplate.ntf. (Yuck...) I can use the comparison tool in Domino Designer to compare the two and copy changes file by file, but this feels overly cumbersome. What I want to do is simply to replace the design of NewsTemplate.ntf with that of DevNews.nsf.

    In the Replace design dialog only templates are listed, so it seems I have to make DevNews.nsf a template to do this. I checked the Database file is a master template checkbox in Application properties and entered the template name "DevNewsTemplate". However, it still does not show up in the list of templates in the Replace design dialog. I notice the database still has the file extension nsf. Is this the problem? Is there some other approach I should rather be taking to copy design changes from News.nsf to NewsTemplate.ntf

    Bonus question 1: Can a template contain documents and work just like a database, only it is also a template which is used to distribute design to other templates/databases?

    Bonus question 2: This site mentions templates and master templates, but it does not really explain what the difference between them is. What is the difference between a template and a master template? How do I make a template? How do I make a master template?

    Edit:

    Let's say instead of the single News.nsf database on the dev. server, there are two development databases called News1.nsf and News2.nsf, because there are two developers who need their own database to work in. Each developer has his News*.nsf (which resides on the dev. server) synchronized with an on-disk-project on his own PC, which is under source control with Git. The two developers' git repos keep in synch by pushing to/pulling from a central Git repo, so News1.nsf and News2.nsf are indirectly synchronized via this Git repo.

    Each developer needs to be able to copy changes from his News*.nsf to NewsTemplate.ntf. The solution suggested by Panu Haaramo (using Refresh design) requires me to set NewsTemplate.ntf to inherit design from "DevNewsTemplate", which is the master template name I set for News1.nsf. Obviously I cannot use the same master template name for News2.nsf, since it resides on the same dev. server as News1.nsf. How can I interchangeably copy design from either News1.nsf or News2.nsf to NewsTemplate.ntf?

    This figure should help with clarification:

    enter image description here