• Browse Blogs
  • My Blog
  • My Updates

+Tags Get help with tags?

  • View as cloud  | list

+ Similar Blogs

photo

Lotus Nut

124 Entries |  Chris Whisonant
Updated 
RatingsRatings 29     CommentsComments 174
photo

Beyond The Ye...

330 Entries |  Peter Presnell
Updated 
RatingsRatings 21     CommentsComments 572
photo

Yellow is the...

72 Entries |  Tim Tripcony
Updated 
RatingsRatings 2     CommentsComments 34
photo

Patrick Picar...

69 Entries |  Patrick Picard
Updated 
RatingsRatings 2     CommentsComments 124
photo

off the Hook ...

55 Entries |  Scott Hooks
Updated 
RatingsRatings 8     CommentsComments 84

+ Blog Authors  

1 - 15 of 124
  • Page   1
  • 2
  • 3
  • 4
  • 5
  • ...
  • 9

Gone fishing

Karl-Henry Martinsson |   | Tags:  vacation personal | Comments (0)  |  Visits (121)
 Right now I am finishing my last few things at work, and in about 30 minutes I will be heading to the DFW International Airport and begin a 2 week vacation together with my son.
We will first go to London, where I hope to see one of my childhood friends. We have been friends since first grade. Then Saturday evening I am flying to Stockholm, Sweden to spend almost 2 weeks with my sister, as well ass meeting up with some old friends and family.
My son is excited about seeing a new country and city, but he is most excited about seeing his aunt in Sweden again. This will be his 4th trip to Sweden, and he also got to visit Germany during one of those trips (in 2007).
Sweden and much of Europe have been having some hot weather lately, but it looks like it is cooling down to a very comfortable temperature. Forecast for the next 5 days in Ft Worth, TX: 
image 
 The same time period in Stockholm, Sweden: image
Because of my vacation being right before IamLUG, I will not be able to go this year.
 
No RatingsRatings 0

Am I a real Notes/Domino programmer?

Karl-Henry Martinsson |   | Comments (0)  |  Visits (391)
A couple of posts by Peter Presenell and Dan Lowden made me think. Am I a real Notes/Domino developer/programmer? At least my business card says so. I think I am. But what makes me a "real" Notes programmer?
 
First of all, I make a difference between a programmer and a developer. My definition of a programmer is someone that pretty much just produce code, but is not that involved in the actual design of the application. A developer is more involved in actually designing the application, not just writing the code.
But for this discussion, I will use the term programmer, as I will focus on the programming part
 
I do not think the languages one uses is what makes you a real programmer or not. I think it is in your mind and approach to programming.
  • A real programmer "thinks code" all the time. Not just at work.
  • A real programmer is a problem solver. He/she can't resist trying to solve a problem when presented with one, may it be computer related or not.
  • A real programmer constantly try to improve himself and his applications, going back to fix old code to work better/faster, make the user interface better and more efficient, etc.
  • A real programmer understands the need of user/customer and can come up with solutions for them.
  • A real programmer have a set of functions in his "toolbox" that can be used in different applications, saving development time.
  • A real programmer can learn new languages and tools when needed. Knowledge about the syntax of a languages does not make you a good programmer, knowledge about how to write efficient and useful code makes you a good programmer.
 I don't program in Java. I don't work with Xpages (yet). When I got my first full-time position as a Notes developer in Boston, my boss-to-be called one of my references and asked if I knew Lotusscript, and how good. My reference, a friend where I had mainly been helping him with development for the web using HTML and @Formula language, answered back something like this: "I don't know how well he knows Lotusscript, but if he does not he will learn it in no time".
To me, that was one of the greatests comments I been getting. I think that is a sign of being a good/real programmer, to be able to learn new tools as they are needed. I am sure that as soon as we get Notes 8.5.1 here at work, I will start working with Xpages. But until then I have very little extra time to play with that technology.
 
However, even if I consider myself a good Notes/Domino developer, I don't think I am in the same class as many of the "rockstar" developers in the community. I am sure you know who I am talking about, people like Nathan T Freeman, Tim Tripcony, Matt White, Mikkel Heisterberg, Viktor Kranz, Julian Robicheux, et al.
No RatingsRatings 0

I love being a Notes developer!

Karl-Henry Martinsson |   | Tags:  development | Comments (0)  |  Visits (485)
Lotus Notes is a great tool, and I enjoy developing applications using the RAD capabilities in Domino Designer. But I also create some web applications on occasion.
This past week, when Hurricane Alex was moving in towards Texas, John, the CIO (and my boss), grabbed me first thing Wednesday morning and asked me to build a webpage. He wanted me to use the Google Earth plugin to consuming some KML files he created from the policy database (built using Visual FoxPro).

