Viktor Krantz

May 172007
 

I have put the update of my Dojo Calendar on hold for a while. First I am extremely busy with work here at SNAPPS creating templates for the upcoming release of Lotus Quickr, secondly I’m upgrading all my code to fit better in the upcoming 0.9 release of the Dojo Toolkit.

I’m also looking into integrating with Google Calendar using their API. With PHP you can use the Zend Framework to do that. The next step is to port all my current PHP code over to Java Server Pages (JSP).

I’m very excited that over 200 has downloaded the code from the original post, so there must be some interest out there.

I have a few questions for you the reader.

  • What are your plans to use Dojo Calendar for?
  • What database will you use to store your calendar entries?
  • If you are one of the over 200 that has uploaded the original code. Have you done or are planning any modifications to the code?
May 142007
 

Today Rob Novak posted his second demo of the upcoming Lotus Quickr Templates that we are busy developing here at SNAPPS. This time it is QPresent. From Rob’s blog:

QPresent’s innovations build upon a core capability in Lotus Quickr, namely the ability to upload a Microsoft PowerPoint slide presentation and view it as slide images in the browser. In Lotus Quickr (and QuickPlace before it), you could do this then page through the slides or zoom the presentation. With QPresent, we’ve plugged in our custom workflow engine, made slide navigation Ajax-enabled to avoid screen refreshes, and — the big feature — plugged in a commenting module that lets other users comment on the presentation slide by slide.

May 072007
 

Rob Novak and I have started a series of demos and tutorials about the upcoming Lotus Quickr templates that we are developing for IBM. Mine are geared to the developer who wants to understand the details of a particular concept, possibly to reuse it or modify it, while Rob’s will be more designed for you to understand what they are and how users will benefit. The “tag team” approach should give you a great education on what is possible with Lotus Quickr. Eventually we’ll have a library of demos and put them all in one list.

The first demo today is for QPhotos. Enjoy and please ask questions below in the comments area.

May 072007
 

Today I’m starting a new series of blog entries about extending the upcoming Lotus Quickr. The series will cover some of the new features, from a developers point-of-view, that will be available for you. You will be able to test most of them on upcoming beta releases, if you’re part of the beta program.

The tutorial today will show you a way of creating modal floating windows that can have any HTML you want in it. Click the thumbnail to see a larger image of what it looks like. The code is developed on top of the Dojo Toolkit that is now distributed as part of Lotus Quickr.

It is a modal window because the end user can not do anything else on the page until he clicks either of the buttons in the floating window or the close button in the top right corner of the floating window. (This “window” does not prevent the user from clicking the browsers back or close buttons.) It really is not a floating window. It’s not a window at all. It is a div object that is set to be on top of everything else on the web page when it is shown. The good thing about this is that we don’t have to worry about pop-up blockers. Another thing that the modal floating window does is that it darkens everything else on the web page to really focus in on the contents of the floating window. On to the tutorial.

First we create a new HTML page in our favorite editor. My new favorite is Eclipse Callisto with the Aptana plug in. Add a script tag inside the body tag. We have to add the script tag inside the body tag because Lotus Quickr will strip everything from our HTML code that is not within the body tag. So we have something like this:

<html>
<head>
</head>
<body>
<script type="text/javascript">
</script>
</body>
</html>

Time to add some functionality to our HTML code. First we add the reference to the ModalInput widget by adding the following code inside our script tag:

<script type="text/javascript">
dojo.require("dojowidgets.widget.ModalInput");
</script>

dojo.require is the Dojo way of referencing one of its JavaScript files. This happens to be a widget created by me and not by the Dojo developers but can still be called this way since it is referenced by its name space “dojowidgets”. Let’s not go in more on that. This tutorial would lose its focus very quickly, if I did that. If you want to read more about the Dojo Toolkit and how to create your own widgets please visit their website.

Next we want to add the button and the function that opens the floating window. Just before the end of the body tag we add:
<input name="mybutton" type="button" value="Open Modal" onclick="openMyModal()" />

Inside the script tag we add the function openMyModal:

