« 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.

Contact Me

Hire Me

Elsewhere

What the Quote?

"I don't need your book, I already know how to beat Trogdor."

Steven Rodgers

"You'll be just below the Bible Belt. So, anatomically speaking..."

Greg Rotz

"Then again, you're the only person I know who can sing like bagpipes."

Tim Tripcony

"'Cause by then we'll just think what we want to do, and we'll see it in our goggles."

Laura Tripcony

"Don't play chicken with ducks."

Steven Rodgers

Apparel

Lotus Rocks

I write the code that makes the young girls cry

Current Terror Alert Level

Assorted Linkage

ClustrMap