As I blogged about a year ago, I wrote some code to get the latitude and longitude for an address, and John had then rewrote the code for FoxPro so he could get the coordinates for the addresses he had in his system. So he could now very easily generate a couple of KML files, one of all our policies and one of the policy holders potentially in the path of the hurricane.
I built the webpage in a Domino database, that is usually the easiest way for me to put up a simple webpage. I added some overlays, the two different KML files that John created. I also found a KML file online with different projected paths, as well as one of the current path of Alex. The users could turn on and off these layers as they wanted. Suddenly it was very easy to see if we had any insured customers in the path, etc.

Of course, the same web page could as easily have been created using Notepad or any other tool, as it was pure HTML. But my next plan is to integrate this page with other Domino data, and we are talking about building a generic reporting tool with all different kind of geographic data. Imagine being able to map every accident/insurance claim, see where the accident happens, where the insured is located, etc. Perhaps run statistics showing the average distance from home the accidents take place, etc.

I think it is critical that I, as a Notes/Domino developer, show the power and business use of Notes by integrating it with different systems. When I first started working at this company, I was tasked with building a claim system, to handle insurance claims. The company had hired a pair of Notes consultants, who set up the environment and attempted to build a claim system. They failed, and they also told everyone that Notes and FoxPro could not talk to each other. Of course, when I came in and sat down with my (then) new boss after a few weeks at the new company, we quickly figured out a way to get the systems to communicate.
It took about 90 minutes to come up with the solution (using COM), write the basic specifications (yes, they changed some over the years, but not much), build the COM object and write some test code in Notes. Today, that COM object is used for all kind of things we never envisioned back then, in 2002. It even sends PDF files into our document imaging system.

Of course, it helps to have a CIO/manager who talks and thinks development. I don't have to explain things that are obvious to me, we can go straight at the business logic or functionality. Something that would take 10-15 minutes to explain to a regular manager just takes seconds or a minute.

My next project, which I will start on Monday, is a database to document the claim system. There are so many design elements, with different functionality and access rights. Some buttons are hidden from certain users, using roles or document status, other design elements are restricted in other ways. Very little of this have been documented over the years, and I need to get all that documented in a good way. That is the power of Notes: I have a need, I build a solution.

RatingsRatings 1

Notes developer - not a dead profession!

Karl-Henry Martinsson |   | Comments (0)  |  Visits (452)
The last few weeks have been slightly turbulent in the Yellowsphere, with JonVon starting a discussion about the future of Notes development with his Lotus Notes: The Long Goodbye.
I am lucky enough to have a solid position as a Lotus Notes developer at a Dallas-based insurance company. Notes is not going away from here any times soon, as a matter of fact we are moving rapidly towards getting the latest versions. We are just now in the final phase of getting all users on Notes 7. This is done at the same time we are moving most branch offices to Citrix. Very soon we are planning to move everyone up to Notes 8.5.1 as well. Our current plan is to wait about 6 months after the release of a new version to push it out, to let any bugs get fixed.
 
The exciting news is that after 8 years at the company as me being the only Lotus Notes developer, we might even hire another developer to help me out, so I can spend more time on the architecture and design, and less on support. I spend about 40% of my time (more at times) at supporting end users. I also support the rest of the IT department (mainly the operations manager and the desktop support group) with Notes knowledge when needed.
So there are companies hiring. As soon as there is an official job posting I will publish it here. 
 
So Notes is not dead. As a matter of fact, several of the most important applications here are based on Notes.
 
 
No RatingsRatings 0

Fathers Day

Karl-Henry Martinsson |   | Tags:  personal | Comments (0)  |  Visits (231)
Today is Father's Day here in the US. In Sweden it is actually celebrated in November (Nov 14 this year). I am thinking about my dad, who passed away in 2001.
My dad was a very intelligent person. He may not have had a fancy education and degree. As a matter of fact, he just had six years of school back in the 1930's (he was born in 1926), then he had to start working. But he could build pretty much anything. He built us a summer house from scratch. He even did the design and the drawings/blueprints himself. At home he had a real architect drawing table. But he also repaired all kind of things down in the basement. He built his own tools, a powerful electrical motor and some pieces of scrap metal, and he had a lathe. When my sister needed a violin, he simply built one. And yes, it sounded great!
After I moved to the United States in 1998, he got a computer, and at age 70 he started learning how to use it and to send email.
image Working on the summer house, circa 1974

