Thursday, April 12, 2007

Baseball?

I'm helping coach our son's Little League baseball team again this year. He is in his first year in Little Majors (kids pitching) and we had our first practice on Tuesday. It's too early to tell how things are going to go, other than that we only have one kid who has played Little Majors before.

But the weird thing, and the reason for the title of this, is that it was 48 degrees on Tuesday night and we practiced on a clear field. Wednesday, we got 5 inches of snow! Today it is a little warmer and rainy, and it is supposed to be near 50 tomorrow, but it isn't clear if we'll be able to practice tomorrow night.

Hope this weather straightens out soon. It's time for winter to be done!

SnTT: Toolbar Icon to Change Font Colors

This is a quick and dirty tip inspired by a request from a co-worker the other day. He wanted to know if there was a way to quickly change font colors in Notes, similar to the buttons available in Microsoft applications. I said I wasn't aware of one and couldn't locate one after some searching. So, since he's a good guy, and I like to keep people happy with Notes, I decided to write something quickly.

This is the code:
colorchoices:="Black":"Gray":"Red":"DarkRed":"Green":"DarkGreen":"Blue":"DarkBlue":
"Magenta":"DarkMagenta":"Yellow":"Brown":"Cyan":"DarkCyan":"White";
colorcodes:=[Black]:[Gray]:[Red]:[DarkRed]:[Green]:[DarkGreen]:[Blue]:[DarkBlue]:[Magenta]:[DarkMagenta]:[Yellow]:[Brown]:[Cyan]:[DarkCyan]:[White];
newcolor:=@Prompt([OkCancelList];"Choose a Color";"Choose the color to apply to the text: ";"Black";colorchoices);
@If(newcolor="[]";@Return("");
@Command([TextSetFontColor];@Subset(@Subset(colorcodes;@Member(newcolor;colorchoices));-1)))

I set the button caption to 'Change Font Color' and popup help to 'Change the font color' and chose the toolbar_paintblu.gif icon from the list of available icons.

Note that I said this was "quick and dirty". The code could probably be more efficient but it is functional. Note also that this button will work to set a font color at the insertion point or to change the color of selected text.

Enjoy!

Technorati:

Wednesday, January 31, 2007

Lotusphere 2007 Wrap-Up

This was my second Lotusphere and I felt a lot more comfortable all week. For one, I knew the physical spaces and had a better idea going in of where I was going and how much walking I would actually do. For another, I knew more people. And lastly, I planned to do the entire conference this year (being a newbie last year, I missed the Thursday afternoon fun of Gurupalooza, Ask the Developers and the Closing General Session).

So, along with the tens of other bloggers, I am submitting my summarized experience.

JumpStarts
These are so worth the extra day and the extra time. If they don’t directly provide you something you can use right now, they give you a good basis for exploring other things you can do with Notes/Domino. I got useful information on SOA (JMP402), salivated over – for just the first time this week – over the Eclipse SDK (JMP202), got to actually play with Eclipse a little in a hands-on and learned a lot more about DXL than I knew before (JMP302). I didn’t actually see Component Designer or Domino Designer 8 but I am really hopeful that they will incorporate a lot of the features of Eclipse, it is that cool.

General Sessions
Neil Armstrong! Genius pick! The response of the room and feeling I had when he came out were so different from last year. We had listened to a biography of him a few weeks back (First Man) and he came across as the same humble, likable guy he was portrayed as in the book. Thanks to Volker, we can go back to his presentation any time.

I can’t wait for Notes 8! The interface changes are outstanding and the composite applications are what we’re looking for to further leverage the Notes client. The Productivity editors are a great addition – and will be perfect once the LotusScript API is implemented. I also really like that there is an integrated RSS reader because maybe now I can really show others in my group the benefits of RSS.

Quickr looks very cool, and it’s great that the Personal Edition will be free. We’ve thought about looking at QuickPlace but haven’t been able to justify the additional cost. Now, we may be able to counter some of the lean toward SharePoint. And no additional software! No WAS, no Portal. Very nice!

Connections sounds like a good idea but will probably work best in large or geographically dispersed organizations where face to face (or over the cube wall) conversations can’t occur. I could also see smaller organizations that are idea/research driven get benefit from it. In looking at my own organization, we could benefit as a whole, but the IBM/Lotus base is so small, we wouldn’t get enough from it to justify the cost since it requires something beyond Domino to run. I liked Activities last year when they were demoed and they have certainly improved but we would still have a bit of a hard time selling the need for it given that we’d need another server to run it. Maybe my opinion will change if I can get some time with it at bloggingconnections.com.

