Showing posts with label lotus notes. Show all posts
Showing posts with label lotus notes. Show all posts

Wednesday, March 25, 2009

Creating a Bookmark Icon for Your Domino Website

We all see those little icons next to your Favorite/Bookmark websites in your browser. Pretty cool, huh?

Here are the steps to make your own Bookmark Icon for your Domino website/application.

1. Create your graphic/logo and don't worry about the 16 x 16 pixel limit
2. Open this website:
http://www.html-kit.com/favicon/
3. This website will allow you to upload your graphic and it will size it to the 16 x 16 pixel limit
4. Follow the instructions to upload your graphic
5. When the "shrunk" graphic appears, follow the instructions on the screen and download the .zip file that is created.
6. Extract the "favicon.ico" file from the zip file
7. Open your database in Domino Designer
8. Add this .ico file to the Shared Resource > Files
9. Add the following code to each Form's HTML Head Content (NOTE: Replace the "[]" with "<>" --- blog would not post with the "<>", thought it was actual HTML):
"[link rel=\"shortcut icon\" href=\"/" + @WebDbName + "/favicon.ico?OpenFileResource\"]"
10. Test it out!

I have tested this in IE 6x and Firefox 3.0.x, using Domino Designer 7.x and it works fine.

What about adding to the Shared Resources > Images?
Glad you asked that... In Domino Designer 7 (and 6 and 5), you can only add .jpg, .gif, or .bmp types. So, add to the File Resources and you get the end result you wanted.

Hope this helps...

Tuesday, September 16, 2008

Finding and flagging "orphan" documents

A recent project that I was on had an issue with a user who happened to copy documents and paste them back into the database and then delete the original --- as quoted, the user said "the database was slow, so I was trying to shake things up."

Well, little did this user know that these were documents that had children/response documents associated with them. Now that the parent/child relationship was broken, the users were not too happy about this.

First, I had to find all the orphan docs before I associated them. So I wrote this little function which worked out pretty well:

Function IsOrphan(docResponse As NotesDocument) As Integer

Dim s As New NotesSession
Dim db As NotesDatabase
Dim docParent As NotesDocument
Dim docUNID As String
Dim parentUNID As String
Dim parentUNIDLength As Integer

Set db = s.CurrentDatabase
IsOrphan = False

'Check to see if this doc is really a response...
If docResponse.IsResponse Then
Else
Exit Function
End If

parentUNID = docResponse.ParentDocumentUNID
parentUNIDLength = Len(parentUNID)

Select Case parentUNIDLength
Case 32
Set docParent = db.GetDocumentByUNID(parentUNID)
If docParent Is Nothing Then
IsOrphan = True
Else
'Is the doc valid?
If docParent.IsValid = True Then
'See if this doc is a deletion stub...
If docParent.IsDeleted = True Then
IsOrphan = True
Else
docUNID = docParent.UniversalID
'Check to see if they are the same... [idiot check]...
If docUNID = parentUNID Then
Else
IsOrphan = True
End If
End If
Else
'Not valid...
IsOrphan = True
End If
End If

Case 1 To 31
'Parent UNID is not a UNID...
IsOrphan = True

Case 0
'Response, but no Parent UNID...
IsOrphan = True

End Select

End Function

Thought I would share this...