function openMyModal(){
var sHTML = 'Your Name';
sHTML += '<br />';
sHTML += '<' + 'input type="text" id="modal_name" value="" style="width:95%;" />';
sHTML += '<br />';
sHTML += 'Your interests';
sHTML += '<br />';
sHTML += '<' + 'textarea rows="3" id="modal_interests" style="width:95%;"></textarea>';


var myModalParams = {
widgetId: "MyModalInput",
title: "My Custom Modal Form",
formText: sHTML,
submitFunction: "myModalSubmit"
};
var myModal = new dojowidgets.widget.ModalInput(myModalParams);
}

This function is what opens or show the “window” and whatever HTML we have chosen pass in. Let’s go over the function in more detail. The first part is where we declare a variable sHTML and add a string of the HTML that we want to show inside the floating window. As you can see we have a couple of labels, a text field and a text area field in the string representing the HTML. In the next part of the function we declare a variable myModalParams and add an object to it. This object represents the parameters that we pass into the floating window widget. More on these parameters in a moment. Last we call the ModalInput widget code and pass in our parameter object. We do this by setting a variable myModal.

Back to the parameter object that we created. As you can see we declared 4 properties to our object: widgetId, title, formText and submitFunction. These are not the only parameters that we can pass into the widget and all parameters, including these 4, are optional. Let’s go over them one by one.

  • widgetId:
    • Default: “modalInput” (string)
    • If you have more then one floating ModalInput on the page it is important to set their unique ID’s.
  • title:
    • Default: “” (string)
    • This is the title text in the window bar.
  • iconSrc:
    • Default: “information.gif” (string)
    • This is the image icon before the title in the window bar. Pass in the full URL to the image. The image should be 22×22 pixels.
  • formText:
    • Default: “” (string)
    • This is the HTML that you pass in to be displayed within the window.
  • width:
    • Default: “350px” (string)
    • The width of the window in pixels.
  • height:
    • Default: “250px” (string)
    • The height of the window in pixels.
  • resizable:
    • Default: false (boolean)
    • Should the window be re-sizable or not.
  • displayCloseAction:
    • Default: true (boolean)
    • Should we display a close button in the top right corner of the window.
  • submitFunction:
    • Default: “” (string)
    • The name of the function we should call when the Submit button is pressed. This function should return true or false if we should hide the window.
  • cancelFunction:
    • Default: “” (string)
    • The name of the function we should call if the Cancel button is clicked. This function should return true or false if we should hide the window. Use only if you need to have a Cancel function. I.E. you need to undo something when the user clicks Cancel.
  • submitValue:
    • Default: “Submit” (string)
    • The text inside the Submit button. Could be “OK” or “Yes”.
  • cancelValue:
    • “Cancel” (string)
    • The text inside the Cancel button. Could be “Close” or “No”.

Now we only need to add one more thing to our code to complete this tutorial, the function we call by clicking the “Submit” button inside our floating “window”. Inside our script tag we add:

function myModalSubmit(){
var sName = dojo.byId("modal_name").value;
var sInterests = dojo.byId("modal_interests").value;
if(sName == ""){
alert("FAILURE!nn" + sName + 'n' + sInterests);
return false;
}else{
alert("SUCCESS!nn" + sName + 'n' + sInterests);
}
return true;
}

We had added the value myModalSubmit to our submitFunction property above so we need to add a function with that name to our code. This function would in reality probably be much more complex than alerting “SUCCESS” or “FAILURE”. However in this basic demo that’s all we are doing. The function checks if you added a name in the field and alert result either way. If we did add a name it will close/hide our modal window by returning true, if not it will leave the window open by returning false. In the code you see that I’m using dojo.byId. That is just a more robust and shorter way of using document.getElementById.

Now all you have to do is to create a new “Imported Page” inside your Lotus Quickr place and select your HTML file as the file to import. Save and you will see the page with the button to click to open the modal floating window.

