And Finally, WQO Calendar Download Available
After almost two weeks in the making and a fair amount of scope creep I finally have a demo database for you.
What started as something simple grew a little out of control and one simple database now contains examples of the following:
- HTMLArea Class
-
Starting it all off was this LotusScript class, which provides a simple way to use any field — normally Rich Text though — on a form to receive chunks of HTML generated by the form's WQO agent.
To see it in action open the "wqo Calendar" agent and look at how the code writes to the "calendar" object. This is an RT field called Calendar on the $$ViewTemplate for calendar form. To see the class itself open the declarations section of the CommonRoutines script library.
- RSS Feeds with Domino
-
Much like the calendar "view" the RSS feed uses a "fake" view template form, a WQO agent and a rich text field to output XML in the strictly-defined way RSS demands. This is an alternative to the way it's normally done in Domino, which leaves lots to be desired. From now on all apps I develop which need RSS will do it in this way!
- The new WebSession Class
-
In the CommonRoutines script library is another class definition. This one just makes it dead simple to get started with web agents. One line of code instead of six or more.
It also has methods to easily get query string parameters, user details and web-friendly path information. It is easily extendible to cover any other everyday task of LotusScript on the web. This too is something I will be using in all my database from now on.
To see an example of how simple it makes life open the (wqo Test) agent. To see the code in action open the Test form in the browser.
- Accordion-style forms with DLs
Open the "Entry" form to see how the form is laid out using a DL element and how the mootools accordion effect is used to show/hide sections of it one at a time.
- Simple Calendar View With DHTML
Using a $$ViewTemplate to render a date-ordered view in a pretty-looking non-Notes-like calendar format. This calendar page encompasses many tricks and techniques. Have a play and anything you like you should be able to work out. If not, ask.
- Using agents to set cookies server-side
How to remove the need for JavaScript when working with cookies by using a combination of LotusScript and @Formulas.
- Accessible Style Sheets
Using the above method we can let visually-challenged users choose an alternative high contrast style sheet and set a cookie to make the choice (semi) permanent.
- Accessible Ajax forms with Domino
Adding a new entry to the calendar is quick and simple using Ajax to submit the form. It also works when the user has no JavaScript. Doing this isn't as hard as it might sound if you follow some simple guidelines. The demo db shows how.
Phew, some list. Well, here's the database. Hope you like — a lot of time and effort went in to it!
If you like what you see please keep that usefulness in mind for when I return from my week in Greece and start pestering you for sponsorship money for my next sporting challenge — The Robin Hood Half Marathon on September 16th.
It is really amazing how well the forms are looking but I still cannot get used to design my forms using string concatenations. From my opinion there is too less Domino and too much coding by hand involved.
It ain't pretty, but that's life with Domino Mark. If you want amazing results you have to sacrifice your professional conscience and just do what you have to do. In this case that involve committing a developer faux pas or two. Hey, look at the end result though!
Somehow you are right :-) But I think using all your web development skills you could easily produce the same results in the same time frame without using Domino at all.
I'm in awe of how much time and effort you spend on some of your blog articles!
You're probably right Mark, but I get my work through being known as a Domino developer and it's how I pay the bills.
Tommy. As I said recently, thank my customers. Most of what I pass on to you guys is merely a re-hashed version of what I work on for them. Thank them for allowing me to do so and also for allowing me to continue working from home. It's the latter than allows me the time (otherwise spent commuting) to knock out these demos.
Hi Jake, This post prompted me to properly read your previous rss post and have raised a couple of points.
What's the trouble with the date format? You can get a view to output in that format no problem. The date has to be in a column on it's own, but once you've got a huge variety of formatting availible, and you can get rfc822 format no problem.
The only way I can think to get round hard coding the host for the links would be to do some dxl stuff to update the design on the fly.
I'm not sure if you touched on this in one of the WQO posts or not, but if performance was an issue, is would be pretty straight forward to set up a cache of the feed, so that you didn't need to spin through all of the documents unless there was an update. Maybe the subject of another post ;)
Anywho, good stuff.
You should be able to get the user's name like so ("run as web user" not needed).
Public Function getUserName() As NotesName
Set getUserName = New NotesName( document.REMOTE_USER(0) )
End Function
You are da' bomb, Jake! I'm totally visiting your wishlist after this download. Thank you.
Of course using REMOTE_USER is not a substitute for "run as web user" when that is what is required.
Kerr. As ever it's horses for courses. If you want to use DXL be my guest. Don't see what you'd gain over my approach though.
You're right about the RFC822 date bit:
Still need to get the value of the first in the view somehow though!
I've never worked on an app so large or under such stress that caching was needed, but it's an interesting topic and something I might cover when I return from my holiday.
Brian. You're right. I can't for the life of me remember why I use the CurrUser field now. I'm sure though that at some point in the version history of Notes Remote_User was unreliable or plain didn't work. Seems ok now though, so I've deleted CurrUser and switched to your code suggestion, although I've added a check for a blank entry in that field and set .user to "Anonymous" in that case.
Karen. Thank you in advance of any pressies.
Yeah, sorry Jake, not arguing that the WQO isn't better, just that the discussion raised some ideas.
The DXL comment was more along the line of, "Jeebus, how on earth could you do that with a view?" no other way that I can think of. I've not used DXL ina production environment because those pesky admins won't allow the agent to be signed with a user with designer access. And they get really uncomfortable about a the idea that the design changes.
I'd be tempted to ignore the date, it's optional isn't it? Do feed readers get huffy if it's not there? Anyway, I agree that getting the date of the first entry is a bit ugly. I've always wanted the ability for @dblookup to take a number instead of a key, so that @dblookup("";"";"view";1;"foo") would lookup the first doc. Using -1 would lookup the last doc. Ah we can but dream.
I've worked on some things where WQO was the way to go, but was way too heavy, making the load time unacceptable if it was for run for every request. Caching worked a treat. The RSS example is a different problem, an individual run is going to be fine speedy enough, but I've read that RSS was a prime candidate for swamping resources once the subscription levels rise. If you had a server could be hosting 10s or 100s of RSS feeds, each with 1,000s of subscribers, each automatically checking for an update every couple of minutes. Ouch! A little caching would make a big difference.
As you say horses for courses ;)
I'm sorry too Kerr. I get a little too defensive sometimes and it always feels like people are trying to poo-poo my work. What is meant as merely an alternate suggestion sometimes comes across to me as "Why the hell are you doing that, fool!?". It's the paranoid side in me...
Your DBLookup idea is much like SQL where you can add "LIMIT 1" on the end to limit results returned. Great idea.
If you want to stress test Domino apps look for the JMeter link in my Elsewhere section from a couple of days ago. Very nice app!
Jake
Brillant, Thank you Jake!
Alex
Great job but I one problem when I submit changes made to an "quick add-entry"
After "save" the browser shows id, date and title - not the calenderview:
{
_id: "C214207D8B331799C125733F003AC388",
date: "2007-01-13",
title: "Edit Qiuckregistration"
}
..and in the browsers adressfield it ends with "..?EditDocument&Seq=1"
Has this happend to anyone else or is it because I am a blond Swede ;-))
Leif: I've found the same bug. Otherwise this is nicest implementation of a domino calendar I've seen yet. Thanks, Jake.
Leif/Tom. Woops. The field called Ajax was Editable when it should have been Computed for Display. If you look at how it all works it will make sense why this bug came about. I've fixed the online version.
Hi Jake,
Many thanks, this is nice, love the method for adding calendar entries at a double click. I did have 1 question regarding that feature though. I downloaded latest version and when I double click to add an entry it places the popup form in lower right corner of screen. It does this in IE only (v6.0) and works fine in FF. Found this strange since it works fine in the same browser on your demo site. Am I missing something here? Thanks again!
Niall. That's to do with the doctype and whether it forces the page in to standards mode or not. Search this site for more info.
Hi Jake,
I just posted about how I could not get the accordion effect to work. Please strike that post as I have got it working. Apologies for wasting your time.
$$HTMLFrontMatter and custom doctype !!!!
Best regards
Alan
Hi Jake,
Beautiful job on this application. I've never seen a Domino calendar look better.
I do have a question though. Is the month calendar the only format in here? Or are there (week, day, etc) others I am just not wrapping my head around.
Thanks
Thanks Michael. Just month layout I'm afraid. It was never meant to be a calendar. Just a demo of using WQO and RTFs together.
If I had more time I'd like to take it further - optional week start day and other layouts etc, but I don't...
Jake
Hi Jake,
First of all thanks for work you did.
But I have a query,you have provided the demo database.i have downloaded it but and tried to explore it,when i am open the calendar on browser it doesn't open up.i wannna to implement the calendar in my database.
How could i achieve it ??Please Advise....
Thanks in Advance.....
Jake - for some reason when I make a new copy of your demo database and try to access the entry form, the accordian effect isnt' working. For some reason everything is displaying expanded and clicking on the nav icons won't close them.
Is there a way to get the calendar to parse entries by query string value? Im tryin to get one calender to work for multiple people but they only see theres via a hidden attribute, which is saved when they create a new entry (hidden field).
See, I told you I'm still with yellow butter! This is all ace stuff and perfect concept for a new project we're working on. I'm still a few years behind you but this article and the .nsf are fab. Many thanks.