image Taking a break from the hard work.

imageBuilding a violin.

But my dad was not always working. Yes, he did work a lot, both to support the family and to (litterally) put a roof over our heads. But he also had time for me and my sister.
We went fishing, sailing (he got us a small sail boat and put me and my sister in sailing classes), and worked in the vegetable patch together with mom.
image At Midsummer celebration, circa 1976.

There are so many things that make me proud of my dad, I can't list them here. But he was a great role model for me, and I hope my son Erik one day will be able to think at me in a similar way. He was also, for a very brief time, a grandfather. He died in March 2001, but not until after he got to see and hold his first and only grandchild. Erik was born in August 2000, and he (together with my sister) visited us in early November.
I was told that he printed out the pictures I mailed him, and was showing them to all his friends. He was so proud! I wish he would have lived a few more years so he could have seen Erik starting to grow up.

image Holding his grandson Erik, Boston November 2000.

image One more of the proud grandpa.

image Funeral, April 2001.

Thank you for everything, dad. I will always miss you.
Stig Martinsson
1926 - 2001



No RatingsRatings 0

Downtown Ft Worth - Condos

Karl-Henry Martinsson |   | Tags:  photography | Comments (0)  |  Visits (201)
 image
This picture, and the two previous ones, were taken with my Nikon D90 fitted with a Tamron 18-270mm lens. No tripod was used. The pictures were taken yesterday evening around 19.30 in the Sundance Square area of Ft Worth.  Click on the images to see the full versions.

No RatingsRatings 0

Bass Performance Hall, Ft Worth TX

Karl-Henry Martinsson |   | Tags:  photography | Comments (0)  |  Visits (194)
 image
No RatingsRatings 0

Downtown Ft Worth - New and Old

Karl-Henry Martinsson |   | Tags:  photography | Comments (0)  |  Visits (135)
 image
No RatingsRatings 0

Ubuntu 10.04 being released today

Karl-Henry Martinsson |   | Tags:  ubuntu | Comments (0)  |  Visits (357)
The latest version of Ubuntu, code name Lucid Lynx and with the version number 10.04, is being released today. Due to a problem in Grub, the boot manager, the release have been delayed somewhat, but hopefully it will be out today.
Among the news in this version, which is a LTS (Long Term Support) version, is a further polished user interface, with many similarities to MacOS. The maximize/minimize buttons are now defaulting to the left side of the title bar, but of course the user can move that around and reconfigure the interface.
Built-in support in the operating system for social network sites/services is something that very few, if any, operating systems have. The cloud storage service Ubuntu One have been updated with additional functions, you can now access contacts and files stored in the cloud from mobile phones/devices. No Windows client, though, so you can't access your files at home from your Windows computer at work. Ubuntu One will also allow you to share files with family and friends in an easy way. Every Ubuntu user get 2 GB free storage, and for $10/month you get 50 GB storage.
The software repository/manager have been updated, and an online music store for DRM-free music have been added.
Some programs have been removed (GIMP being one of them) and others have been added (for example the video editing program PiTiVi).
Another thing that Canonical, the company behind of Ubuntu, have been pushing is faster start-up time. I don't restart my computer that often, so 10 seconds of 25 seconds is no big deal to me. But for laptops it is nice. Talking about laptops, there will also be a special "Remix" version for netbooks.
As always, you can download and burn an ISO image and test it on a computer without having to install anything. This will test your hardware and give you an idea about the looks and functionality of the operating system.
 
As my FaceBook and twitter followers might have noticed last night, I cleaned and backed up my existing system (using Clonezilla, highly recommended tool) in anticipation of installing 10.04 in the next day or so. I plan to first try an install on top of the existing version 9.10, then make a backup of that, wipe the partition and install 10.04 from scratch to see if any of the hardware I hjad to get separate drivers for is now supported out of the box.
No RatingsRatings 0

My Favorite Tools

Karl-Henry Martinsson |   | Tags:  tools development | Comments (2)  |  Visits (468)
 Kathy Brown today asked "What's Your Favorite Tool", so I thought I wanted to share the tools I use.
My favorite tool is probably NoteMan from MartinScott. If I have to pick one tool from the suite, it would be either NoteMan.Editor or NoteMan.DocDelta. It is very hard to decide between the two of them. Editor is great for editing documents, see the contents of different fields and even change data types. I use it to get the UniversalID of documents and much more. DocDelta help me solve replication conflicts quickly and easy. I can higly recommend the NoteMan suite of tools to any Notes/Docmino developer, and for the price ($395 for the whole suite), you get a lot of functionality.
 
