logo

Why The Silence?

Wow. More than 2 months since I last blogged. Which is the longest period of silence this site has ever seen. What gives? Is codestore dead? Does anyone care? Well a couple of you do. Enough to email me and ask if I'm ok. One even to say it's like he's "missing a friend", which was nice. One asked if I was still alive and I had to resist temptation of replying in the guise of my widow.

The simple reason is I'm just way too busy to find the time to write on here. I'm working weekends and setting the alarm for 6am each day.

The bigger reason is probably a waning interest. It saddens me to admit it but, after nearly 11 years (or is it 12?) the driving passion I once had is now in question. Kind of. I still have the passion for technology and for sharing. I just don't know where I am right now. I'm in that strange place between knowing which technology my future lies in. Is it Domino? I doubt it, long term. Is it SharePoint? Perhaps. More likely, for at least the foreseeable future it will be Microsoft Dynamics CRM.

Dynamics is quite a nice product and feels like a much more natural technology to migrate to than SharePoint ever has done to me. In fact, as a Domino developer, it feels like quite a familiar way of developing.

I have a few more Domino-based things I will definitely make a point of sharing, but I also plan to talk more about what I'm learning in other technologies. I can't see myself ever not running a blog. It's just going to have to wait until things quieten down for me.

Don't give up on codestore completely. Not just yet anyway.

Comment Icon There are 17 comments in 17 threads Read - Add

Mapping Document Collections To Views

It's now a couple of months since I wrote about a Super Useful Set of LotusScript Wrapper Classes, which I've written about on and off since February.

Today I want to share a few more extensions I've made to them, which help massively when it comes to getting documents from views.

Imagine the following use scenario:

 

Dim factory As New CustomerFactory()
Dim coll As CustomerCollection

'Let's get a collection from a view
Set coll = factory.GetAll()

'Or you could to this
Set coll = factory.GetAllByID()

'Or you could to this

Set
coll = factory.GetAllByCountry() 'Or you could to this Set coll = factory.GetCustomersMatching("foo")

 

This code utilises the following functions in the CustomerFactory class:

 

Class CustomerFactory As DocumentFactory

  Private Function FromView(ViewName As String) As CustomerCollection
    Set FromView = New CustomerCollection(GetViewNavigator(ViewName))
  End Function

  Function GetAll() As CustomerCollection
    Set GetAll = FromView("AllCustomers")
  End Function
  
  Function GetAllByCity() As CustomerCollection
    Set GetAllBySite = FromView("CustomersByCity")
  End Function

  Function GetAllByCountry() As CustomerCollection
    Set GetAllBySite = FromView("CustomersByCountry")
  End Function
  
  Function GetAllByStatus() As CustomerCollection
    Set GetAllByStatus = FromView("CustomersByStatus")
  End Function

  Function GetCustomerByID( id As String ) As Customer
    Set GetCustomerByID = New Customer( GetDocumentByKey( "CustomersByID", id ) )
  End Function
  
  Function GetCustomersMatching(query As String) As CustomerCollection
    Set GetCustomersMatching= New CustomerCollection(GetViewEntriesByKey("(LU-CustomersByAllKeys)", query, False))
  End Function
End Class

 

In turn the above code relies on a few additions to the base DocumentFactory class:

 

Class DocumentFactory
  Function GetViewEntriesByKey(ViewName As String, SearchTerm As Variant, ExactMatch As Boolean) As NotesViewEntryCollection
    Set GetViewEntriesByKey = GetView(ViewName).Getallentriesbykey(SearchTerm, Exactmatch)
  End Function

  Function GetViewNavigator(ViewName As String) As NotesViewNavigator
    Set GetViewNavigator = GetView(ViewName).Createviewnav()
  End Function

  Function GetAllViewEntries(ViewName As String) As NotesViewEntryCollection
    Set GetViewNavigator = GetView(ViewName).AllEntries
  End Function
  
  Function GetDocumentByKey(ViewName As String, Lookup As Variant) As NotesDocument
    Set GetDocumentByKey = GetView(ViewName).Getdocumentbykey( Lookup, True )
  End Function
End Class

 

What all this does is make it a lot less tiresome to get a handle on document(s) relating to a particular business object (in this case documents based on the "Customer" form). The base DocumentCollection class now has helper functions to get all view entries or simply a view navigator object. It also has a GetDocumentByKey method which defaults the ExactMatch option to True, because it always is, thus saving us passing it in to the call.

Going Forward

I've also been using these classes extensively in a new Domino database I've been lucky enough to create from scratch and have been working on lately. As I've gone along I've been tweaking and extending the classes and now feel they're at a solid point ready for wider use.

I don't want to bang my own drum too much, but they're amazing. You maybe have to use them to see why, but, once you do, there's no going back. If this were ten years ago they'd be almost revolutionary.

Talking of going back; will I ever!? Will I ever be asked to create a new Domino-based web app from scratch? Never say never and all that, but I have a feeling I won't. Which makes it a shame that I developed such a rich and powerful way of working with Notes objects via LotusScript so late in my days with Notes.

Either way, if you're still working with and creating new Notes apps I implore you to give these classes a go. You'll love them.

My plan is to scrub them all a bit, document them better and then share on Github, along with a demo database. Assuming there's interest?

Comment Icon There are 12 comments in 6 threads Read - Add

Making Google Apps For Business Behave Like a Mail Client