If you are lazy like me, and don’t want to create the file yourself, you can download the [download#3#nohits] zip file, unzip it and upload like above.

Now you can go and update the HTML to whatever you want and play with the widget parameters to suit your needs. In reality we would add this code to a custom HTML form and save our data down to regular or hidden fields on it. As an example I’ll show you a screen shot of the upcoming Lotus Quickr QMeeting template that we just finished.

If you have any comments about this tutorial, please submit them below. I will have a new tutorial for you as soon as I have another sleepless night.

Apr 272007
 

Rob Novak announced the keynote speakers for Collaboration University, and the list is very impressive.

Mike Rhodin
General Manager
Workplace, Portal and Collaboration Software
IBM Software Group

Mike will deliver the keynote address at Collaboration University on July 9 in Kansas City.

Ken Bisconti
Vice President, Lotus Software Products
IBM Software Group

Ken will deliver keynote addresses at Collaboration University in London on both July 18 and September 19.

Ed Brill
Business Unit Executive
Worldwide Lotus Notes/Domino Sales
IBM Software Group

Ed will deliver the keynote address at Collaboration University on September 10 in Kansas City.

These keynotes, together with some of the best experts assembled exclusively for each event will make Collaboration University 2007 your gateway to the most in-depth, advanced, highly focused, and complete coverage of IBM, Lotus Quickr, Lotus Sametime, and Lotus QuickPlace.

If you are like me and want to see stuff now, there is a new version of Sametime 7.5.1 and a new demo of Lotus Quickr.

Register today

Apr 192007
 

This weekend I’m going to visit my American cousin outside Jefferson City to hunt some wild turkey, this one, NOT this one. You might not now this, but I’m an avid hunter.

My normal hunting trips during a year are:

  • Wild Turkey in April. Kansas and Missouri.
  • Dove in September. Missouri, sometimes Kansas.
  • Pheasant in October. South Dakota.
  • Deer in November to January. Missouri and Kansas.

On top of these hunting trips I hunt small game and fish whenever I get a chance. That is not often since my family and work takes up most of my time. But this weekend, as I already mentioned, I’m taking some time off from coding Lotus Quickr templates and preparing for Collaboration University, to hunt some wild turkey.

Apr 122007
 

Ed Brill blogged today about the conference ratings from Lotusphere 2007. I’m really proud to say that Rob Novak’s and my session “BP311 — The Great Code Giveaway — Web 2.0 edition” was at the top of the list.

We here at SNAPPS put a lot of time and effort on our presentation material for the conferences that we speak at, and it’s fun to see that people appreciate it. If you haven’t already downloaded the pdf and the code samples from the session, go to SNAPPS download site and do it today. There are many other code samples there as well.

If you want to attend one of our sessions and see new code being developed as I write, head over to Collaboration University and sign up for one of the four events this summer and fall.

Apr 092007
 

Collaboration University just went live with their new website announcing new events this summer and fall. After much success with last years events in Kansas City and London, they are putting on 4 events this year. 2 events in Kansas City and 2 in London.

The events are:

Collaboration University™ for IBM Lotus Quickr™ and Lotus Sametime®

July 9-11: Kansas City, MO
July 18-20: London, England

Collaboration University™ for IBM Lotus Notes® and Domino® 8

September 10-12: Kansas City, MO
September 18-20: London, England

New Bonus for 2007

CU will this year, by requests from former CU Alumni, have optional 3rd day work-shops at all four events.

So new for Collaboration University 2007, we will be holding optional hands-on workshops on the final day of the conference. These 3-4 hour workshops will have you building systems, applications or learning more in-depth materials on a topic of your choice.

Head over to the CU website and register today for big Early Bird discounts.

Apr 032007
 

The last 4 years I have attended the Kansas City Royals opening day game. Yesterday was no different. I took some time off from creating Lotus Quickr templates and went to Kauffman stadium at around noon for some pre-game tailgating. It was a beautiful day in Kansas City with over 80 degrees Fahrenheit (26.6 C). REO Speedwagon sang the anthem and a B-2 bomber from Whiteman Air Force Base flew over the stadium. It was a great opening day and the fact that Royals beat Boston Redsox 7-1 made it even better.