Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  


Force Client Homepage Automatically SOLVED!!!
Andy Conn 29.Apr.02 11:36 AM a Web browser
Notes Client -- Other 5.0.9a; 5.0.9; 5.0.8; 5.0.7a; 5.0.7; 5.0.6a; 5.0.6; 5.0.5; 5.0.4a; 5.0.4; 5.0.3; 5.0.2c; 5.0.2b; 5.0.2a; 5.0.2; 5.0.1c; 5.0.1b; 5.0.1a; 5.0.1; 5.0b; 5.0a All Platforms

Please email me @ aconn@anent.com for more help (code snipits etc) on this or to point me in the direction of anyone needing Notes consulting! Also, this is a long post and I am pressed for time, so I apologize for not being more thorough about this solution, but please don't hesitate to email.

Problem:
=======================
1) You want to force every user in your organization to startup to the same home page (preferabley a corporate portal type app).
2) You want to make this happen automatically without having to manually touch each client installation.
3) You want to override any attempt by the user to change the homepage.
4) You DON'T want to destroy your user's current Bookmarks in this process.

Solution:
1) For my example, I wanted to add a new Bookmarks welcome page that could be centrally modified and maintained. For this I followed pretty much the Iris Today example: http://www-10.lotus.com/ldd/today.nsf/62f62847467a8f78052568a80055b380/0f3d43d63f9dd816852567f90067a7cb?OpenDocument&Highlight=0,welcome,page

2) I wanted to install the new welcome page without asking everyone to delete and recreate their bookmark.nsf from the new server bookmark.ntf template. To solve this, I modified the MAIL5.NTF Memo form and added code to check once a day if the Bookmark.nsf has already been updated.

3) I use the DBDESIGN script library to read the corporate welcome frameset from the Bookmark.ntf and write it into the client Bookmark.nsf. Look in the sandbox for DBDESIGN. Here is a code snipit:

Dim bookmarkDB As New NotesDatabase("","Bookmark.nsf")
Dim dbookmarkDB As New NotesDatabase("MyServer","Bookmark.ntf")

Dim bookmarkDesignObj As databaseDesign
Dim dBookmarkDesignObj As databaseDesign
Set bookMarkDesignObj = createDatabaseDesign(bookmarkDB)
Set dBookmarkDesignObj = createDatabaseDesign(dBookmarkDB)

' Now copy over the CorpWelcomeFrameset
Set doc = dbookmarkDesignObj.GetFrameSetbyName("CorpWelcomeFrameset")
Set tmpDoc = doc.copytodatabase(bookmarkDB)

Then I also copy over the corpWelcome layout document:

' Now copy over the layout:
Set luview = dbookmarkDB.getview("(Layouts)")
Set doc = luview.getdocumentbykey("00000000")
Set tmpDoc = doc.copytodatabase(bookmarkDB)

4) In addition, I want to modify the database intialize script on the client Bookmark.nsf to always reset to the Corp welcome page when the user launches Notes. In the same block of code above, I do the following:

' First delete databasedesign from bookmarks:
designObjects = bookmarkdesignObj.databaseScriptDocuments
If Isarray(designObjects) Then
Forall obj In designObjects
Call obj.remove(True)
End Forall
End If

' Now get new databasedesign and copy over
designObjects = dbookmarkdesignObj.databaseScriptDocuments
Forall obj In designObjects
Set tmpDoc = obj.copytodatabase(bookmarkDB)
End Forall

** The initialize code looks like this:
' Switch welcome page to corporate:
Dim ws As New notesuiWorkspace()
varble = Evaluate({@Word(availablelayouts;"|";2)},ws.currentdocument.document)
ws.currentdocument.document.selectLayout = varble(0)
Call ws.currentdocument.refresh

5) The last trick was to turn off any other Bookmark that the user might've set as the home page using the right-click "Set bookmark as homepage" command. Kudo's to Rod Whiteley for pointing me in the right direction for this:
http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/52728c68934a48dc80256ab1004aa5c9?OpenDocument

The trick to turning off the "flag" Rod mentions is to simply recreate the Outline. In the same POSTOPEN event as above, I also run this code to recreate the outline (yet still preserving the user's bookmarks):

Dim outline As NotesOutline
Dim olEntry As NotesOutlineEntry
Dim newEntry As notesOutlineEntry
Dim nextEntry As NotesOutlineEntry
Dim parentEntry As NotesOutlineEntry
Dim goFromEntry As NotesOutLineEntry
Set Outline = bookmarkDB.GetOutline( "UserBookmarkOrder")
Set nextEntry = Outline.getFirst()
Do Until nextEntry Is Nothing
Set olEntry = nextEntry
' create Copy
Print "Checking " & olEntry.Label
If Not(olEntry.hasChildren) Then
Set parentEntry = outline.GetParent(olEntry)
If parentEntry Is Nothing Then
'Print olEntry.Label & "Has no parent so will create as sibling that is being removed"
Set newEntry = Outline.CreateEntryFrom(olEntry,olEntry,False,False)
'Set goFromEntry = newEntry
Else
'Print olEntry.Label & "Has parent: " & parentEntry.Label & " so will create as child after that parent"
Set newEntry = Outline.CreateEntryFrom (olEntry,parentEntry,True,True)
End If

' get next entry and delete old entry
Set nextEntry = Outline.getnext(olEntry)
Call Outline.RemoveEntry(olEntry )
Else
'Print olEntry.Label & " has children so will skip re-creating it"
Set nextEntry = Outline.getnext(olEntry)
End If
Loop
Call outline.save()




Force Client Homepage Automatically... (Andy Conn 29.Apr.02)
. . Set bookmark as homepage automatica... (Andy Conn 29.Apr.02)
. . . . Set welcome page automatically (Andy Conn 29.Apr.02)
. . RE: Force Client Homepage Automatic... (Jens Leth-Nisse... 6.Oct.04)
. . . . RE: Force Client Homepage Automatic... (j j riley 7.Oct.04)
. . . . RE: Force Client Homepage Automatic... (j j riley 7.Oct.04)
. . RE: Force Client Homepage Automatic... (Paula Silva 26.Sep.05)






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search


 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow