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:
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
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
provided by Julian Robichaux at nsftools.com.