The closing session with Neil deGrasse Tyson was really good. I had never heard of him and my first thought when he was introduced (as an “astrophysicist”) and he came out and said something about sharing thoughts “over the next 45 minutes” was “uh oh”. But he was really entertaining, even when telling us an asteroid passing close to Earth in 2029 (on Friday the 13th) might cause the destruction of life in 2036. Some of us, mostly bloggers, got a chance to talk to him for a few minutes afterward and he was very personable and gracious, and very relieved to hear that he had sufficient “geek cred” and had made relevant connections. It seemed an odd way to end though: he finished and there was a recorded announcement of “thanks for coming”. Maybe that’s usual though –it was my first closing session.

Sessions
Overall I was pretty happy with the sessions I attended. With the exception of just a couple, I can say I got something out of each one. I think my three favorites were Worst Practices (BP104), Writing Readable Code (AD502) and Designing the User Interface (BP101). I think Bill and Paul could do their Worst Practices every year because a) they are entertaining and informative and b) enough of us make mistakes for them to come up with 12 new things each year. Rocky’s session was really handy for comparing what we do to what other developers with more experience (and more co-workers) do. Our group tends to develop and maintain our own applications so this is good information for “succession planning”. Nathan and Chris presented some ideas that were way out of the traditional Notes-app box – and that is a very good thing. I had actually started experimenting with layers before, based on one of Nathan’s blog posts on one of the databases he demoed. I think they could easily do the session again next year with new and different interface ideas, and I’d probably attend again.

The OpenNTF and Blogger BOFs were great too. They definitely prove the vitality of the Lotus software community and the value that community can bring. As I said later to Ed Brill, I wish the Blogger BOF had included some time to see if anyone in the room was wondering how to start blogging. As approachable as this group of bloggers is, some people need to be approached rather than doing the approaching.

Other
Labs – If I am able to go again, this is one area I want to make time to visit. I was in the Meet the Developers and DPI labs but didn’t go in the Usability lab. I wish I had so I could spend some time on Notes 8 and all the other software that is coming.