I also use several tools from TeamStudio and Ytria. Yes, I am lucky enough to have a boss who believe in getting me the tools I need.
 
From TeamStudio I use Undo (previously called Snapper) to make snapshots of the design while developing for easy roll-back, Profiler to find performance issues in my code and Configurator for search-and-replace through-out a database (design and/or documents). Those tools run around $500 each, if I recall correctly. I also use their free class browser, a tool I highly recommend to everyone doing object oriented Lotusscriupt development.
 
From Ytria I use a number of tools. The two I use the most are scanEZ and actionBarEZ. The latter is great when I want to apply a specific design of action bars to many forms and/or views. I design the action bar in one view, with colors, fonts, backgrounds, etc. When I am satisfied I can update all views and forms the the database with the new design. I don't use scanEZ as much, but still on a regular basis. It also have functions to identify replication conflicts, like NoteMan.DocDelta, but the two tools complement each other. Using scanEZ, I can locate and delete documents of a particular type, including profile documents, and much more. I also sometimes use designPropEZ to check the design of a database and make sure it does not inherit element from the wrong templates/databases.
 
Here is my currect toolbar with all my development tools: 
image
 
 
 
In addition I use Photoshop CS2 for graphics editing and TechSmith Jing to create screencam demos for managers/users.
No RatingsRatings 0

Object Oriented Lotusscript for beginners - Part 2

Karl-Henry Martinsson |   | Comments (0)  |  Visits (403)
In my previous post I wrote about why I use object oriented Lotusscript. Let's look at how it can be used in a real-life application.
 
Background 
At my work I developed a system to handle insurance claims. Each claim can have one or more claimants, people or parties that have either BI (bodily injury) or PD (property damage) claims related to an accident. Each claimant get a reserve setup, an amount of money the adjuster think it will cost to settle the claimant. There are two reserves for each claimant, one for loss payments and one for expense payments. The latter can be payments for police reports, field adjusters, lawyer fees, etc while loss payments are the actual damages (payments to body shops, medical payments, etc).
When payments are made, the reserve amounts are reduced, until reaching zero. No more payments can be done then until the reserve is increased. Each adjuster have a limit to how large reserve he or she can set, higher reserve must be approved by a manager.
 
Data storage 
When the claim system was first put in place, all reserves and payments were stored in the Notes database. They were then (manually) transferred into a backend system built in Visual FoxPro.  But after a few years, a COM object (dsClaimLink) was developed and the Notes database is now sending all financial transaction into the backend, and retrieving financial information the same way when needed. Claim information is stored in the Notes database, as is claimant information. Some claimant information. a sub-set of the data stored in Notes, is sent to the backend as well.
 
Original design
Initially I built a large number of functions and subroutines, organized in different script libraries based on functionality. This actually worked really good, and the code was fairly easy to maintain, modify and expand. When the financial transactions were moved to the backend, I just had to modify the function GetAvailableAmount() to call the backend instead of looking up the amount in the Notes database. But it was still not very flexible, and I had some code that was duplicated in many places (most of it related to calling the COM object). So about two years ago, I started refactoring my code, both to make it faster and easier to maintain, by using object oriented Lotuscript.
 
Example
Below are examples of the code in the script library Class.ClaimData class. This is not my exact production code, I have removed a number of lines to make the example more clear.
The ClaimData class (described in next posting) contains an array of claimants, each of those an object. Each claimant object in turn contains an object containing the different amounts (loss reserve/loss payments, expense reserve/expense payments, recovery amount, etc).
 
First, let's look at the AmountData object.
Class AmountData Public lr As Currency ' Loss Reserve Public er As Currency ' Expense Reserve Public lp As Currency ' Loss Payments Public ep As Currency ' Expense Payments Public slp As Currency ' Supplemental Loss Payments Public sep As Currency ' Supplemental Expense Payments Public rec As Currency ' Recovery amount Public lossavail As Currency Public expavail As Currency Public Sub New() rec = 0 slp = 0 sep = 0 lr = 0 er = 0 lp = 0 ep = 0 lossavail = -1 expavail = -1 End Sub Public Sub Load(claimnumber As String, claimant As Integer) Dim success As Integer Dim servaddress As String Dim xmldata As String Dim claimlink As ClaimLink ' Object to connect to backend Set ClaimLink = New ClaimLink() ' Create object/class If claimant = 0 Then ' Get total amounts for all claimants success = claimlink.GetClaimStatus(claimnumber, Today()) Else ' Get amounts for selected claimant success = claimlink.GetAmountsByClaimant(claimnumber, claimant, Today()) End If If success = True Then ' Data returned successfully xmldata = claimlink.GetDataXML() rec = Cstr(Ccur(XMLGetValue(xmldata,"recovery"))) slp = Cstr(0-Ccur(XMLGetValue(xmldata,"losssup"))) sep = Cstr(0-Ccur(XMLGetValue(xmldata,"expsup"))) If claimant = 0 Then ' All claimants lr = Cstr(Ccur(XMLGetValue(xmldata,"lossorig")) + Ccur(XMLGetValue(xmldata,"losschg"))) er = Cstr(Ccur(XMLGetValue(xmldata,"exporig")) + Ccur(XMLGetValue(xmldata,"expchg"))) Else ' Specified claimant lr = Cstr(Ccur(XMLGetValue(xmldata,"lossres")) - Ccur(slp) + Ccur(rec)) er = Cstr(Ccur(XMLGetValue(xmldata,"expres")) - Ccur(sep)) End If lp = Cstr(0-Ccur(XMLGetValue(xmldata,"losspaid")) - Ccur(slp)) ep = Cstr(0-Ccur(XMLGetValue(xmldata,"exppaid")) - Ccur(sep)) lossavail = Ccur(lr) - Ccur(lp) expavail = Ccur(er) - Ccur(ep) End If End Sub End Class
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
As you perhaps noticed, I encapsulated the dsClaimLink functionality in an obect as well. I am also using my own XML parsing functions, as the system was built in Notes R5.
When the object is created, I do not lead the amounts directly. I just set all amounts to 0, with two exceptions. The available amounts are set to -1 (a value they will normally never have). This indicate that data have not been loaded, or that the attempt to load data failed.
The Load() method of the class call the COM object (dsClaimLink) with one of two functions depending on how the method is called. This let me use the AmountData object not just for amounts for a specified claimant, but also for claim level amounts, totals for all claimants.
 
Next we have a small object used to decide if a claimant is open or closed. The expense and loss parts of a claimant can be closed and (re-)opened individually. If either is open, the claimant is open, if both are closed, the claimant is considered closed. That is why I built this object, to get an easy status indication in the claimant object.
Class ClaimantStatusData Public loss As String Public expense As String Public claimant As String Public Sub new(doc As NotesDocument) If Lcase(doc.LossClosed(0)) = "yes" Then Me.loss = "closed" Else Me.loss = "open" End If If Lcase(doc.ExpensesClosed(0)) = "yes" Then Me.expense = "closed" Else Me.expense = "open" End If If Me.expense = "closed" Then If Me.loss = "closed" Then Me.claimant = "closed" Else Me.claimant = "open" End If Else Me.claimant = "open" End If End Sub End Class
 
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.

Nothing very complicated, but a big help later on.
 
The final class I will show today is the actual ClaimantData class. As you can see, I am using the classed I described earlier here. I have removed some code in order to make it easier to follow. Just one more note, I use a field/value called ParentUNID to keep track of all documents that belong to a claim. The claim number is not associated with the claim at first, so I needed some other unique identifier. I choose to use the UniversalID of the main document ("Loss Notice") at the time it is received into the database. Even if the actual UniversalID would change, e.g. through a replication conflict, that field will never change again.
 
 
The class is farly simple. The ClaimantData object will load amount and claimant status when initialized. They are then available, together with the methods of the class, to the calling code.
Class ClaimantData Public claimantdoc As NotesDocument Public unid As String ' Store UniversalID of claimant document Public parentunid As String Public amounts As AmountData Public claimcare As ClaimCareData Public status As ClaimantStatusData Public Parallel As Integer Public Sub New(doc As NotesDocument) Dim claimnumber As String Dim claimant As Integer Set claimantdoc = doc unid = doc.UniversalID parentunid = doc.GetItemValue("ParentUNID")(0) claimnumber = doc.GetItemValue("ClaimNumber")(0) claimant = Cint(doc.GetItemValue("Claimant_Number")(0)) If Lcase(doc.GetItemValue("TransferredToParallel")(0)) = "yes" Then Parallel = True Else Parallel = False End If Set amounts = New Amounts(claimnumber, claimant) Set status = New ClaimantStatusData(doc) End Sub Public Function GetValue(fieldname) As Variant GetValue = claimantdoc.GetItemValue(fieldname)(0) End Function Public Function SetValue(fieldname, Byval value As Variant) As Variant Call claimantdoc.ReplaceItemValue(fieldname, value) End Function Public Function GetVariant(fieldname) As Variant GetVariant = claimantdoc.GetItemValue(fieldname) End Function Public Sub Save() Call claimantdoc.Save(True,True) End Sub Public Function DisplayName() As String If Fulltrim(GetValue("Claimant_Name")) = "" Then DisplayName = GetValue("Claimant_Company") Else DisplayName = GetValue("Claimant_Name") End If End Function Public Function GetXML() Dim tempxml As String If claimantdoc Is Nothing Then Msgbox "Claimant document is not loaded, no data returned.",,"ClaimantData.GetXML()" GetXML = "" Exit Function End If tempxml = "<claimntno>" & claimantdoc.GetValue("Claimant_Number") & "</claimntno>" & CRLF tempxml = tempxml + "<extclmntno>" & claimantdoc.getValue("ClaimantNumberExternal") & "</extclmntno>" & CRLF tempxml = tempxml + "<classcode>" & claimantdoc.pClassCode(0) & "</classcode>" & CRLF tempxml = tempxml + "<cvgcode>" & claimantdoc.Claimant_LossType(0) & "</cvgcode>" & CRLF tempxml = tempxml + "<table>" & claimantdoc.pTable(0) & "</table>" & CRLF If claimantdoc.Unknown(0)="Yes" Then tempxml = tempxml + "<claimntnam>* unknown *</claimntnam>" & CRLF Elseif claimantdoc.Claimant_Name(0)="" Then tempxml = tempxml + "<claimntnam>" & dsClaimLink.EncodeXML(claimantdoc.Claimant_Company(0)) & "</claimntnam>" & CRLF Else tempxml = tempxml + "<claimntnam>" & dsClaimLink.EncodeXML(claimantdoc.Claimant_Name(0)) & "</claimntnam>" & CRLF End If ' Check if we have amounts loaded If Not amounts Is Nothing Then tempxml = tempxml + "<lossamt>" & Format$(amounts.lp,"###0.00") & "</lossamt>" & CRLF tempxml = tempxml + "<expamt>" & Format$(amounts.ep,"###0.00") & "</expamt>" & CRLF End If GetXML = tempxml End Function End Class
 
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
There is a function to get an XML representation of the claimant. This one is used when data is sent to the dsClaimLink COM object. I also have a function to return the name to display, either the peron name or the company name of the former is blank. I could have implemented this using the Get/Set statements, but they have to be defined as a pair and this is a read-only property of the object.
 
In teh next part I will describe the ClaimData class, which is the main class in this script library. 
No RatingsRatings 0

Object Oriented Lotusscript for beginners - Part 1

Karl-Henry Martinsson |   | Tags:  programming lotusscript | Comments (1)  |  Visits (544)
I have been writing object oriented Lotusscript for a little over a year now. When I started, I probably did a lot of mistakes, and I did not fully understand everything about object oriented development. I can't say I am an expert yet, but I wanted to share some information that hopefully will help anyone else looking into switching to object oriented Lotusscript (OOLS).
 
Why OOLS?
I see several benefits, at least to me. The code is usually shorter and I get a better overview. It is modular and can easily be moved to other applications. It is easy to maintain and add functionality. And the calling code can be very compact and easy to understand as well.
 
Is OOLS hard?
Not really. You have to grok it, but as soon as you do that, it all falls into place. My background was in pure procedural programming, and it did not take me very long to get the concept.
 
How do I write OOLS? 
You write class definitions and code in the Declarations section of your code. I usually put the code in script libraries, usually several related classes in one script library. I name the script library after the main class, so in my claim system I have script library called Class.ClaimData, Class.FinancialTransactions and Class.ClaimLink. 
The code is just regular Lotusscript. You define a class, with one or more functions/subs. You can also define variables in the class to store data. Functions, subs and variables can be private (only accessable inside the class) or public (accessable from the calling code). You should always have a Public Sub New() defined in the class.
 
Can I see some example of a class? 
Sure. I have posted a couple of classes in the past, both here on my blog and on OpenNTF.org.
 
In part 2 I will explain a simple class and how it can be used. 
 
No RatingsRatings 0

Import CSV from Excel into Notes documents

