Posted by Bob Balfe on September 3, 2010 under eclipse |
Ok, maybe not steroids but Dojo and CSS!
Lots of work on the attachment viewer. Using Dojo, CSS and JavaScript I was able to give the viewer two new view modes with some eye candy in each. I use CSS to have shadows and a tile mode. Check out the three screen shots below, I will most likely be posting a video to show how the new views can be used. Just remember, this is a 100% web based component in the Notes client. You will notice I have three actions on the attachments – Open, View, and Share – which use the BrowserFunction to provide a custom experience in the rich client – otherwise it just uses the normal web semantics for launching.
I used Dojo for the slide show view. I use the dijit.layout.StackContainer and then each attachment is placed into a dijit.layout.ContentPane.
For the thumbnail view I use basic CSS to accomplish this. The two classes, border and thumb, give the experience of them being “thumbnails” and as the mouse moves over the div block it “selects” it with a new background color using the hover tag.
div.border {
border: 1px solid #A0ACC0;
height: auto;
float: left;
overflow:hidden;
}
div.thumb:hover {
background-color: #ADD8E6;
border: 1px solid #FFACC0;
}
Here are some screen shots of the three support view modes:

Film Strip

Slide Show

Thumbnails
Posted by Bob Balfe on August 31, 2010 under computers |
Tonight I am looking for a way to make different presentation styles in the attachment viewer. I figure I would look into making the different presentations with JavaScript classes and with a little bit of inheritance to boot. Unfortunately JavaScript does not support classes very well and there are a thousand ways to accomplish this, just Google it and you will see. I of course chose Dojo to get this done because it was dead simple!
I want to have three presentation styles to start – film strip (default), thumbnails, and slide-show.

The main reason I wanted to have this be like a class hierarchy is because the title part (where it is File: filename) needs to be re-used and eventually I will have common actions under the title like “open“, “save“, “share“. So I need a base method in a shared class that can be inherited by the subclasses. Using dojo.declare, the base class is the following:
dojo.declare("showStyle", null, {
showHeader : function(id){
},
showAttachment : function(id, att, idx){
},
showTitle : function(id, att){
var title = document.createElement("div");
title.innerHTML = "<b>File:</b> <i>" + att.name + "</i><br> ";
title.innerHTML += "<small><a href=\"#\" onclick=\"openAttachment('" + att.file_url + "');return true;\" title=\"Open this file\">open</a></small> ";
title.innerHTML += "<small><a href=\"#\" onclick=\"viewAttachment('" + att.content_url + "');return true;\" title=\"View this file\">view</a></small> ";
title.innerHTML += "<small><a href=\"#\" onclick=\"viewAttachment('http://www.facebook.com/sharer.php?u=" + att.content_url + "');return true;\" title=\"Share this file on Facebook\">share</a>";
title.innerHTML += "</small><br><hr>";
dojo.byId(id).appendChild(title);
},
showFooter : function(id){
}
});
Pretty basic right? The two parameters in showtitle() are the DOM id the HTML will be inserted into and the “att” is the attachment JSON object. The other methods are stubbed out but I could have default implementations of them in the future.
Now for a subclass! I won’t go into the details but each subclass will implement a showHeader(), showAttachment(), showFooter() and will be called by the framework. Here is the reworked original code and put into the “filmStrip” subclass. Notice the statement in red below. This tells JavaScript to call the showTitle() method which is implemented in the base class.
dojo.declare("filmStrip", showStyle, {
showAttachment : function(id, att, idx){
var codeArea = document.getElementById("code");
this.showTitle(id, att);
if (att.content_url != null && att.content_url.length > 0){
var node = document.createElement("div");
node.setAttribute('id','attachment_' + idx);
node.setAttribute('class','attachment');
node.appendChild(document.createElement("hr"));
document.getElementById(id).appendChild(node);
var xhrArgs = {
id : 'attachment_' + idx,
type : att.type,
preview_url : att.preview_url,
url : att.content_url,
handleAs : "text",
preventCache: true,
content: {
id: 'attachment_' + idx
},
load : function(response, args){
document.getElementById(this.id).innerHTML = response;
var func = getScript(this.type);
if (func != null)
func(this.id, this.preview_url);
}
};
dojo.xhrGet(xhrArgs);
}else{
if (statusArea != null)
statusArea.innerHTML = "<br>Item not recognized: " + att.name;
}
}
});
The end result is, because of inheritance, the code just processes the object like its a base “showStyle” object.
var style = null;
if (_showStyle == 1)
style = new slideShow();
else (_showStyle == 2)
style = new tileSyle();
else
style = new filmStrip();
if (style.showHeader){
style.showHeader('attachmentArea');
}
for (var a = 0; a < attachments.length; a++) {
var att = attachments[a];
if (att.type && att.type == "attachment"){
style.showAttachment('attachmentArea', att.data, a);
}
}
if (style.showFooter){
style.showFooter('attachmentArea');
}
Posted by Bob Balfe on under family, lotus |
I must be a FireFox advocate or at least like the zoom in and out shortcuts because I find myself using CTRL+/- in many places like Notes, Symphony, etc. The only problem is the keys do nothing in them!
Who is with me?
Posted by Bob Balfe on August 30, 2010 under computers |
Check out this impressive write-up about CouchDb. Remember Dr. Cox at Lotusphere 2010 and the CERN project?
Metson says the learning curve for CouchDB is quite shallow. In fact, DMWM had a summer intern with some programming experience, but no experience in CouchDB, who was able to build a simple data quality evaluation application using the database. The only drawback, Metson says, is that you may need to do a lot of unlearning if you’re well versed in SQL. “The more you know Oracle, the harder it is to pick up,” he says.
Link: Why Large Hadron Collider Scientists are Using CouchDB
Posted by Bob Balfe on August 27, 2010 under info, lotus |
I have been digging into the various “cloud” offerings on the net and trying to see if there is a common ground in this space and as usual it appears the usual players are making bets on their “cloud” offerings. When you start seeing sites like SalesForce.com, LinkedIn, Facebook, or API’s like Microsofts Azure, all using different technologies to provide applications within “their cloud” it quickly shows people are off in their own camps. I have been reading up on the DeltaCloud (Many clouds. One API. No problem) which is attempting to solve this disparity with a wrapper approach. As long as you have a particular clouds “module” installed on the server, your code can connect to and participate in that cloud. The API’s seem to be very basic out of the gate but I think the direction is worth watching. Amazon has a huge web presence and companies like Eucalyptus have even standardized on its API’s for their own back-end so it makes me wonder if there will be camps but not many camps in the end.
Using the same application programming interfaces (APIs) that Amazon deploys for its Amazon Web Services (AWS), Eucalyptus allows users to set up their own private clouds and move workloads among internal servers, or to and from AWS. The software is available both as free, open-source code and as a paid version. – PC World
Do we need the same for collaboration? Open Social (Many sites, one API - sound familiar?) is suppose to fix that but it isn’t totally adopted by all players either.
A common API means you have less to learn to build for multiple websites. OpenSocial is currently being developed by a broad set of members of the web community. The ultimate goal is for any social website to be able to implement the API and host 3rd party social applications. – OpenSocial
If we really want a true cloud then there is going to have to be some level of common API, data model, and interfaces across the players otherwise developers and IT will be needed for the integration points. As more and more stuff moves to the cloud you may see more and more job openings for “SalesForce.com developer” or “OpenSocial developer” or “AWS experience a plus”.
I think this is a frontier of opportunity for any IT person or developer – which is one of the reasons I love this industry. It is forever changing and challenging.
Posted by Bob Balfe on under books |
If you want to learn how to get money for your intellectual property or patent something in the software world then you should check out this book. I was just re-arranging my books and found this little gem. It has a lot of great ideas and pointers for where to get started.
Posted by Bob Balfe on August 26, 2010 under computers, fun, info |
Just playing around tonight I noticed a section of a site I hit that showed the “value” of their site. This intrigued me because I wondered how they could possibly know that? So I scoured the net and looked for as many services as I could to see my sites value and it clearly looks like this is not a scientific approach by no means. My highest value is $46,000 and my lowest is $98, that’s useful…

