How to create a template with hidden design?

That’s my simple question.In R5 I did it like that:

Create a database, checked “database is a tepmlate”, specified a template name and did a replace design with itself hiding formula & script.

In Notes 6 i’m not able to do that. When I replace the design of a database the information that the database is a template gets lost.

regards

thomas

Subject: Is this a proper way to create a template with hidden design?

I have another question related to my first one:Is the way I described above a proper way to create a template with hidden design?

Some developers criticized me that what i do was very risky (no one told me why, unfortunately).

I never had problems with it but i don’t want to run in problems either.

Is the method i use risky?

Subject: How to create a template with hidden design?

That’s right; sorry.

I guess you could write C API code to assign this property of the database. Not sure how well it would function as a template with Notes 6, however.

Subject: That’s not very nice

Thank you for your answer, Andre.Does this feature work as designed? Is it a known bug? I couldn’t find anything about it, yet.

Well, let’s do some API programming. yippee.

Subject: RE: That’s not very nice

It’s working as designed, but one might argue that the design choice was non-optimal.

This involves a fix for a problem in Notes 5, whereby if you replaced design with hiding but left the inherit changes option enabled, then the design task would unhide all your design elements later, while still making it appear that the design was securely hidden. It’s very simple to unhide the design of such a database, so this was treated as a security issue.

The way that the development team chose to fix this, involved disabling the ability to produce a template with hidden design.

I can see that this ability would be handy for companies developing Notes applications as products. I have already so argued, but I myself am not a business partner developing products, so I can only use logic. I’m not in a position to make a persuasive business case for it.

If anyone who has run into this problem is attending Lotusphere, the Meet the Developers session would be a good time to bring this up to the people who make these decisions, and let them see how many people in the audience agree.

Subject: this was fixed in 6.03

I was able to resolve the issue Andre describes in 6.03. If you are still having an issue with 6.03, let me know.

thanks

Maureen Leland

Domino Designer

Subject: RE: this was fixed in 6.03

The issue that Andre describes seems to be something to do with hidden designs.The issue that Thomas describes has nothing to do with hidden designs. Thomas happens to hide the design, but the problem occurs whether or not you hide the design.

Which of these issues are you referring to?

Subject: RE: this was fixed in 6.03

I was describing the fix to the problem of not being able to have a template with hidden design. I’ll investigate the other problem!!

Subject: i’ll check it

Thank you very much for the information Maureen.I will check my version and post again here, if it is 6.03 but does not work.

I also tried it with “Release 6.5 September 26, 2003” (cant find a minor version number anywhere).

It doen’t work there.

Subject: RE: i’ll check it

the bug fix (for not being able to do a refresh design with a template with hidden design) was also in 6.5. So you are looking at a different issue than Andre and I first thought!

Subject: Thank you for your answer!

Subject: How to create a template with hidden design?

This bug occurs whether or not you hide the design, and whether or not you replace the template’s design from itself.To work around it, first set the “Inherit design from master template” property, specifying the template name, (in addition to the “Database file is a master template” property).

You will end up with “Inherit design from master template” set whether you want it or not, even if you uncheck “Inherit future design changes” when you replace the design.

Subject: RE: How to create a template with hidden design?

This bug occurs whether or not you hide the design, and whether or not you replace the template’s design from itself.

Thank you for pointing that out, Rod.

you’re right.

You will end up with “Inherit design from master template” set

The problem is, that i don’t want to end up with the “Inherit design from master template” but with the “Database file is a master template” set.

Subject: RE: How to create a template with hidden design?

Then it looks like you get to write some code after all. Something like this, perhaps (or you could adapt the API code here if you prefer):

 Dim stream As NotesStream
 Set stream = session.CreateStream
 stream.WriteText {<database

xmlns=‘http://www.lotus.com/dxl

version=‘6’

templatename=‘MyTemplateName’

fromtemplate=‘’>

}

 Set db = New NotesDatabase("MyServer", "MyTemplate.ntf")
 
 Dim mp As NotesDXLImporter
 Set mp = session.CreateDXLImporter(stream, db)
 With mp
      .ReplaceDbProperties = True
      .Process
 End With

Subject: Ay caramba!

Wow! That’s a very sophisticated and brilliant solution.I thought about such banal solutions like using the C-API for editing the properties directly or for opening the design and after manually editing it closing it again. And then you come up with this one. I like it very much.

Thanks Rod.

Subject: RE: Ay caramba!

I like better the banal solution below (besides it works in R5 also):ndb.Title = ndb.Title & Chr$(10) & “#2” & “MasterTemplateName”

But I must admit that Rod’s solution is really elegant; ND6 and XML export/import has greatly pushed back the boundaries of what we can easily achieve.

Subject: I’m not worthy!

I’m not worthy! I’m not worthy. Another astonishing solution. Thanks for this one-liner, Normunds.You seem to be a pragmatist.

Unfortunately this doesn’t solve my problem, because I need to specify the Template name of the DB itself and not the name of the Template it inherits from.

I’ a little pragmatic, too and tried this:

ndb.Title = ndb.Title & Chr$(10) & “#3” & “MyTemplateName”

and it works fine.

Thanks again.

Subject: RE: I’m not worthy!

er, it could be #1I do not remember ever seen #3 around… but I could be mistaken.

Subject: you are so right. it must be #1

Subject: RE: How to create a template with hidden design?

If you do this, make sure you set the database launch properties, too. If they’re not included in your DXL stream, you’ll reset them to the standard “open to last view” for the database. I messed up a whole bunch of mail files like this once. :slight_smile: