Wipe them out - all of them (when a design refresh doesn't work)
You created that shiney new version of your application, ran (in no particular order) fixup, compact and updall and replaced the design. Still some of the design elements haven't updated. Typically that happens when no attention was paid to the "prohibit design refresh" flag of the database design (all your predecessor's fault of course).While you can go in and hunt the settings down one-by-one (tip: use an DXL export and just look for the property), it is sometimes faster and more profound to strip the offending database(s) from their design entirely before applying the "Replace Design" action.
To do that I use a script in my little universal toolbox. A word of caution:
- Use it at your own risk
- Backup the database beforehand
- Check in Domino Designer's "Navigator view" (the Eclipse panel, not a Notes view) that they are all gone
- You have been warned
Class DesignWiper
Description: Wipes out entire design of a database
DEADLY for any folders that are user created
DEADLY on templates
Use at your own risk!
%END REM
Public Class DesignWiper
private db As NotesDatabase
%REM
Sub New
Description: The database is handed over in the constructor
%END REM
Sub New(dbToWipe As NotesDatabase)
Set me.db = dbToWipe
End Sub
%REM
Sub wipeDesign
Description: Wipes all design, might spare folders
%END REM
Public Sub wipeDesign(preserveFolders As Boolean)
Dim morituri As NotesNoteCollection
Dim curId As String
Dim nextId As String
If me.thisIsATemplate() Then
MsgBox "I won't kill a template"
Exit sub
End If
'Select all elements and walk backwards
Set morituri = db.Createnotecollection(true)
Call morituri.Selectalladminnotes(false)
Call morituri.Selectalldatanotes(false)
If preserveFolders Then
morituri.Selectfolders = false
End If
Call morituri.Buildcollection()
curId = morituri.Getfirstnoteid()
Do Until curId = ""
nextId = morituri.Getnextnoteid(curId)
Call me.wipeOne(curId)
curId = nextId
Loop
MsgBox "It is done, please run fixup, compact and design replace"
End Sub
%REM
Sub wipeOne
Description: Wipes one design element
might go wrong, so the error handler skips it
%END REM
Private Sub wipeOne(Noteid As String)
Dim doc As NotesDocument
On Error GoTo Err_wipeOne
Set doc = me.db.Getdocumentbyid(Noteid)
If Not doc Is Nothing Then
Call doc.Remove(true)
End if
Exit_wipeOne:
Exit Sub
Err_wipeOne:
Print "Error removing " & NoteId & "(Error: " & CStr(Err) & " - " & Error$
Resume Exit_wipeOne
End Sub
%REM
Function thisIsATemplate
Description: checks if the database is a template
%END REM
Private Function thisIsATemplate As Boolean
thisIsATemplate = (db.Templatename <> "")
End Function
End Class






Comments
Posted by Stephan H. Wissel At 01:55:30 On 04/06/2012 | - Website - |
{ Link }
If I remember correctly, it might not work on all the items that's only visible from Package Manager (java code/properties files/etc).
Posted by Tommy Valand At 18:46:13 On 04/10/2012 | - Website - |
@Sami: Could you elaborate how a version control system helps with failed design replacement? The version control can house all the various templates - but that's not the problem here.
Posted by Stephan H. Wissel At 16:49:59 On 04/07/2012 | - Website - |
Posted by Stephan H. Wissel At 23:11:43 On 04/07/2012 | - Website - |
Posted by sami At 14:10:38 On 04/07/2012 | - Website - |
I asked my technical consltant, and this is how he responds:
"We use a combination of DXL & ANT script (we coded a custom ANT task) to automate deployment from a source control tool"
I'm hoping it answers..he is external consultant and he helping us with domino issues...he brings some tools for us..
Posted by sami At 21:23:57 On 04/07/2012 | - Website - |
In that case, all the old design elements return from the death and you have everything twice (I'm seeing this in the MindPlan developer databases every few months).
For 8.5.3, I guess this can be avoided by using the new PIRC feature:
{ Link }
Posted by Karsten Lehmann At 22:23:43 On 04/05/2012 | - Website - |
Posted by Eric Mack At 02:39:45 On 04/06/2012 | - Website - |
Posted by Stephan H. Wissel At 02:13:43 On 04/06/2012 | - Website - |
In your experience, is there an advantage to one approach over the other?
Posted by Eric Mack At 02:05:11 On 04/06/2012 | - Website - |
I use a varation of this. I replace the current design with a template called "blank".
I then inspect the design to see what is left behind because of the prohibit flags and delete those elements manually.
I then go to the proper template and the latest dev build, check those same design elements for the prohibit flag ( which is often still there ) and correct those settings before applying the template.
Doing it this way sorts the problem out for the future.
Posted by Sean Cull At 22:20:44 On 04/06/2012 | - Website - |