9/09/2012

Internet password security settings @ Lotus Domino 8.5.2 (Video)

This is how you can add an internet password security settings.


An other way to do the same:

 

Force a user to change Internet password on next login:


Force more users to change their Internet password on next login:



9/08/2012

Log method 1

"Creating log is a must." You can read those words in all specification. But who wants to redevelop this again and again. I made two different version for logging. In this discussion you will see how I do a log with the standard 'StdNotesLog' template.
First you must create a field in a profile document (or any similar solution), where you must defining where is the application's log nsf.
I have a log script library what I copying into the new application. I am going to show how I use it in an agent, but you can use it in the same way -for example- in a form.
In your next step you must "Use" the script library.
Use "log"
 Set the log db:
Call logdb.Openwithfailover(db.Server, profiledoc.logdb(0))
And you are ready to write into the log db:
Call logging( db.Server & "!!" & db.Filepath & " ~~ " & ag.Name & " agent started width rights of " & ag.Commonowner ) 
The logging method is waiting for a string. So you can do this too:
Call logging("Mail was send:" & Chr(13)_
            & dbltab & "From: " & maildoc.from(0) & Chr(13)_
            & dbltab & "To: " & Join(maildoc.SendTo , "; ") & Chr(13)_
            & dbltab & "Subject: " & maildoc.subject(0))
In this case there will be a multi line log entry. The dbltab is double tab (constant).
And here comes the  function:
%REM
    Function logging
    Created by Robert Takacs-Kral
%END REM
Function logging(eventstr As string)
    Dim eventItem As NotesItem
    If logview.AllEntries.Count = 1 Then Set logdoc = logview.GetFirstDocument() Else Set logdoc = logview.GetLastDocument()
   
    If Not logdoc Is Nothing Then
        If logdoc.Size > 30000 Then
            logdoc.FinishTime = Now()
            Call logdoc.Save(True, False)
            Set logdoc = Nothing
        End if
    End If
    If logdoc Is Nothing Then
        Set logdoc = logdb.Createdocument()
        logdoc.form = "Events"
        logdoc.server = logdb.server
        logdoc.StartTime = Now()
        Call logdoc.Save(True, False)
    End If
    Set eventItem = logdoc.getfirstitem("EventList")
    If eventItem Is Nothing Then
        Set eventItem = New NotesItem(logdoc, "EventList", Now() & " " & eventstr)
    Else
        Call eventItem.AppendToTextList( Now() & " " & eventstr)
    End If
    Call logdoc.Save(True, False)
   
End Function
This short code writes into the last log document, but when the size is near 32K close the current document and creates a new one.
This is a simple code but works well.

9/07/2012

Server-side mail export - EML

The issue was: creating a server-side solution for exporting emails to EML file from different mailboxes.
The application has a settings view, where the key user can set up different mail boxes for exporting.
This is cluster ready application.

Settings
Here comes the important part of the code.
function exportEML As Boolean
        On Error GoTo ErrHdl
        Dim fileNum As Integer
        Dim mime As NotesMIMEEntity
        Dim stream As NotesStream
        Dim evalstr As String
        Dim tmp As Variant
        Dim expFileName As String
        Dim mimeType As String
        Dim mimeBoundAryStart As string
        Dim mimeBoundAryEnd As string
        ss.Convertmime = False
       
        fileNum% = FreeFile()
        Set mime = maildoc.GetMIMEentity
        If mime Is Nothing Then
            Call maildoc.ConvertToMIME(3)
            Set mime = maildoc.GetMIMEentity
        End If
        If Not mime Is Nothing Then
            Set stream = ss.Createstream()
            expFileName$ = wDir & "\" & maildoc.Universalid & ".eml"
            ...
            If Dir$(expFileName$) <> "" Then
                Kill expFileName$
            ...
            End If
            Call stream.Open(expFileName$, mime.Charset)
            
...
            mimeType = mime.Contenttype
            mimeBoundAryStart = mime.Boundarystart
            mimeBoundAryEnd = mime.Boundaryend
            Call mime.GetEntityAsText(stream)
            Set mime = mime.GetNextEntity
            While Not mime Is Nothing
                Call stream.Writetext("", 3)
                Call stream.Writetext(mime.BoundAryStart)
                Call mime.DecodeContent()
                Call mime.Encodecontent( 1727 )
                Call mime.GetentityAsText(stream)
                Call stream.Writetext(mime.BoundAryEnd)
                Set mime = mime.GetNextEntity
            Wend
            Call stream.WriteText(mimeBoundAryEnd)
            Call stream.Close()
           
...
            exportEML = True
        Else
            ...
            exportEML = False
        End If
       
ErrHdl:
        If Err Then
            Print "  Error @ " & db.Filename & " (" & db.Title & ") - " & ag.Name & " - 'function exportEml' (" & Err & ") " & Error & " - line: " & Erl
            exportEML = false
            Exit Function
        End If
    End Function

Speed up the eclipse based designer

I felt that my LN 8.5 is like a snail. I searched for a solution. Here I am sharing it.
Close your Notes and open the notes program folder and browse the '\framework\rpc\deploy\jvm.properties' file. Open with text editor. Locate the following line:

vmarg.Xmx=-Xmx256m

Usually you can find this line at the beginning of the file. This is the factory default settings, and means how much memory can be allocated when your Lotus Notes is starting.
If you have only 2GB of RAM than set it between 256 and 768. If you have more than 2 GB than can be set for 1024.

vmarg.Xmx=-Xmx1024m

And now restart your Lotus Notes.

9/06/2012

Is Lotus Expensive?

There are some Lotus Domino server hosting provider.
The entry price is 100 USD/month, for this price you get a Massaging server.
Enterprise server is from 200 USD/month and Utility Server is from 450 USD/month.

Picture resizing

My costumer asked me for a web-based picture resizing solution. It won't be a big issue... but nothing is so simply that looks at first sight. They have a hosted Domino server. In this case they have no ability to run agents with restricted rights. This was the challenge.
The solution: First I created a new application where the web users are submitting their new pictures. This application has a scheduled replication on a computer which is located at the office and always in use. The Lotus Notes has a preference under the Basic Notes Client Configuration for enabling scheduled local agents. I checked it in (thanks for LogMeIn). The "resizer" agent runs on the local machine.

Enabling the sched. local agents
Nowadays this environment works very well. Yes, the perfect solution is when the "resizer" agent running on a server (not for the user interact of-course), but they still paying 79 USD/month for the Domino Server (within a big iron). They are satisfied.

My first Note(s)

Hello,

This is my first entry, so please let me to start with my history. I met with IBM Lotus technology early 2000s. This time I used 5.x version. My first application was a website. I worked on it about for a month or more. Was not easy. But nowadays with XPages we can do a simple website under a few days. Really, it is so that fast.

I had working with Lotus Notes for 3 months when I finished my 2nd application. It was a Registry System for a University. I presented my app for a group of professors... the deep water (within sharks), but I solved.
 Those days there was no type-ahead in the programmer's pane,but we had the amazing 64K problem on code segment. Nowadays we can do a front end type-ahead function for the users by a few click (both rich- and thin client).
 About a year ago I got a type-ahead issue, where the source view was more than 64k. My costumer insisted on type ahead from the first letter. XPages has a very great part: the particular refresh. I solved that problem with some additional views and used the particular refresh. The result: not all the entries travelling across the network, but some changes on the keyword documents appears later.
I think the XPage technology is great, but there are some more issues about it.We are looking forward for the new release.