Archive for August, 2006
Quotas and Thresholds
So what is a Quota? ? It is the maximum size a database (mail file) is allowed to grow. ?For example, your company may have rules in place stating that your mail file can grow no larger than 500 MB.
Databases can also have a warning "Threshold" which helps you know when you are approaching your quota. ? If your mail file quota is 500 MB, a threshold warning of 400 MB might make sense.
When your mail exceeds its warning threshold, you will receive an error when you open your mail database and you will receive an email that provides you details about the warning.
If you allow your mail file to grow past its quota, you will find that you can no longer save messages (outgoing emails, drafts), and depending on how your company has configured your system, you may not be able to receive any new emails until you reduce the size of your mail to below its quota.
Tool to generate WSDL from Java
I have been using the java2wsdl tool included in Axis2, however it creates a non-valid wsdl file and I have to fix it
Easily find a string in a Lotus Domino server log
How to configure DB2 on a single Lotus Domino server
Thanks for all the fish!
How to create a forgiving Notes/Domino date parser with Formula language
Changing a Lotus Notes database mail file from ‘archive’ to ‘mail’
Stubby - Now With Authentication! (Tuesday, Aug 29)
I just posted a slightly updated version of Stubby: the Axis Stub File Generator Database to the OpenNTF site. It's version 1.1. There were no bug fixes, but I did add the following features:
- You can now pass a user name and password to authenticate (for basic authentication) or pass a session cookie (for session-based authentication) when you're calling a web service method. I also provided information on how this works in the example agent code that is generated.
- The Java source files are now zipped up with their directory structure intact, and the zip file stored on the Stubby document. This is convenient if you want to recompile the source files yourself (from scratch).
If you want to do the authentication thing, you'll need to recreate the stub files in the new database first (which should take all of about 5 seconds). I had to hack the service interface class a tiny bit to give you easy access to a method that's available in the stub class that gets generated. Don't ask... just enjoy.
For a little more information on the Stubby database and what it does, please see my previous blog entry about it.
[ permalink ] [ e-mail me ] [ read/add comments ]
Anchor Links - Authoring Lengthy Documents Part 2
Anchor links allow you to define specific points in a document that people can "jump to" by clicking on a link icon. ? As an example, say you are creating a document that has many pages, or chapters. ? You could create a Table Of Contents at the top of the document with links to each chapter below. ?This would enable the reader to quickly and easily jump to specific places in the document without having to scroll down.
With the document in edit mode, place your cursor where you want the "anchor" to go.
From the menus choose Edit - Copy as Link - Anchor Link
Lotus Notes will insert an icon representing the anchor as shown below. ? This link is only visible when you are in edit mode, users reading the document will not see these icons.
Now place your cursor in the spot where you want the link to be created and Paste. (CTRL+V, or Edit - Paste, or right click - Paste)
It is here that the reader will click to be taken to the anchor spot you created above. ?Lotus Notes will insert the link icon as shown below.
Repeat this process for all the anchor links you wish to create in the document. ? I also like to create links back to the top of the document as shown below. ?By doing this you end up with links from the top of the document down to specific areas (red, blue, and green lines) as well as links back to the top of the document (orange line)
In my experience Anchor Links seem to be very under-used, or often not known at all. ? I hope this tip helps explain them to you, and that you can start using them effectively. ?
How to retrieve the template name for a Lotus Notes database
Using Script.aculo.us for Autocomplete on a Domino Web Page (Monday, Aug 28)
UPDATE: Looks like Phillipe Gauvin described this technique two months ago on his blog. I was scooped again! Nice job, Phillipe.
Yesterday I mentioned how easy it was to use script.aculo.us to create an auto-complete text box on a Domino web page. There's an example in my Weather Fetcher database (the "CityLookupAjax" Page), but if you want the step-by-step instructions, here they are:
1. Download the script.aculo.us library and extract the contents of the zip file to your hard drive.
2. Add the following files as JavaScript Script Libraries in a Lotus Notes database:
- prototype.js (from the /lib folder, all the other files are in the /src folder)
- scriptaculous.js
- builder.js
- controls.js
- dragdrop.js
- effects.js
- slider.js
- unittest.js
For each .js file, you need to create a new JavaScript Script Library, paste the contents of the .js file in, and name the Script Library exactly the same name as the .js file (like "prototype.js").
3. Create a new Page in the database and include the "prototype.js" and "scriptaculous.js" libraries. You can do this by going to the "JS Header" part of the page (a few items below where you set the Window Title), right-clicking in the script area, and choosing "Insert Resource". Here's a screenshot (click it to see the full-size image):
4. Add the following style definitions to the "HTML Head Content" section of the page:
" "
You can paste it in just like that, with quotation marks and everything (that way it's a valid Formula language string).
5. Add the following text on the Page, as Pass-Through HTML:
Lookup:
So you have a text input field called "lookupField", with a div called "lookupDiv" that will display the auto-complete results, and you're creating an Ajax.Autocompleter that will listen on that field and call an agent called "LookupAgent" to get the values that will be displayed for the auto-completer.
You could do this with a regular field on a Form too, just set the HTML ID property on the field and paste the div and script parts afterwards. Please note that you have to put the "new Ajax.Autocompleter" line AFTER the lookup field on the page/form.
6. Save and close the Page, because you're done with that. Create a LotusScript agent called "LookupAgent" that looks something like this:
Sub Initialize Dim session As New NotesSession Dim doc As NotesDocument Dim q As String, qArray As Variant Dim decodeVal As Variant Dim fieldName As String Dim lookupVal As String '** get the request (HTTP POST request) Set doc = session.DocumentContext q = doc.Request_Content(0) qArray = Split(q, "&") fieldName = "lookupval" Forall stuff In qArray decodeVal = Evaluate(|@URLDecode("Domino";"| & _ stuff & |")|) If (Instr(1, decodeVal(0), fieldName, 5) = 1) Then lookupVal = Strright(decodeVal(0), fieldName & "=") End If End Forall '** find the matches Dim db As NotesDatabase Dim view As NotesView Dim vc As NotesViewEntryCollection Dim ve As NotesViewEntry Dim returnString As String Set db = session.CurrentDatabase Set view = db.GetView("MyLookupView") '** MODIFY THIS Set vc = view.GetAllEntriesByKey(lookupVal, False) Set ve = vc.GetFirstEntry Do Until (ve Is Nothing) returnString = returnString & "" & _ ve.ColumnValues(0) & " " Set ve = vc.GetNextEntry(ve) Loop '** return alist, which is what script.aculo.us wants returnString = "
" & returnString & "
" Print |Content-Type: text/plain| Print |Cache-Control: private| Print || Print returnString End Sub
The agent is a little bit long, but not really complicated. It gets the value entered in our lookup field (passed as an HTTP POST parameter called "lookupval", as defined in the Ajax.Autocompleter params), looks the value up in a view, and returns the results as a
- list, which is what script.aculo.us is expecting.
- Instead of calling an agent, make a URL call to create a document with ?CreateDocument
- The "LookupVal" field on the form will contain the lookup value that is being passed
- The other field on the form should have a computed value of something like this:
- " + val + " ") + "
- You can also set a $SaveOptions field of "0" to not save the new document
Ideally you would do lookups against a static list rather than hitting a view each time, but this should be okay for a small view.
In any case, now you're done! Open your Page as a web page and watch the Ajax goodness. It should look something like this:
UPDATE #2: Phillipe Gauvin just added a comment with another nice way to work with HTTP POST data:
val := @DbLookup("":"nocache"; "";"myview"; lookupVal; 1);
@If(@IsError(val); ""; "" + @Implode("
")
I haven't tried this before, but I'd guess you also have to hide everything but the computed field, have the form set to "Content Type: HTML" or "Content Type: Other", and allow anonymous users to create new documents. I won't know until I've played around with it. Pretty interesting technique.
technorati tag: Show-n-tell thursday, SnTT
[ permalink ] [ e-mail me ] [ read/add comments ]
Weather Fetcher, Script.aculo.us, and a Sametime Bot (Sunday, Aug 27)
So, I've been tinkering a little more with the Weather Fetcher database and I ended up with:
- a few updates to the zip code list
- a sample web page that uses script.aculo.us (and therefore prototype.js) to do cool things like auto-complete a city name lookup field and dynamically update a div using AJAX
- code for an example Sametime bot to do weather lookups from Sametime (attached to the "About" page -- unfortunately, I had nothing to test it against, so I'm not sure that it actually works)
I'm only just now starting to play around with script.aculo.us, and I couldn't believe how easy it was to add to a Domino web page. Just include the JavaScript libraries, add some CSS styles, and do a tiny amount of code and... whoomp, there it is! See the "CityLookupAjax" page in the Weather Fetcher database to see what I did.
BTW, the download link for the Weather Fetcher database is the same -- WeatherFetcher.zip -- but the file has been updated (so if you downloaded before, you'll have to do it again).
And yes, the download is still 19 MB. Sorry it's so big, but it has over 42,000 US zip codes in 5 indexed views, and all that ends up taking some space. It's worth it though, trust me...
;-)
technorati tag: Show-n-tell thursday, SnTT
[ permalink ] [ e-mail me ] [ read/add comments ]