Karl-Henry Martinsson |   | Tags:  import lotusscript csv | Comments (1)  |  Visits (816)
The other day there was a post on LinkedIn regarding importing Excel data into Notes documents.
Someone suggested to save into Access format, and then export from there into some 1-2-3 format that Notes can read.
I suggested to save the Excel spreadsheet as a CSV file, and then import it. So I decided to write a small generic importer.
I built a class called "csvFile", which I put in a script library called "Class.ImportCSV"
Below is the code for the actual import agent. It creates a new csvFile object, which load all the CSV data into an array in memory. Each array element is in turn a class, containing a list of entries. This is because you can not create arrays of arrays or lists, they have to be in another object/class.
If you know the row number and column label (the first row in the CSV file will be considered the column labels), you can address the value like this: csvfile.row(r).entry("ColumnLabel").
 
Option Public Option Declare Use "Class.ImportCSV" Sub Initialize ' *** Import CSV file and create matching documents in Notes ' *** By Karl-Henry Martinsson, April 8, 2010 Dim session As New NotesSession Dim db As NotesDatabase Dim doc As NotesDocument Dim csvfile As csvFile Dim rowcnt As Long Dim r As Long Set db = session.CurrentDatabase Set csvfile = New csvFile("c:\Book1.csv") rowcnt = Ubound(csvfile.row) + 1 ' *** Loop through the rows and create a new document for each For r = Lbound(csvfile.row) To Ubound(csvfile.row) If (r+1 Mod 10) = 0 Then ' Update status bar every 10 documents Print "Importing " & r+1 & " of " & rowcnt End If Set doc = New NotesDocument(db) Call doc.ReplaceItemValue("Form", "MyFormName") ' *** Loop though entries for the row and populate corresponding fields in doc Forall e In csvfile.row(r).entry Call doc.ReplaceItemValue(Listtag(e), e) End Forall Call doc.Save(True,False) Next Print "" ' Clear status bar End Sub
 
Here is the script library. Simply create a new script library, call it "Class.ImportCSV" and paste the code into it's Declaration section.
' *** Created by Karl-Henry Martinsson on 2010-04-08 ' *** Email: TexasSwede@gmail.com ' *** Blog: http://www.bleedyellow.com/blogs/texasswede ' *** ---------------------------------------------------------- ' *** You are free to modify and edit this code, but please keep ' *** all comments intact, and publish any changes you make so ' *** the Lotus community can benefit. You are allowed to use ' *** this code in commercial/closed source products, but are ' *** encouraged to share your modifications. ' *** Disclaimer: Use this code at your own risk. No warranties ' *** what so ever. Don't run code you don't know what it does. ' *** ---------------------------------------------------------- Class RowData Public entry List As String End Class Class csvFile Public row() As RowData ' Storing the rows in the imported CSV file Public column List As String ' List containing column labels Private fileno As Integer ' File number Public Sub new(filename As String) Dim temprow As String Dim temparr As Variant Dim fixedarr() As String Dim i As Integer Dim flagQuoted As Integer fileno = Freefile ' Return an unused file number Open filename For Input As fileno Redim row(0) As rowdata ' *** Get column header Do While Not Eof(fileno) ' *** Read row and split into cells. Line Input #fileno, temprow temparr = Split(temprow, ",") ' *** Commas within quoted values will cause the value ' *** to be split across array items, so we have to fix this. flagQuoted = False Redim fixedarr(0) As String ' Size array to just one element, has to be done For i = Lbound(temparr) To Ubound(temparr) ' *** Check if value start with quote If Left$(temparr(i),1) = |"| Then flagQuoted = True End If If flagQuoted = True Then If Left$(temparr(i),1) = |"| Then ' *** For first item, just set array item to value, remove leading quote fixedarr(Ubound(fixedarr)) = Right$(temparr(i),Len(temparr(i))-1) Else ' *** Append value to previous array item with a comma to replace the lost one fixedarr(Ubound(fixedarr)) = fixedarr(Ubound(fixedarr)) & "," & temparr(i) End If ' *** If it end with a quote, reset flag, rmove trailing quote and increase size of array If Right$(temparr(i),1) = |"| Then flagQuoted = False fixedarr(Ubound(fixedarr)) = Left$(fixedarr(Ubound(fixedarr)), Len(fixedarr(Ubound(fixedarr)))-1) Redim Preserve fixedarr(Ubound(fixedarr)+1) As String End If Else ' *** Set array item to value and increase array size by one fixedarr(Ubound(fixedarr)) = temparr(i) Redim Preserve fixedarr(Ubound(fixedarr)+1) As String End If Next temparr = Fulltrim(fixedarr) ' Remove empty items in array ' *** Check if this is the first row (index 0), i.e. the column header and no object exists If Ubound(row) = 0 And (row(Ubound(row)) Is Nothing) Then ' *** Loop through temparr and build list from labels For i = Lbound(temparr) To Ubound(temparr) column(Cstr(i)) = temparr(i) Next ' *** Create an object so the code above will not be true again Set row(Ubound(row)) = New RowData Else ' *** Create new row data object, populate with data and increase size of row array Set row(Ubound(row)) = New RowData For i = Lbound(temparr) To Ubound(temparr) row(Ubound(row)).entry(column(Cstr(i))) = temparr(i) Next Redim Preserve row(Ubound(row)+1) As RowData End If Loop ' *** Remove the last row, as it is always empty Redim Preserve row(Ubound(row)-1) As RowData End Sub End Class
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
RatingsRatings 1