So, I mentioned that I've moved to a new PC and, for the first time in years, I didn't install a dedicated Mail client/app. Instead I'm using direct web access to Google Apps For Business (posh name for paid-for Gmail).

The one thing I never liked about using Email in a browser is that I constantly close and re-open the browser. Thus, in effect, closing my email client, which I then have to remember to re-open.

Now though I've made it seem like a real app. You can do this using Chrome's "application shortcuts". Here's how.

First I setup a CNAME record in my DNS so that mail.mydomain.com points to Gmail. Then I visited the new URL in Chrome and, from the Options menu I chose Tools -> "Create application shortcuts...." which brings up this option dialog:

image

When I clicked Create it added a shortcut to my Taskbar, as below.

image

As you can see it looks just like a real application. It even tells me how many unreads there are.

The app runs in a chrome-less version of Chrome, as below:

image

I can now open and close my actual Chrome browser as many times as I like and my "mail client" stays open.

Did you notice the custom logo being used? Here's how.

You can also configure notifications to make it even more like a true mail client experience, where new email alerts appear on the bottom right of your screen.

image

All in all it makes for a nice experience. Now if only I could shake the un-nerving sense that I could lose all my mail at any point...

Comment Icon There are 6 comments in 5 threads Read - Add

Documenting Your LotusScript Classes

Just a quick LotusScript tip:

Hopefully you've been inspired by my recent adventures in creating custom LotusScript classes. If so, you'll have noticed that, when creating your own properties and methods in these classes that they get their own comments added in.

For example, if you type "property get foo as string" and then press return, you'll see something like this:

%REM
        Property Get Foo
        Description: Comments for Property Get
%END REM
Property Get Foo As String

End Property

Domino Design auto-adds the comments above the property for you.

It's easy to see this as an annoyance and find yourself taking the comments out to keep your code tidy. However, I've forced myself to stop doing that and now make a point of adding in a meaningful comment. Like so:

%REM Property Get Action Description: Value of the "Action" field, which is used by the workflow associated with most documents Value is only available when editing/saving (not stored on document)! %END REM Property Get Action As String Action = GetFieldValue("Action") End Property

The benefit of doing so is manifold. Not only does it remind yourself what your intentions were but also, more importantly, future maintainers of the code.

But the real tip here is that, if you comment code using the standard way then, when you hover the mouse over a call to that property in use in your code you get to see the "documentation" inline. As below:

image

That alone makes it worth the time to document properly. Even if just for your own benefit as a quick reminder of what everything is.

Comment Icon There are 7 comments in 4 threads Read - Add

The Perfect Desk Quest - 2013 Update

It must be time for another update on how my desk is evolving towards the elusive "perfect desk". Previous updates here.

Here's my desk now, following a recent overhaul:

IMG_3377

The two main differences from before: The Lenovo T400 laptop and its docking station have gone and the left-most monitor has moved positions to be on the right.

My desk needs to not only keep up with the way I work, but also the changes of the times. I decided it was time I got "with the times" and "embrace the cloud" and all that stuff.

For years my main work PC has been a laptop. For the obvious reasons, such as being able to work anywhere, being able to hide it when I go on holiday etc. It used to be that I'd undock the T400 each night and take it indoors of a night time. Then I bought the Yoga 13, which fast became my "house laptop" and the T400 was confined to the office.  The T400 was getting on for being 3 years old and had the noisiest damned fan in its docking station! It's days were numbered!!

While using a laptop as my main PC I have always missed having a dual monitor setup, which laptops can't deal with. Not easily anyway.

So, I've bought a Lenovo E31 SFF and stuck 32GB of RAM in it. This is now my main work PC and drives the two monitors to the right. I've missed having dual monitors!

Using the recently-discovered Hyper-V Manager tool for Windows 7 means I don't need the monitor attached directly to server. As you can see above the second monitor is showing a Domino server running in a VM on the server. It makes day-to-day Domino development so much easier having ready access to the server console.

No Email Client

The cloud now means I'm not tied to a single machine. When I do go "on the road" I can easily take everything with me.

For the first time in as long as I can remember using a PC with email I'm not going to install a Mail app. I've used various email clients over the years: Opera, Outlook Express, Lotus Notes, Thunderbird, Postbox, Mail.app. Now I'm just going to use Gmail.com online. Got to admit I don't like the idea that all messages aren't backed up on my own PCs. But hey. Brave new world and all that.

The only non-cloud-stored data I work with are Notes database. I tried using Dropbox to store my Notes Data folder, but, unsurprisingly, it didn't work. It probably could work if you made sure to only have Notes running on one PC at a time.

Moving from one PC to another this time was a lot less painful than it has been in the past. Still took a couple of hours. Not the full day of time it used to though.

Who knows what the 2014 update will bring. I just hope I'm still lucky enough to be working from my own little home-office, so that it matters either way.

Comment Icon There are 11 comments in 5 threads Read - Add

More blog entries are available in the archive »

Latest Comments

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

Latest Survey

Is LotusScript Still Relevant?

I tend to code purely in LotusScript 29%

I now only maintain existing LotusScript code 8%

I use both, choosing whichever is right for the task 36%

I used to use LotusScript, but now only use Java 9%

Who cares, as long as it gets the job done 15%

Comment or vote here »

Elsewhere

More links are available in the archive »

Some Demos

DEXT is a downloadable Domino database chock-full of the following demos and more:

To download DEXT take a look in the Sandbox