Customize Mail Rules set-up to use with with non-mail database

0 pts.
Tags:
Development
Lotus Domino
LotusScript
I would like to be able to use a similar tool as Mail Rules in a Notes App to screen/filter out various words when anonymous users submit a form or bulletin. With modifications to a duplicate mail rule functions, (ie changing condition keyword like 'Subject' to 'Topic' etc., to filter certain words on fields used in other Notes application), I take it that this will not work in non-mail notes applications because this is triggered by the mail router. Right? Has anyone been successful in doing this or is there a better way. Would like certain users to maintain rules for the db. Mostly Notes clients.
ASKED: April 6, 2006  8:01 AM
UPDATED: April 6, 2006  8:54 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

I think this what you mean, never played with the router, developer see.

Sub Censor(ndDiscussion As NotesDocument)
%REM
Purpose:
Not for the faint hearted, this sub replaces swear words with asterisks (*) in the
Body and Subject fields of the discussion forum docments.
Partial word stemming with find and replace to next space Chr(32).
%END REM

Dim intExpletive As Integer, i As Integer
Dim strFieldContents As String, strAstericks As String

Dim aryExpletives(6) As String
‘To update banned word list, simply declare
‘words changed to protect the innocent
another array element
aryExpletives(1) = “Word1″
aryExpletives(2) = “Word2″
aryExpletives(3) = “Word3″
aryExpletives(4) = “Word4″
aryExpletives(5) = “Word5″
aryExpletives(6) = “Word6″

Forall e In ndDiscussion.Items
If (e.Name = “Subject” Or e.Name = “Body”) Then
Select Case e.Type
Case TEXT: ‘eg Subject
strFieldContents = Trim$(e.Values(0))
Case RICHTEXT: ‘ eg Body
strFieldContents = Trim$(e.Values)
End Select

For i = 1 To Ubound(aryExpletives)
intExpletive = Instr(strFieldContents, aryExpletives(i))
While (intExpletive > 0)
strAstericks = Asterick(Mid$(strFieldContents, intExpletive))
Mid$(strFieldContents, intExpletive, Len(strAstericks)) = strAstericks
intExpletive = Instr(strFieldContents, aryExpletives(i))
Wend
Next i

e.Values = Trim$(strFieldContents)
End If
End Forall

End Sub

Function Asterick(strExpletive As String) As String
%REM
Purpose: Calculate the number of * required to blot out an expeltive
Updates:
%END REM

Dim intSpace As Integer

intSpace = Instr(strExpletive, ” “) -1

‘If the expletive is the only word in the string
‘use string length as the number of * required
If intSpace < 1 Then intSpace = Len(strExpletive)

Asterick = String$(intSpace, Asc(“*”))
End Function

Cheers Paul

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following