Internet Site configuration refresh timer

I am currently building a website for a customer and have been developing a small LotusScript API and a web service so they can manage redirection rules in the Domino Directory from the client site. The problem is that Domino isn’t picking up the configuration change even though it should do so after 20 minutes. And yes – we’re configuring HTTP through the “Internet Sites”-view.

The Domino Administration documentation is referring to a setting the server document that allows you to change this timeout value. Hmmm…. I can’t find it… I took a look at the design and there’s no field there.

Seems like a setting that has disappeared from a BETA to the Gold build.

The only thing I found on the subject was a post on Lotus developer domain (HTTP Server Config Refresh Interval).

Just opened a PMR with Lotus Support to hear from them…

UPDATE: I received an answer from Lotus Support. It appears that the notes.ini setting HTTPConfigRefreshTimeout will set the timeout.

HTTPConfigRefreshTimeout=# of minutes

After setting the notes.ini variable restart the HTTP task.

Caution is advised since using the notes.ini variable may lead the server to crash. Please refer to this search at Lotus Support for more information. So far it is running smoothly on my servers though.

Those guys at Lotus Support sometimes makes me laugh…

We are having an issue at a small customer that received BIG amounts of e-mail which they actually subscribe to. The customer is broking crops and grain and they’re receiving massive ammounts of e-mails with bids, ship positions etc. This means their mail boxes are in the gigabyte range even though we do regular archiving. This of cause leads to the index task being put to work to keep view indexes up to date.

They have been having some problems with their Domino 7 server that simply stops processing user requests when rebuilding views. This is an issue…

We contacted Lotus Support to have them help in the troubleshooting and they have been a great help so far. Sadly the issue isn’t worked out yet though. A paragraph in their latest reply had us laughing though:

"Over the past 18 months IBM has encountered a significant customer base which has users with mail databases above the recommended 100 meg maximum."

When were the last time you met an user with a mail database below 100MB? Maybe you can find a couple in your organization but with todays use of e-mail a mail database below 100MB is not the norm.

I find it a little disturbing that the above quote is coming from the tech support of a leading company delivering Enterprise collaborative software. Of cause we all know that Domino handles much larger mail databases without issues but how can you make yourself write stuff this this?

Maybe this is why the new catch phrase for Domino 7 is “think outside the inbox”… It makes you wonder? 🙂

JavaScript function for date processing using Regex

Code

<html>
<body>


var months = new Array("", "januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december");