Ubuntu 10.04

Karl-Henry Martinsson |   | Tags:  linux ubuntu | Comments (0)  |  Visits (886)
image 
As you may know, I have been using Ubuntu as my primary operating system at home for almost 6 months now. I am very happy with it, despite some small glitches and shortcomings. For example, the other week Gimp started to refuse to load. I had added GimpShop just before that happened, perhaps that is related. I am also having issues connection to work using Citrix, and of course my network administartor says that he does not support anything but Windows.
In the end of this month (on April 29), Canonical is releasing the next version of the operating system, version 10.04 (Lucid Lynx). This is a so called LTS (Long Term Support) release, meaning it will be supported for three years on the desktop and five years on the server.
I am currently running 9.10 (Karmic Koala) at home, and i have also installed that on several other systems, both my son's desktop and a friends laptop. She is however complaining that she need/want iTunes so she can manage her iPhone... So I guess i will see how good iTunes work in Wine.
Among the new features in Ubuntu 10.04 are built-in support for social networks like twitter and Facebook, a new faster boot process, new themes, a music store, better file syncronisation with the cloud storage service Ubuntu One, and a manual. Yes, a PDF manual, so you don't have to search the net for information.
Some changes have been made when it comes to the bundled programs. The video editing program PiTiVi is included, and Gimp have been removed. The focus on this version is to make the operating system as easy to use as possible, especially for first time Ubuntu users. Of course, it is easy to add any programs you want back, Ubuntu Software Center have been improved and it should be easier than ever to get programs for the operating system.
Personally I am very impressed by the number and quality of programs for Linux. For the few programs where I have not found a replacement of the Windows version, I simply use VMware. I also have the system set up for dual boot, if I want to I can boot straight into Windows, which is needed on occasion. VMware does not support IEEE1394 (Firewire), for example.
I will look for a program to download DV through FireWire in Ubuntu and start playing with video editing using PiViTi. I am currently using Sony Vegas in Windows for this. Slowly I am migrating off Windows more and more, a platform I have been using daily since Windows 2.03 back in 1988.
I intend to write about my favourite and recommended programs in Ubuntu within the next few days.
No RatingsRatings 0

Project Vulcan - my thoughts

Karl-Henry Martinsson |   | Tags:  vulcan | Comments (3)  |  Visits (496)
As everybody else that attended Lotusphere back in January, I heard about Project Vulcan. Ever since, I have been trying to get my head around it. So many others have beebn writing about it, that it almost does not seem like another post would make a big difference. But here are my thoughts. Perhaps I am stating the obvious, if so forgive me.
Last year, I believe duing IamLUG, I heard someone (I forgot who) saying that the reason the Workspace in the Notes client was not developed any further was because Lotus was working on "a totally new, HTML5 based Workspace". Obviously this was a reference to Project Vulcan. based on this, and the information released at Lotusphere, I do not think Vulkan is a totally new interface, but (at least initially) a replacement for the Workspace. Instead of the database icons (Chiclets, sometimes written "Chicklets"), a Facebook-like feed seems to be planned. I think that makes sense in some companies, but I believe it is important that users have quick access to the applications from a desktop-like location. At my company, at least 90 percent of the users use the Workspace exclusively.
Personally, I think a new interface need to contain some familiar elements. It is great to get a built-in feed, but there must be an easy way to get to the applications. I am sure Mary Beth Raven and the rest of the design team will do a great job, though. I am looking forward to see some more design ideas for Project Vulcan.
No RatingsRatings 0

Jump to page of 9
Skip to main content link. Accesskey S
IBM Lotus Connections Help Tools About