Posted by Bob Balfe on under Polls, computers, eclipse, lotus |
I have been checking out developer.force.com this week and it is a pretty extensive cloud based solution for developing, deploying, and using applications in the cloud. I checked out their Eclipse based development videos and the development environment looks pretty comprehensive. I would like to hear if anyone who reads this blog has any real experiences they would like to share about it. I am also interested to hear how many of my readers have real exposure to SalesForce.com.
If you use SalesForce.com in any manner, application use, develop for, deploy on, integrate with or any of the above please take some time to post your answer below and possibly a comment on your experiences.
If you are a Lotus customer I would like to hear how you integrate your XPages, Domino or Notes applications with SalesForce.com.
Thanks in advance!
Do you or your customers develop or use applications on salesforce.com?
- no (70%, 14 Votes)
- yes (30%, 6 Votes)
Total Voters: 20

Loading ...
Posted by Bob Balfe on August 24, 2010 under OpenNTF, eclipse |
As promised in the last post, here is a new updated widget for the attachment viewer. You can download the latest source files from the OpenNTF project. If you want to learn how to install this into Notes 8.5.1 and above check out the video I posted to show how to do that.
Here is a summary of the support and you can also watch a video here or below:
- ODF thumbnail support added, .odp, .odt, .docx, .dotx, .docm, .dotm, .xlsx, .xlsm, .xltx, .xltm, .pptx, .pptm, .potx
- Modified Zip file to limit embedded text files to show only first 20K
- JAR file support – extended the ZIP provider to include Jar files
- New Text File support – .mf, .properties

Read more of this article »
Posted by Bob Balfe on August 23, 2010 under eclipse |
If you are familiar with the embedded browser in the Lotus products you may or may not have heard of BrowserFunction, most likely not! The problem is this class is not very well documented and was part of E4 and is scheduled for Eclipse 3.6. Notes 8.5.2 does however support this SWT class so you can begin to play with it once 8.5.2 is available.
Why is this so important? Well, just imagine, now you can completely communicate between Java and JavaScript using this. You can use the SWT Browsers execute() or evaluate() methods to execute JavaScript from Java and now you can execute Java from JavaScript using BrowserFunction.
This implies you could potentially write all of your UI using HTML/CSS/JavaScript technologies!
The Attachment viewer is such an application, you can check out the code on OpenNTF. I don’t use the BrowserFunction in the OpenNTF version but I have already begun to make an Lotus Notes 8.5.2 version of the plugin that has much better integration with the Notes client. If you are writing side bar plugins and want to standardize on writing in a single technology you should check out the SWT Browser and the BrowserFunction support.
Posted by Bob Balfe on August 20, 2010 under info |
I am not sure if I am on this island alone but when there are a lot of responses in an email thread the GMail UI gets unbearable! I quickly get lost on where a reply is, to what section of the thread, etc. And navigating down the thread is just cumbersome. Unfortunately I have been using GMail for a couple of years and this has not gotten any better. Is there a way to not thread messages in this way? I did not see a setting.
Posted by Bob Balfe on under Polls |
Link to original post.
I have been playing with the attachment viewer a lot lately and over the weekend I figured out how to show the thumbnails from files based on the Open Document Format (ODF). I learned, thanks to some colleagues, that these files are really just zip files and showing those thumbnails is as easy as using the zip viewer I just created. Anyway, there have been a lot of discussions on where people want to view attachments. Lots of opinions!
So this poll is to ask you, where and how do you want to view attachments? I hope I got all of the basic options in the poll. Go ahead and select all that you would want to see.
How do you want to preview attachments? (select all that apply)
- Inline with a thumbnail, then a click to view/preview (63%, 20 Votes)
- Inline with a mouseover popup (47%, 15 Votes)
- In the side bar based on selection (38%, 12 Votes)
- In a preview pane based on selection (38%, 12 Votes)
- Text/Link inline, double or single click to open/view (22%, 7 Votes)
Total Voters: 32

Loading ...