Subject: DOLS and the infamous Sub_0 problem
I’ve got the same problem here. If you’re using relative paths then everything works okay as long as your server’s data directory tree is flat. But if you’ve got required subscription databases in your data directory and folders inside of that with other databases, you’ve got problems.
For example, I have an app that has the following structure on the server:
…data/coredb.nsf
…data/folder1/dbA.nsf
…data/folder1/dbB.nsf
…data/folder2/dbA.nsf
…data/folder2/dbB.nsf
…etc.
On the server I can reference “/folder1/dbB.nsf” and all is fine. But offline on DOLS I have to reference “/Sub_x/folder1/dbB.nsf”.
Fortunately, I can (for now) rely on my subscription being the only one on the offline machine (i.e. always inside of “Sub_0”), so I have a few hacks to determine whether I’m online or off and then add “Sub_0/” or “/Sub_0” appropriately:
Javascript:
function isBrowserOffline(){
// returns TRUE if the browser is running in offline (DOLS) mode
if (window.location.hostname.toLowerCase() == “localhost” || window.location.hostname == “127.0.0.1”) {
return true;
} else {
return false;
}
@Formula:
isBrowserOffline := @If(@ServerName = “CN=OfflineSync/O=DOLS”; @True; @False);
WebQuerySave agents that run LotusScript:
Function isRunningOnOfflineServer
'returns TRUE if the server running this code is an offline DOLS server
Dim sess as New NotesSession
If Right$(sess.currentDatabase.Server, 7) = “Offline” Then
isRunningOnOfflineServer = True
Else
isRunningOnOfflineServer = False
End If
End Function
You would obviously need to modify the last function so that it correctly identifies the server / user ID running your code. Depending on your security rights, etc. this can be extremely tricky as you may have several agents running under different rights.
Regardless, there is no way to know which Sub_x folder you should be referencing, though perhaps you can parse out the path information of your current database context and prepend that. I.E. scan your database filepath for “Sub_x/” and if you see it, use it. You’d need to be prepared for the possibility of double-digits as well.
It really would be nice to have either (A) @Formula and script methods to derive the current Sub_x folder, e.g. “@DolsSubscriptionFolder”, or (B) have the DOLS http server perform all this translation behind the scenes for us.