function formatDate() {
   // declarations
   var result = "";
   var time = "";
   var source = "";

   // did we get a date argument (otherwise we get todays date)
   if (arguments.length == 1) {
      source = arguments[0];
   } else {
      var d = new Date();
      source = d.getDate() + "/" + d.getMonth() + "/" + d.getFullYear();
      time = " / kl. " + d.getUTCHours() + ":" + ((d.getUTCMinutes() ");
formatDate("01/07/2005");
document.write("
"); formatDate("11/07/2005"); document.write("
"); formatDate("10/09/2005 12:12:22"); </body> </html>

Output

var months = new Array(“”, “januar”, “februar”, “marts”, “april”, “maj”, “juni”, “juli”, “august”, “september”, “oktober”, “november”, “december”);

function formatDate() {
// declarations
var result = “”;
var time = “”;
var source = “”;

// did we get a date argument (otherwise we get todays date)
if (arguments.length == 1) {
source = arguments[0];
} else {
var d = new Date();
source = d.getDate() + “/” + d.getMonth() + “/” + d.getFullYear();
time = ” / kl. ” + d.getUTCHours() + “:” + ((d.getUTCMinutes() < 10) ? "0" : "") + d.getUTCMinutes();
}

// split to space if no arguments
if (arguments.length == 1) {
// trim to space if present
if (/(.*) .*/.test(arguments[0])) {
source = source.split(/ /)[0];
}
}

// we received an argument – check format
if (/d{2}/d{2}/d{4}.*/.test(source)) {
// we received a date
var date_parts = source.split(///);
result += date_parts[0].match(/0?(d{1,2})/)[1];
result += ". ";
result += months[date_parts[1]-0];
result += " ";
result += date_parts[2];
if (arguments.length == 0) {
result += time;
}

// print to browser
document.write(result);
}
}

formatDate();
document.write("
“);
formatDate(“01/07/2005”);
document.write(“
“);
formatDate(“11/07/2005”);
document.write(“
“);
formatDate(“10/09/2005 12:12:22”);

DOCTYPE in Domino

This post on Jake Howletts blog points to a document describing how to change the DOCTYPE generated by Domino 6.5.3+ servers. This comes as a God sent since I am about to start a new web project where this will be very welcome.

Learning something new every day – a reserved LotusScript comment

As described previously I have been looking into supporting Domino 7 web services written in LotusScript in LotusScript.doc. The code for web services is not accessible using DXL. Torber Bang helped me out by providing some C API code that will return the code as a string. The returned code looks like the code you get if you try to access the code directly from the NotesDocument objects using the LotusScript API.

Looking at the returned code it would seem that the comment staring with “++” has to be a reserved comment since it is used to separate event blocks in LotusScript. For fun I tried it in the Domino Designer and just as I thought – the agent would not save.

'++LotusScript Development Environment

How’s that for a certification question?

Give an example of an illegal comment in LotusScript.

Non-capturing parenthesis’ in regex to save the day

My love of regular expressions keeps expanding… Luckily for those mainly programming LotusScript on Windows I recently found out that the Microsoft VBScript RegEx object supports non-capturing parenthesis’ which is great when working with sub-matches.

For more information on sub-matches and some working LotusScript agent code to use when testing it refer to my sub-matches post.

For the Java programming / non-Windows users
If you need server-side agents on platforms other than Windows you can still use regex. You will need to use Java though. The options:

  • Notes / Domino 5.x: Use Apache Jakarta ORO compiled to JVM 1.1 (you will need to recompile from source to make the class format compatible).
  • Notes / Domino 6.x: Use the default binary Apache Jakarta ORO distribution.
  • Notes / Domino 7.x: Use the Java 1.4 built in regex classes found in the java.util.regex-package.

Non-capturing parenthesis’ 101 (some knowledge of regex is required)
When working with regular expressions everything you put in parenthesis’ will be available for you to reference after a match has been found. These matches are then accessible using an index into a Match-collection (the result of the execute() function). The purpose of non-capturing parenthesis’ is to be able to use parenthesis’ but without having them capture anything and therefore being added to your Match-collection.

I needed this non-capturing functionality just the other day when writing an agent to extract parts of the body text from incoming e-mail using a “When mail arrives”-agent. The incoming e-mails looks like the text below.

Direct link to issue: http://www.example.com/somedir/someurl?id=1234

Praesent hendrerit, duis ad ut enim consequat sed consectetuer nulla.
Status: Open
Responsible John Doe
Next followup: 24-12-2005

In the above example we would like to get all the the text after the initial URL and having the text available in a single match in the Matches-collection. Without non-capturing parenthesis’ this just isn’t possible.

Let us look at an example – it’s a little bit long but bear with me…

The easy way out would be to use a regex like this:

?id=d+s+(.*)

This basically means:

  1. find the string ?id= followed by at least one digit (?id=d+)
  2. after this make sure there is at least one line break (s+)
  3. get all the text following the found line break and put the text in the matches-collection ((.*))
Result:
Praesent hendrerit, duis ad ut enim consequat sed consectetuer nulla.

The reason this doesn’t work (we do not get the entire text and we do not get the trailing Status, Responsible and Next followup lines) is because the period-character matches everything but not line breaks.

OK so we throw in some s sequences to make sure we match the line breaks as well.

?id=d+s+(.*s*.*)
Result:
Praesent hendrerit, duis ad ut enim consequat sed consectetuer nulla.
Status: Open

It is getting better but we still don’t get all the lines after the text – only the first one. The problem is that we only match “some text, a possible line break and some text”. This grouping occurs a couple of times so we need to tell the regex to match this continuously.

?id=d+s+((.*s*.*)*)
Result:
Praesent hendrerit, duis ad ut enim consequat sed consectetuer nulla.
Status: Open
Responsible John Doe
Next followup: 24-12-2005

While the result looks right it doesn’t live up to the initial requirement which was only one entry in our Match-collection. With the above regex we will have two matches where the second one is blank (two sets of parenthesis’).

The reason is because all the parenthesis’ are capturing information, but only one set of parenthesis’ has some text to capture. Non-capturing parenthesis’ to the rescue – the only change from above is highlighted in bold and blue).

?id=d+s+((?:.*s*.*)*)

Adding ?: just inside the second set of parenthesis’ makes them non-capturing and will make the regex do what we want.

Why not do a Mid$-statement?
You might be asking yourself why go through all this trouble? Why didn’t I just do this using normal string operations and a traditional Instr/Mid combination:

Dim i As Integer
Dim result As String
i = Instr(1, text, "?id=")
result = Mid$(text, i+4)

Agreed – I could have done that and the result would have been the same, but what if there was a change in the received e-mail and some text was added after the “Next followup line” which we didn’t want to include? What if the format of the e-mail was changed so the URL was at the bottom? What if you needed to support multiple formats of e-mails using the same agent?

The power of regular expression really shines here since your agent doesn’t change – just the regex.

However I am as lazy as the next person and the reason I did it using regex was another. I needed to be able to let users specify the what to do on specific incoming e-mail patterns – mail rules on steroids. Regex is the only way to do this since users will continuously add patterns which would leed to constant reprogramming of the agent. Using regex the patterns can be specified using configuration documents in the database and tested by the user before being moved into production.

Try doing that with an agent and Instr/Mid!! 🙂

Domino domains are for mail routing…

Enough introduction – what is the point I want to make?

Alan writes: “Similar to how you need a Passport when travelling between two countries, two Domains need to be “cross-certified” in other to trust each other.”

That statement isn’t correct. Domains in Domino is, strictly speaking, a way to plan and manage mail routing. Nothing else. There is an one-to-one relationship between a Domino domain and a Domino Directory, that is a Domino Directory holds all the servers and users in the domain. Servers and users from different domains may belong to the same organization(s) and/or organizational units.

I agree there is a certain security aspect in play when deciding whether to divide your Domino infrastructure into domains but the main issue has to do with mail routing. Another has to do with deviding responsibility for managing different parts of the installation to regional IT-departments.

Cross-certification on the other hand is a cryptology term and is used for establishing trust between organizations, servers and users that does not share a common certificate. It does therefore not make sense to speak of cross-certification for Domino domains since a domain isn’t a cryptology “thing”. It is like comparing apples and oranges.

That’s all… 🙂

If you think I am wrong please let me know.