Search

Mobile tag

About Me

I am the "IBM Collaboration & Productivity Advisor" for IBM Asia Pacific. I'm based in Singapore.
Reach out to me via:
Follow notessensei on Twitter
(posts)
Skype
Sametime
IBM
Facebook
LinkedIn
XING
Amazon Store
Amazon Kindle

Twitter

Domino Upgrade

VersionSupport end
5.0
6.0
6.5
7.0
Upgrade to 8.5x now!
(see the full Lotus lifcyle) To make your upgrade a success use the Upgrade Cheat Sheet.
Contemplating to replace Notes? You have to read this! (also available on Slideshare)

Languages

Other languages on request.

Visitors

Useful Tools

Get Firefox
Use OpenDNS
The support for Windows XP is coming to an end and has . Time to consider an alternative to move on. sounds like a lot of time, but, like an object in a mirror, it is closer than you think.

« Story Telling | Main| Inside the IBM Support Process »

Wipe them out - all of them (when a design refresh doesn't work)

QuickImage 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
As usual YMMV
%REM
    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

Gravatar Image1 - @Karsten: agree. What I usually do: make sure the ones who have Designer access are responsible (what an assumption <rofl>). With lower access design wouldn't get replicated back. And I use the catalog to find all server databases and blow the design on all of them. As you mentioned: in 8.5.3 it gets easier with PIRC (wasn't that the name of the captain in Star Wreck: In the Pirkinning)
Emoticon stw

Gravatar Image2 - In 8.5.3, there's a simple way to toggle "Prohibit design refresh" for all design elements.

{ 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).

Gravatar Image3 - @Eric: if the 'blank template method works on 'prohibit design refresh', then you would loose all your folders when applying that to a mail database. Is that so?

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

Gravatar Image4 - @Sami: Get him to blog about it, sounds interesting

Gravatar Image5 - i simply use version control system for problems like this..it is much easier.

Gravatar Image6 - i'm a manager and don't know technical things much.. sorry.

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

Gravatar Image7 - Really funny things can happen if you delete design elements, wait a few months or years depending on the settings of the database and then somebody comes along and replicates the database with an old replica.

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 }

Gravatar Image8 - Thanks, Stephan, I've seen this done successfully and used it myself. Notes simply sees the element as not existing so it removes it. (Perhaps design replace only applies to replace, not remove). But, I agree, there's probably a more thorough way to do it. In any case, thanks for the post.

Gravatar Image9 - @Eric: When a design element for whatever reason is set to "prohibit design refresh" any replace template won't overwrite it (at least that is how it is advertised). Also when you inherit design elements individually from other templates wiping is the only save way to get rid of them.

Gravatar Image10 - Some of our users accomplish this by creating a new template with no design elements and using that to replace the design of the suspect file. Net result is it removes design elements not in the template.

In your experience, is there an advantage to one approach over the other?

Gravatar Image11 - @Erik,

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.

Post A Comment

Please note: Comments without a valid and working eMail address will be removed. This is my site, so I decide what stays here and what goes.

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::rolleyes:;-)

Disclaimer

This site is in no way affiliated, endorsed, sanctioned, supported, nor enlightened by Lotus Software nor IBM Corporation. I may be an employee, but the opinions, theories, facts, etc. presented here are my own and are in now way given in any official capacity. In short, these are my words and this is my site, not IBM's - and don't even begin to think otherwise. (Disclaimer shamelessly plugged from Rocky Oliver)
© 2003 - 2013 Stephan H. Wissel - some rights reserved as listed here: Creative Commons License
Unless otherwise labeled by its originating author, the content found on this site is made available under the terms of an Attribution/NonCommercial/ShareAlike Creative Commons License, with the exception that no rights are granted -- since they are not mine to grant -- in any logo, graphic design, trademarks or trade names of any type. Code samples and code downloads on this site are, unless otherwise labeled, made available under an Apache 2.0 license. Other license models are available on written request and written confirmation.