Speedgeeking – This was phenomenal! With all the positive feedback and (I expect) word of mouth, this could get to be huge. And that would make it more difficult to pull off I think. A couple of things I heard and agree with would be larger tables (maybe rectangular and a small mic/amplifier for each speaker to accommodate a larger group.

Swan boat races – I had to bail on this (poor scheduling on my part – and thanks to Turtle for filling in for me) but it was a lot of fun to watch. Which leads me to…

Community – I hope everyone gets to the end of the week and gets a sense of the community among the people who use this software. I hope it isn’t just because of the group that I have connected with over the last couple of years. It started with one person I corresponded with through Notes.net and has grown from there. Maybe it comes from always feeling like we’re coming from behind (“Notes is Dead”, Notes has fewer seats sold, “there is a two-lane highway” – sorry, Alan) but the people I know care very much about this software, how it is updated and how it is perceived in the market. But most of all, they care about each other as people. And that is hard to beat.

Thanks for another great Lotusphere and I hope to be there again next year.

Friday, January 26, 2007

Lotusphere 2007: Final Day

Lotusphere 2007 is over. After a full five days, my brain is tired from everything that has been added - and my feet and legs are tired from all the walking.

Started the day (7am!) at the blogging Birds of a Feather. Lots of people were there, including a lot of the most common bloggers you hear about. This community has grown each year. I said last night that we need to give some focus to keeping the community growing so we don't just become an echo chamber. These people are all supportive of each other so contact anyone if you want to know more about blogging or wonder how to get started.

I did a hands-on about Low-Fidelity Prototyping. The idea is to develop the user interface first (before any coding) and use paper and pencil. That way the users can feel free to change anything to make it work better for them. It is a cool idea that I hope to try sometime soon.

The Great Code Giveaway, by Rob Novak (the LotusRockStar) and Viktor Kranz, had a lot of good things for web development. That doesn't affect me a lot right now but may come in handy later.

Gurupalooza got off to a kind of slow start but then got rolling. Probably the biggest thing that came out of that was bloggingconnections.com. That is where a Lotus Connections server will be, hosted by Chris Miller and Connectria, to help connect members of the Lotus community using the new Connections product.

Ask the Developers was pretty calm. Bob Balaban got razzed for not updating and finishing the LSX Toolkit, handed off the "traditional first question" and it went from there. The last question was whether Lotus would ever use Connections to back a social networking (eg. dating) site and one of the developers said they already had a name: the Quickr Picker Upper. It brought down the house.

The Closing Session featured Neil deGrasse Tyson, an astrophysicist with the research section of the American Museum of Natural History.

My evening closed with dinner with around 30 other bloggers. Ed Brill and Alan Lepofsky joined us, not as reps from Lotus but as friends and fellow community members. It was nice to talk with Alan, Ed, Bill Buchan, Andrew Kelly and others. Andrew was someone people lost track of during this past year and he said he was embarrassed that people had to work so hard to track him down. We finally settled (I think) that it wasn't necessary to be embarrassed, but to feel good that people cared enough to look.

Thanks to everyone for a great week. I need to take some time to digest everything and organize my thoughts, but I am excited to get back and start putting some of these new things to use. Hope to see you again next year (Jan. 20-24).

Tuesday, January 23, 2007

New (Radical?) Interface Ideas

Today, I attended the BP101 session on Why Interface Matters given by Chris Blatnick and Nathan T. Freeman. All I can say is "WOW!!" Talk about thinking out of the box! I can't even describe all the cool things they showed in Notes applications:
- All kinds of layers
- Editing without putting the document into Edit mode
- Embedded views and drag and drop in and out of folders

Then in the OpenNTF Birds-of-a-Feather (BOF) session, Nathan asked about something how we improve interfaces in Notes applications. Nathan, I think you just need to make your demo databases available in any manner possible. Yes, they involve more work but they are so innovative that they demand a closer look. The release of Notes 8 will provide the perfect opportunity for revamping applications since it will have such a dramatic effect on the overall user experience - the more people who can see these ideas, the better it will be.

Personally, I look forward to spending some time dissecting Nathan's demo databases and updating the interfaces on some of our apps.

Notes Phrases

I took two graphics that have been circulating and combined them so you can put them on your desktop if you want. Earlier in the year, the "Yeah, Notes can do that" meme was started as an adjunct to Lotus marketing. Then, right before Lotusphere, another idea (Notes Heroes) came out. I put the two of them together:


Let me know if you want a higher resolution version of the image.

Lotusphere 2007: First Two Days

There are plenty of people posting a lot of information about what has been going on here, particularly around the opening general session and all the announcements, so I won't just repost all of that same information. But I do have some observations.

It was very cool to see and hear Neil Armstrong. We just got done listening to a biography of him ("book on CD" called First Man) and learned what a humble man he is. In that sense, he was a perfect choice to speak because I find that many people in the Lotus community are a lot like him: willing to give whatever they can to help others in the community and dedicated to the common good.

I've been to a couple of things on web services and a number of sessions on the new composite application capability in Notes 8. I'm REALLY excited about what is coming with the new client. The code I have seen so far seems a little slow, but I still have only seen beta code running. You can do very cool things and do them very easily.

I also wish I were more of a Java developer because the Eclipse IDE is INCREDIBLY cool. I'm hoping to see more about updates to Domino Designer and explore Component Designer a little too.

Got some good information on writing readable code (my manager saw the session as well so I suspect there may be some new standards coming).

JAMFest was fun. Some interesting characters around (especially one dancing guy who galloped around the floor much of the night) and a few trainwrecks from the band. A good time had by all.

Off to breakfast and another long day. But it is all worth it in the end.

Monday, January 22, 2007

Tron

I got the 20th Anniversary edition of Tron for Christmas (yes, I asked for it). I put it on my iPaq and watched it on the flight down. Didn't quite finish it but it was fun to see it again. It definitely brought back memories. It was groundbreaking in its own way and deserves a look (or another look) if you haven't seen it for a while.

Sunday, January 21, 2007

SnTT: Lookup Names in Your Active Directory Global Catalog

We are a small Domino island is a large Microsoft sea. Recently, we implemented a web service that required access by non-Notes users to one of our Notes databases. As such, we needed a way to determine which documents those users were allowed to see and we decided to use their unique corporate identifier. Rather than forcing the users to type that information in (as well as the user's name so it was easy to identify) and/or look the names up manually in some external system, we developed a dialog that uses the Active Directory Service Interface objects.

The form enables a user to enter a full or partial last name plus (optionally) a full or partial first name. When the Search button is clicked, the code looks in the Global Catalog and returns the list of names and unique IDs. Due to the 64K limit on fields, the list will only return 1000 names and will inform the user that there are more names and that they should refine their search term to reduce the list.

In the code, doc.SearchString is the field on the dialog where the user enters what they are searching for. You need to replace GlobalCatalog.url with the path to your global catalog. I did not include the code but we also implemented a sort routine to provide the returned list in alphabetical order.



Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim doc As NotesDocument
Dim objConnection As Variant
Dim objCommand As Variant
Dim LastName As String
Dim ID As String
Dim FN As String
Dim LN As String
Dim nameSearch As String
Dim NameList() As String

Call NEMEnableWaitCursor
Set doc = ws.CurrentDocument.Document
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"

Set objCommand = CreateObject("ADODB.Command")
Set objCommand.ActiveConnection = objConnection

If Instr(doc.searchString(0),",") = 0 Then
nameSearch = "(sn=" & doc.searchString(0) & "*));"
Else
nameSearch = "(sn=" & Strleft(doc.searchString(0),",") &_
"*)(givenName=" & Strright(doc.searchString(0),",") & "*));"
End If

objCommand.CommandText = _
";" & _
"(&(objectCategory=person)(objectClass=user)" & _
nameSearch & _
"sAMAccountName, givenName, sn;subtree"

On Error Goto LookupError
Set objRecordSet = objCommand.Execute
On Error Resume Next

x = 0
Redim Preserve NameList(x)
While Not objRecordset.EOF
ID = objRecordset.Fields("sAMAccountName").value
Redim Preserve NameList(x)
If Isnull(objRecordset.Fields("sn").Value) Then
LN = ""
Else
LN = objRecordset.Fields("sn").Value
End If
If Isnull(objRecordset.Fields("givenName").Value) Then
FN = ""
Else
FN = objRecordset.Fields("givenName").Value
End If
NameList(x) = LN & ", " & FN & nl & " (" & ID & ")"
If x >= 1000 Then
Messagebox "Your search produced a very large list of names so the list only " &_
"includes the first 1,000 found. If the name you are looking for is not in the list, " &_
"try searching again with more of the last name and/or first name.",64,"Large Result"
Goto DisplayIt
End If
x = x +1
End If
objRecordset.MoveNext
Wend

DisplayIt:
Call NEMDisableWaitCursor
If NameList(0) = "" Then
Messagebox "No users found meeting your criteria; please revise " &_
"and try again",64,"Name Lookup"
Exit Sub
End If

objConnection.Close

doc.searchResults = sortValues(NameList)
Call ws.CurrentDocument.Reload
Call ws.CurrentDocument.Refresh
Exit Sub

LookupError:
Messagebox "The search caused an error, most likely because you " &_
"are not on the network. Please try the lookup again later.",48,"Error"
Call NEMDisableWaitCursor
objConnection.Close
End
End Sub


This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.


Technorati:

Thursday, January 11, 2007

eCoupled Looks Kewl!

I just saw this article about eCoupled. It is a system to provide recharge capabilities without any wires (well, except maybe for one for the eCoupled device to plug in). Assuming they can get this commercialized and it isn't really expensive, I'd be all over this. I thought the iGo products were cool but this beats all that!

SnTT: Sorting a NotesDocumentCollection - Ascending *or* Descending

Finally I have time for another SNTT post! This one shows, I suppose, the power of the collaboration that goes on in the Notes/Domino community.

I needed to be able to sort a collection of documents for my web service project and was lucky enough to find pretty much the exact code I needed at Per Henrik Lausten's site. He had taken code from a couple of other guys and combined it together. The one thing it didn't do which I needed was to be able to sort in Ascending or Descending order.

It was a pretty easy change to make. And here is the code. Note: I only include the sortCollection code because that is all I changed - you will need the sortValues code from Per Henrik's or Joe Litton's site for everything to work.



Function sortCollection(coll As NotesDocumentCollection, fieldnames() As String,
sortOrder as String) As NotesDocumentCollection

' Description:
' Sorts and returns a NotesDocumentCollection
' Fieldnames parameter is an array of strings
' with the field names to be sorted on
'
' Modified by Don McNally, December 2006 - http://dmcnally.blogspot.com/
'
' Based on code by:
' Max Flodén -
http://www.tjitjing.com/blog/2006/05/how-to-sort-notesdocumentcollection-in.html
' Joe Litton - http://joelitton.net/A559B2/home.nsf/d6plinks/JLIN-5ZU3WH
' Peter von Stöckel -
http://www.bananahome.com/users/bananahome/blog.nsf/d6plinks/PSTL-6UWC7K
' Per Henrik Lausten, November 2006 -
http://per.lausten.dk/blog/2006/10/sorting-notesdocumentcollection-by.html
'
' Example of use
' Dim fieldnames(0 To 2) As String
' fieldnames(0) = "SKU"
' fieldnames(1) = "OrderDate"
' fieldnames(2) = "Client"
' Set collection = SortCollection (collection, fieldnames)

Dim session As New NotesSession
Dim db As NotesDatabase
Dim collSorted As NotesDocumentCollection
Dim doc As NotesDocument
Dim i As Integer, n As Integer
Dim arrFieldValueLength() As Long
Dim arrSort, strSort As String
Dim loopCount As Integer, loopStart As Integer, loopEnd As Integer, loopStep As Integer

Set db = session.CurrentDatabase

' ---
' --- 1) Build array to be sorted
' ---

'Fill array with fieldvalues and docid and get max field length
Redim arrSort(0 To coll.Count -1, 0 To Ubound(fieldnames) + 1)
Redim arrFieldValueLength(0 To Ubound(fieldnames) + 1)
For i = 0 To coll.Count - 1
Set doc = coll.GetNthDocument(i + 1)
For n = 0 To Ubound(fieldnames) + 1

If n = Ubound(fieldnames) + 1 Then
arrSort(i,n) = doc.UniversalID
arrFieldValueLength(n) = 32
Else
arrSort(i,n) = "" & doc.GetItemValue(fieldnames(n))(0)
' Check length of field value
If Len(arrSort(i,n)) > arrFieldValueLength(n) Then
arrFieldValueLength(n) = Len(arrSort(i,n))
End If
End If

Next n
Next i

'Merge fields into array that can be used for sorting using the sortValues function
Dim aryFieldValues() As String
For i = 0 To coll.Count - 1
Redim Preserve aryFieldValues(1 To i+1)

strSort = ""
For n = Lbound(fieldnames) To Ubound(fieldnames) + 1
strSort = strSort & Left(arrSort(i,n) & Space(arrFieldValueLength(n)), arrFieldValueLength(n))
Next n

aryFieldValues(i+1) = strSort
Next i


' ---
' --- 2) Sort array using sortValues function by Joe Litton
' ---
arrSort = sortValues(aryFieldValues)

' ---
' --- 3) Use sorted array to sort collection
' ---
Set collSorted = db.GetProfileDocCollection("Foo") ' create an empty NotesDocumentCollection
If ucase(sortOrder) = "D" Then
loopStart = Ubound(arrSort)
loopEnd = 1
loopStep = -1
Else
loopStart = 1
loopEnd = Ubound(arrSort)
loopStep = 1
End If
For loopCount = loopStart To loopEnd Step loopStep
Set doc = db.GetDocumentByUNID(Right(arrSort(loopCount), 32))
Call collSorted.AddDocument(doc)
Next

' ---
' --- 4) Return collection
' ---
Set SortCollection = collSorted

End Function



This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.

I had some thoughts about extending the code even further to allow different sort orders for the different fields (like Ascending on the first field and Descending on the second) but didn't end up needing it for my project. Hope you find this useful.

Technorati:

Wednesday, January 10, 2007

Looking for an RSS reader?

I use an RSS reader application to keep up with some of the feeds I read. I use Thunderbird for some of them and I have tested Google Reader but I also use a dedicated RSS reader application for the majority of my feeds.

I started out with FeedReader but at version 2.9 it stopped working behind our firewall. I looked at SharpReader but it also had problems behind the firewall. Then I went to RSSReader and I liked it but it got to the point where it was getting very long in the tooth (read: it wasn't being updated).

Then I found RSSOwl (it was on a this list). It is a free open-source app built on Eclipse and, so far (since November), has met all my needs and expectations. It has kind of a cool interface in that each feed opens in a tab so you can switch from one feed to another and not lose track of where you were. It reads RSS, RDF and Atom feeds and I haven't hit one yet it couldn't read (RSSReader complained a lot about "broken" feeds).

Check it out if you like to use an RSS reader app and don't mind getting one for free.

Monday, January 8, 2007

Reviving?

Like jonvon, I've been pretty quiet lately. I've been reading blogs but haven't had a lot of time to post anything of my own. I hope to try to get back to it, at least for SNTT.

Anyway, I found LifeHacker a while back and have found some really cool tips on it. It's one of my new favorite feeds/sites. In fact, one of the Christmas presents I asked for (and got), a GorillaPod, was because I saw it on LifeHacker. Not everything is applicable but there are usually a couple of things a week that I wouldn't have thought of otherwise. Like this one (great if you have younger kids).

Another site I found thanks to LifeHacker is GiveawayOfTheDay. They work with software vendors to have a piece of software you normally have to pay for be available for free for a day. You have to download, install and activate the software that day for it to be free and I think you'd have to purchase it if it needed to be reinstalled later, but I've had a couple of things in the couple of weeks I've been subscribed to their feed.

That's my public service for today.

Monday, October 23, 2006

Help an iPod Find Its Home

I saw this post this morning on David Berlind's blog at ZDNet. I have no illusions that anybody who reads this blog owns the iPod in question, or even knows the person who does, but I thought it sounded like an interesting experiment if nothing else.

Friday, October 20, 2006

Not the sharpest knife in the drawer...

You don't tug on Superman's cape, you don't spit into the wind, you don't make jokes at an airport security checkpoint, and you don't have a "who can write the scariest threat contest" on the Internet. Hey, dude, you apparently won!

Even in these days where political correctness and "message control" are in full effect, there is a line between speaking freely and being stupid. He appears to be the only prize winner in the "contest". He shouldn't go to prison for doing something stupid but let's hope this is the end of his 15 minutes.

Tigers and K-Wings and Snow. Oh My!

Has it really been that long since I posted something here? Boy, you'd think I had other things going on or something.

Anyway, how about those Tigers? A rematch of '68 (and '34 for that matter). My father-in-law has started getting our 8-year-old into watching baseball so I have a feeling we'll be watching as many of the games as possible. Unfortunately, MLB is still starting the games late enough to make it hard for younger school-age kids to be able to see them. And we won't see much of game 1 anyway because...

The Kalamazoo Wings (2005-06 Colonial Cup Champions) have their home opener tomorrow night. After their first championship in 26 years, they will raise the banner and unveil their rings. It should be a lot of fun, including indoor fireworks. Hope the baseball game doesn't keep the crowd down too much.

We had our first snow last week. It's gone and has been relatively warm this past week but we're heading into another cold spell and they are using the "s" word again for Sunday and early next week. It's way too early for snow, but that's Michigan weather for you. I missed it last week because I was in Puerto Rico but won't be so lucky this time.

Oh, and I get to go to Lotusphere again! Woohoo (or is it w00t?)!

Friday, August 25, 2006

SnTT: Web Services that Return Arrays

Be prepared: this is a longer post than usual. I wrote my first web service the other day. I was pretty excited the first time it actually worked (if you use Visual Studio to develop, always remember to save your work before you try to test your code!). So, aside from not saving my code before testing, the thing that slowed me down the most was figuring out how to handle the data that was coming back from the web service. I was sending back an array of a user-defined class and while I found a couple of good articles (IBM ID required on this one) on writing the web service so it would return what I wanted, I couldn't find anything about how to handle it in the calling program. But now that I have figured it out, I thought I'd share with the class.

This is a scaled down version of my web service code:


Public Class OneIssue
Public IssueNumber As String
Public IssueTitle As String
Public IssueDesc As String
Public IssueStatus As String
Public IssueTargetDate As String

Sub New

End Sub

Sub ReadValues(doc As NotesDocument)
IssueNumber = doc.IssueNumber(0)
IssueTitle = doc.IssueTitle(0)
IssueDesc = doc.IssueDesc(0)
IssueStatus = doc.TrackingDisposition(0)
IssueTargetDate = doc.TargetCompletion(0)
End Sub
End Class

Public Class IssueArray
Public MultipleIssues() As OneIssue
End Class

Public Class LOBReport
Private session As NotesSession
Private db As NotesDatabase

Sub New
Set session = New NotesSession
Set db = session.CurrentDatabase
End Sub

Public Function GetIssues(OrgUnit As String) As IssueArray
Dim dc As NotesDocumentCollection
Dim docIssue As NotesDocument
Dim view As NotesView
Dim x As Integer

Set GetIssues = New IssueArray
Set view = db.GetView("ByBusUnit")
Set dc = view.GetAllDocumentsByKey(OrgUnit)
If Not dc Is Nothing Then
x = 0
Set docIssue = dc.GetFirstDocument
While Not docIssue Is Nothing
Redim Preserve GetIssues.MultipleIssues(x)
Set GetIssues.MultipleIssues(x) = New OneIssue
GetIssues.MultipleIssues(x).ReadValues(docIssue)
x = x + 1
Set docIssue = dc.GetNextDocument(docIssue)
Wend
End If
End Function
End Class


This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.


Notice the classes at the top that define a single record of the class and the array of the first class. So what do you do with that in your calling program? My front end is a "proof of concept" at this point so I used Visual Studio.net to create a small Windows program. I won't get into the details of setting up your VS.net project and referencing the web service, but this is the code that calls the web service and handles the returned value:


Dim LOBReport As New webserverreference.LOBReportService
Dim retval As New webserverreference.ISSUEARRAY
Dim x As Integer
Dim y As webserverreference.ONEISSUE
Dim z As Integer
Dim strings(0) As String

TextBox1.Clear()
z = 0
retval = LOBReport.GETISSUES(ComboBox1.Text)
If Not retval.MULTIPLEISSUES Is Nothing Then
For x = 0 To UBound(retval.MULTIPLEISSUES)
y = retval.MULTIPLEISSUES(x)
ReDim Preserve strings(UBound(strings) + 6)
strings(z) = "Issue Number: " + y.ISSUENUMBER
strings(z + 1) = "Issue Title: " + y.ISSUETITLE
strings(z + 2) = "Issue Description: " + y.ISSUEDESC
strings(z + 3) = "Issue Status (LOB): " + y.ISSUESTATUS
strings(z + 4) = "Issue Target Completion: " + y.ISSUETARGETDATE
strings(z + 5) = ""
z = z + 6
Next
TextBox1.Lines = strings
Else
TextBox1.Text = "No records found, or user not authorized for business unit"
End If
End Sub


At the top, I define objects of the type defined in the classes in my web service, both the single item class and the array class. Then I loop through the array and process each item in it as an instance of my single item class.

Maybe the problems I had were because I haven't used Visual Basic much, but I hope putting this out here saves someone else some time.

Technorati:
Categories: Show-n-Tell Thursday_

Tuesday, July 25, 2006

Why So Quiet?

For those (three - haha) of you who read this, sorry I have been out of touch the last couple of weeks. I just returned from my annual trip to Dayton for Marianist LIFE Central (more info here). Each summer, we have a week-long retreat for high school students and I am on the planning/coordinating team, plus the lead music minister.

We had a community of 66 students and 31 adult moderators and had a great week. I'm still kind of tired but it was all worth it, as usual.

eWeek Article on Competitors to Exchange 2007

Saw this article in eWeek describing some of the competitors to the upcoming Exchange 2007. Some good quotes from Ken Bisconti are in there.

My question is why the only quotes related to Notes/Domino are from IBMers (well, except for the "senior solutions engineer" who has used Lotus Notes in the past but "feels that has a much more user friendly end-user experience with Exchange")? Where are the business partners, integrators and non-IBM evangelists? The article links to the Application Analyzer and Data Migrator tools, which have been thoroughly dissected by Paul Mooney, David DeWell and others but there is no mention of how the tools may not work all that well. Heck, a simple Google search turns up both Paul's and David's analyses in the first 10 results.

Maybe some in our community need to make themselves known to more journalists.

Friday, July 7, 2006

Goodbye, Stevie Y.

I can't believe that Rob and The Lion King haven't posted anything about this (but Phil has), but I was saddened to see Steve Yzerman retire from the Red Wings. I know it had to happen some time and that the last couple of years have been painful for him (and, at times, painful to watch) but it is still sad.

He has been my favorite player since I started really following the Wings about 20 years ago. From his early days of flying around the ice, seemingly scoring goals at will, to the later years of making the necessary plays and steadying the ship when needed, he has been fun to watch. I still wince when I think about him sliding into the goal post and wrecking his knee. And I can still picture a few years ago playing against Pittsburgh, weaving through players and scoring while being ridden toward the boards and skating on one leg.

I doubt I will ever get one (because I don't really need it), but I've always said if I bought another hockey jersey, it would be a white #19 Red Wings jersey. Too bad they won't have a Stanley Cup banner to raise at the same time they retire his number this fall. Thanks, Steve!