Search

What the Quote?

"Or, maybe he's just as passionate about whatever it is he's talking about as I am about robot nausea."

Tim Tripcony

"When I tell you something is broken, it will be broken until I tell you it's fixed. No matter how many times you ask."

Kathy Brown

"Hey lady, your flowers are broken."

Random Hummingbird

« Aw, Snap! | Main| Chaining methods in LotusScript »

Changing read-only database settings with DXL

Category show-n-tell thursday
In today's episode, we'll take a look at how DXL lets us easily update database settings that are typically considered read-only.

For example, in both LotusScript and Java the design template name is a read-only property of a database. The Notes API can of course be used to tweak this setting, but there's an easier way: a DXL import. The following routine illustrates how this can be done:

Public Sub SetDesignTemplateName (p_dbTarget As NotesDatabase, Byval p_strTemplateName As String)  Dim sesCurrent As New NotesSession  Dim dxliDatabaseProperties As NotesDXLImporter  Dim strmDXL As NotesStream  Set strmDXL = sesCurrent.CreateStream()  Call strmDXL.WriteText(|<?xml version='1.0' encoding='utf-8'?> <database title='| & p_dbTarget.Title &_  |' replicaid='| & p_dbTarget.ReplicaID &_  |' fromtemplate='| & p_strTemplateName & |' />|)  Set dxliDatabaseProperties = sesCurrent.CreateDXLImporter(strmDXL,p_dbTarget)  Let dxliDatabaseProperties.ReplaceDBProperties = True  Call dxliDatabaseProperties.Process() End Sub
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.