TexasSwede
texasswede@gmail.com
  • About this blog
  • My Website
  • My Resume
  • XML Export Tool
  • Photos

Category Archives: IBM/Lotus

I am now an IBM Champion!

Posted on December 5, 2013 by Karl-Henry Martinsson Posted in IBM/Lotus, Lotusphere, Personal 2 Comments

IBM Champion

This morning I received an email that I have been selected as one of 87 IBM Champions from 18 countries around the world. This is the first time I am awarded this honor, and I am humbled to be listed together with some of the greatest names in the ICS/Lotus community (a.k.a. the Yellowsphere).

So what is an IBM Champion? This is how Oliver Heinz (who takes over after Joy Davis as Community Manager) describes it:

These individuals are non-IBMers who evangelize IBM solutions, share their knowledge and help grow the community of professionals who are focused on social business and IBM Collaboration Solutions. IBM Champions spend a considerable amount of their own time, energy and resources on community efforts — organizing and leading user group events, answering questions in forums, contributing wiki articles and applications, publishing podcasts, sharing instructional videos and more!

Thank you everyone who nominated me! I am looking forward to see everyone, fellow Champions as well as all my other friends in the community, at Connect 2014 in January!

Code – Mask text to remove PII

Posted on December 2, 2013 by Karl-Henry Martinsson Posted in Lotusscript, Notes/Domino 4 Comments

Sometimes you need to remove personal identifiable information (PII) from the data you present in an application or on a web page. In the last couple of weeks this issue popped up twice, including one application which needs to be be HIPAA compliant. One solution is to mask any personal identifiable data so that the recipient can still verify the information, without sending it all in clear. I am sure you all seen this on for example credit card statements, with only the last 4 digits of your credit card number displayed.

I wrote a simple  Lotusscript function to do this, and I thought I would share it so others can use it as well. You pass a string to mask, the number of characters to leave un-masked and where the unmasked characters should be displayed (“B” for beginning or “E” for end).

MsgBox masktext("TexasSwede",3,"B")

This line would display Tex*******

MsgBox maskText("1234567890",4,"E")

This line would display ******7890

Enjoy!

 

%REM
    Function maskText
    Description: Masks a text with asterisks, leaving the num first or
    last characters visible. Direction is "B" (beginning) or "E" (end).
    Created by Karl-Henry Martinsson - texasswede@gmail.com 
%END REM
Function maskText(value As String, num As Integer, direction As string) As String
    Dim tmp As String
    Dim i As Integer
    If Len(value)>num Then
        If Left$(UCase(direction),1)="B" Then    ' Start at the beginning
            tmp = Left$(value,num)
            For i = num+1 To Len(value)
                tmp = tmp + "*"
            Next
        Else                                     ' Start at the end
            tmp = Right$(value,num)
            For i = Len(value) To num+1 Step -1
                tmp = "*" + tmp
            Next
        End If
    Else
        tmp = value
    End If
    maskText = tmp
End Function

Half an operating system: The triumph and tragedy of OS/2

Posted on November 26, 2013 by Karl-Henry Martinsson Posted in IBM/Lotus, Software, Technology 1 Comment

The other day I found an interesting article at arstechnica about the history of OS/2, the IBM operating system that was supposed to replace MS-DOS. “Half an operating system: The triumph and tragedy of OS/2” brings back a lot of memories for me.

OS/2 Extended Edition

I worked at Microsoft in 1988/89, when the first couple of versions of OS/2 had just arrived on the market. IBM was just down the road, and one day my boss gave me a stack of floppy disks containing the Microsoft-developed OS/2 version 1.1 and told me to drive over to IBM and install it on a computer in their training room. If I remember it correctly, it was supposed to be used for a demo or conference.

I also remember the “RAM crisis” in 1988-90, when memory prices suddenly increased dramatically. I bought my first computer right after the prices dropped to a more manageable level. The high memory requirements for OS/2 was one of the reasons the new operating system did not take off. Microsoft had just released Windows 2.0 in 1987, and in 1990 the much more polished Windows 3.0 was released. Both versions had much lower memory requirements than OS/2.

OS/2 2.0 Desktop

OS/2 2.0 Desktop

I was never a fan of Workplace Shell, the object oriented desktop in later versions OS/2. It always felt clunky and sluggish, compared with the much slicker Windows 3.0/3.1 look. Starting in OS/2 version 2.0, a DOS virtual machine let you run any DOS program (including games) and even Windows programs in OS/2. I once attended a press meeting with Jim Allchin, I think it was when NT 3.51 was released. I asked him about the NT command line interface, and asked if there were any plans to add some true emulation or virtual operating system functionality, like in OS/2. He dismissed it as “circus acts by a dying operating system”. Of course he was partially right, as OS/2 was dying at that time, but anyone in the IT business today know about the benefits of virtualization…

So go and read the article, especially if you were around in the late 80’s and early to mid 90’s. I will leave you with a couple of interesting quotes from the article.

 

The PS/2 launch, for example, was accompanied by an advertising push that featured the aging and somewhat befuddled cast of the 1970s TV series M*A*S*H. This tone-deaf approach to marketing continued with OS/2. Exactly what was it, and how did it make your computer better? Was it enough to justify the extra cost of the OS and the RAM to run it well? Superior multitasking was one answer, but it was hard to understand the benefits by watching a long and boring shot of a man playing snooker.

 

OS/2 version 3.0 would also come with a new name, and unlike codenames in the past, IBM decided to put it right on the box. It was to be called OS/2 Warp. Warp stood for “warp speed,” and this was meant to evoke power and velocity. Unfortunately, IBM’s famous lawyers were asleep on the job and forgot to run this by Paramount, owners of the Star Trek license. It turns out that IBM would need permission to simulate even a generic “jump to warp speed” on advertising for a consumer product, and Paramount wouldn’t give it. IBM was in a quandary. The name was already public, and the company couldn’t use Warp in any sense related to spaceships. IBM had to settle for the more classic meaning of Warp—something bent or twisted. This, needless to say, isn’t exactly the impression you want to give for a new product.

 

Unfortunately, IBM was being pulled in two directions. The company’s legacy mainframe division didn’t want any PCs that were too powerful, lest they take away the market for big iron. The PC division just wanted to sell lots of personal computers and didn’t care what it had to do in order to meet that goal. This fighting went back and forth, resulting in agonizing situations such as IBM’s own low-end Aptivas being unable to run OS/2 properly and the PC division promoting Windows instead.

 

 

 

 

Time to nominate IBM Champions

Posted on October 8, 2013 by Karl-Henry Martinsson Posted in IBM/Lotus Leave a comment

Kathy Brown recently posted about the nomination of IBM Champions for 2014, and I wanted to spread the word as well.

Anyone can nominate non-IBMers who “are sharing their knowledge, evangelize and advocate for IBM Collaboration Solutions (ICS), help grow and nurture the community and provide feedback to IBM (both negative and positive) in a professional manner”.

You can learn more at the IBM Champion website, and (more important) you can also nominate someone you feel should be an IBM Champion.

So what are you waiting for? :-)

Late realization…

Posted on October 3, 2013 by Karl-Henry Martinsson Posted in IBM/Lotus, Notes/Domino Leave a comment

Today I logged in to IdeaJam (#thanksbruce) and for some reason I decided to look at my own old ideas, something I haven’t done in a while. I noticed this post, from december 2010, almost a year before IBM launced the XWork server in October 2011…

Perhaps IBM listens sometimes, even if they did not make it free, $1000/year is not a bad price for a powerful server like Domino/XWorks.

IdeaJam

sometimes I am slow...

Class for Domino Directory lookups

Posted on September 4, 2013 by Karl-Henry Martinsson Posted in Lotusscript, Notes/Domino 1 Comment

In many of my Notes programs, I need to perform lookups into the Domino Directory (the database formerly known as Name and Address Book or NAB). So my solution was to create a class that handle those lookups for me, and exposes the most common lookups as separate methods.
We have a slightly modified version of names.nsf, with a few added fields. One of them is what we call ParallelID, which is the user’s ID in a system called (surprise!) Parallel. Since I perform that lookup all the time, I created a separate method for that one called GetParallelID(). Same with manager lookup for a user, I created GetManagerName() for that.
The methods you probably will use the most are GetText() and GetValue().

Since I think this class could come in handy for others, here it is. Enjoy!

Option Public
Option Declare

Class NotesAddressBook
  Private NABdb As NotesDatabase
  Private server As String
  Private nabname As String
  Public silent As Boolean

  Public Sub New(servername As String)
    me.silent = false
    Call LoadNABdb(servername)    
  End Sub

  Public Function GetNABdoc(personname As String) As NotesDocument
    Dim NABview As NotesView
    If NABdb Is Nothing Then
      Call LoadNABdb("")        
    End If
    If Not NABdb Is Nothing Then
      Set NABview = NABdb.GetView("PeopleByFirstname")
      Set GetNABdoc = NABview.GetDocumentByKey(ShortUserName(personname))
    Else
      Set GetNABdoc = Nothing
    End If
  End Function

  Public Function database() As NotesDatabase
    If NABdb Is Nothing Then
      Call LoadNABdb("")        
    End If
    If Not NABdb Is Nothing Then
      Set database = NABdb
    End If
  End Function

  Public Function GetValue(personname As String, fieldname As String) As Variant
    Dim NABdoc As NotesDocument
    Set NABdoc = GetNABdoc(personname)
    If NABdoc Is Nothing Then
      If me.silent = False then
        Msgbox "No document found for '" & personname & "' in " & nabname & " on " & server & ".",,"NotesAddressBook::GetNABdoc()"
      End If
      GetValue = ""
    Else
      GetValue = NABdoc.GetItemValue(fieldname)
    End If
  End Function

  Public Function GetText(personname As String, fieldname As String) As String
    Dim tmp As Variant
    tmp = GetValue(personname, fieldname)
    If IsArray(tmp) Then
      GetText = CStr(tmp(0))
    Else
      GetText = CStr(tmp)
    End If  
  End Function

  Public Function GetName(personname As String, fieldname As String) As NotesName
    Dim tmpValue As String
    tmpValue = GetText(personname, fieldname)
    If tmpValue <> "" Then
      Set GetName = New NotesName(tmpValue)
    End If
  End Function

  Public Function GetNameByParallelID(parallelid As String) As String
    Dim view As NotesView
    Dim doc As NotesDocument 
    Dim tmpValue As String
    Set view = NABdb.GetView("(LookupUserID)")
    Set doc = view.GetDocumentByKey(parallelid)
    If doc Is Nothing Then
      Exit Function
    End If
    tmpValue = doc.GetItemValue("FirstName")(0) & " " 
    If doc.GetItemValue("MiddleInitial")(0)<>"" Then
      tmpValue = tmpValue & doc.GetItemValue("MiddleInitial")(0) & " "
    End If
    tmpValue = tmpValue & doc.GetItemValue("LastName")(0)
    If tmpValue <> "" Then
      GetNameByParallelID = tmpValue
    End If
  End Function  

  Public Function GetCommonName(personname As String, fieldname As String) As String
    Dim tmpName As NotesName
    Set tmpName = GetName(personname, fieldname)
    If Not tmpName Is Nothing Then
      GetCommonName = tmpName.Common
    End If
  End Function

  Public Function GetManagerName(personname As String) As String
    GetManagerName = GetCommonName(personname, "Manager")
  End Function

  Public Function GetParallelID(personname As String) As String
    GetParallelID = GetText(personname, "ParallelID")
  End Function

  Public Function GetBranch(personname As String) As String
    GetBranch = GetText(personname, "Location")
  End Function

  Private Sub LoadNABdb(servername As String)
    Dim session As New NotesSession
    '*** Some users have a local replica of Domino Directory
    '*** but it would never be used unless the code is running
    '*** in a local database, otherwise current server is used. 
    If servername = "" Then
      servername = session.CurrentDatabase.Server
      If servername = "" Then  
        '*** Code running in local database/replica
        server = "Local"
        nabname = "dsnames.nsf"  
      Else
        server = servername
        nabname = "names.nsf"        
      End If
    Else
      server = servername
      nabname = "names.nsf"
    End If
    Set NABdb = session.GetDatabase(servername, nabname)
    If NABdb Is Nothing Then
      Msgbox "Failed to open " & nabname & " on " & server & ".",,"GlobalConfig::New()"
    End If
  End Sub

  Private Function ShortUserName(longname As String) As String
    Dim namearray As Variant

    '*** Remove any periods in name, some users have that
    longname = Replace(longname,".","")

    namearray = Split(longname," ")
    '*** Check if there is middle inital or 3 parts to the name 
    If UBound(namearray) >=2 Then
      '*** check if middle name/initial is just one char (initial)
      If Len(namearray(1))=1 Then
        namearray(1) = ""  ' Remove value
      End If     
    End If
    '*** Join name parts together again and return to calling function
    ShortUserName = FullTrim(Join(namearray))
  End Function

End Class

Some personal thoughts and a big Thank You

Posted on September 2, 2013 by Karl-Henry Martinsson Posted in Generic, Lotusphere, Personal, Programming 6 Comments

Last week, Volker wrote this excellent article about Tomas Duff (a.k.a. Duffbert). Then yesterday the news reached me about the sudden death of Rob Wunderlich, a long-time member of the Lotus community. I had already started on a post — in preparation of my upcoming 25 year anniversary of becoming an IT professional — where I was going to acknowledge a number of people who meant much to me and who were important in making me to what I am today. I have decided to post this text a bit earlier than originally planned.

There are so many people who helped me and supported me over the years, and without them I would not be where I am now professionally. Some took a chance on me and gave me jobs where I grew professionally, others were more like mentors or inspirations, and some were teaching me how to do things with computers or in code. I know I am probably forgetting many who deserve to be mentioned. But I want to thank the following:

  • Tonny Olsson – my cousin who worked at Hewlett-Packard and let me see my first computer (complete with a plotter and an acoustic modem he used to connect to HP from our house) in or around 1975. He also introduced me to the world of HP calculators and RPN.
  • Peter Nilsson – my childhood friend and classmate, who introduced me to Basic programming when he got a VIC-20. We spent an evening (right after he got it) entering a program from the handbook, but we did not get it to work that day. Later on we got some programs working.
  • Henry Jacobsson – My teacher in computer science/programming in High School, who allowed me write my code in Turbo Pascal for CP/M-86 instead of the special language COMAL (a mix between BASIC and Pascal). He also taught me the basics of how to plan/design an application. I also want to thank Henry for not kicking me out when I hacked his systems administrator account and assigned myself 1MB of storage on the 30MB hard disk we had on the server. Normally each student got 4kB, but I wanted more. :-)
  • I also want to thank several of the older students in the school’s computer club, who helped us younger students when we had questions. I want to mention Hjalmar Brismar, Petter Aaro and Matthias Bolliger, who were always there with advise and knowledge.
  • Arne Josefsberg – head of tech support at Microsoft, he took a chance and gave me a job without me having touched any Microsoft program previously.
  • Rolf Åberg, Magnus Andersson, Anna Söderblom and Micael Dahlquist – also at Microsoft. They helped me learn all kind of new things, from Windows programming using C and the Windows SDK to regular C programming using QuickC, from Excel to Word for DOS. I also ended up wothing with Micael at another job a few years later.
  • Per Engback and Ingvar Gratte – my two main teachers at the systems programming class. Despite this being just a one-year class, I learned plenty, especially C programming and Unix.
  • Krister Hanson-Renaud and Harald Fragner – two programmers/hackers who inspired me over the years, and who also introduced me to the world of Bulletin Board Systems (BBS). I had been exploring some earlier bulletin board systems back in 1987-88, but it was in 1989-90 I became “social” on these networks. Both Harald and Krister wrote their own BBS systems, and I ended up running one of them myself for a short time, but it was more of a test.
  • All my friends on CT and SKOM, the two BBS:s I frequented the most, between 1990 and some time in 2004. Here I learned about online debates, flame wars and of course plenty about hardware, software and programming techniques.
  • Lars Dahmén – the editor-in-chief at Computer Sweden who hired a 22 year old programmer/hacker in the role of journalist, despite no previous journalistic experience. Obviously he saw some possibilities in me, as I stayed for five years until I moved to IDG in Boston. Lars was a great boss, a very competent manager and is a very nice person. It’s hard to find that combination, and I think I have to say that he is the best manager I ever had. Thank you for not giving me too much grief about my messy desk and my shot-up hard disk on my bookshelf. He also tasked me with developing some of my first actual Notes applications, for internal use at the magazine, and approved of my moonlighting with Notes development (see Enrico Barile below)
  • Eva Sparr – the managing editor at Computer Sweden, and who I reported to directly. She usually gave me very free reign to explore new stories and test software/hardware as I saw fit, something that helped me develop my analytical skills.
  • Erik Geijer, Anders Lotsson, Maria Lindström and Kenneth Bäcklund – four of my colleagues at the magazine, experienced journalists who gave me a crash-course in writing, journalism and penmanship. A big thank you for all the time you spent giving me advise and proof-reading my articles. Erik also introduced me to HTML in 1994.
  • Enrico Barile – he exposed me to Lotus Notes, and started me on the path to where I am now. We spent many evenings at his office, building websites using InterNotes Web Publishing, which eventually merged with the Notes server in version 4.5 and became what we today know as the Domino server. I mainly worked on the HTML part, but I did learn a lot about Notes/Domino.
  • Morris Effron – my boss at IDG in Boston. He hired me from across the Atlantic, to become a full-time Lotus Notes developer. Not only did he trust in my skills and ability to learn new things (I had been writing several Notes applications, but nothing extremely complex), he sent me to several classes to increase my skills both on the technical side and on the social side. When someone from Boston, born in New York, think you are too direct and rude to the users and send you to a class to be nicer to people, that is a sign you are a bit rough around the edges. ;-)
  • And of course all my friends in the Lotus/ICS community. Over the years I have gained enormous amount of knowledge from your sessions at Lotusphere, blog entries and direct discussions (in person at conferences or through Sametime/email), or though services to the community. In addition to Tom Duff, who I already mentioned, I would like to list just a few: Rocky Oliver, Andrew Pollack, Brian Benz, Scott Good, Julian Robichaux, Francie Tanner, Rob Novak, Chris Blatnick, Declan Lynch, Chris Miller (the one-slide-man!), Paul Mooney, Bill Buchan, Mark Myers, Matt White, Bruce Elgort, Yancy Lent (thanks for PlanetLotus!), Jake Howlett (who I never met, but who’s site codestore.net have been a great resource over the years), Joe Litton, Stephan Wissel, Tim Tripcony, Nathan Freeman, and so many more. Not to forget all the Lotus/IBM people I met at Lotusphere, like Maureen Leland, Dan O’Conner, Mary Beth Raven, Susan Bulloch and all the others I been harassing over the years in the Ask the Developers lab at Lotusphere. I also want to thank everyone who presented at Lotusphere and shared their knowledge over the years.
  • Finally I would like to mention my parents, Marie-Luise and Stig Martinsson. Today (September 2) would have been my dad’s 87th birthday. They were great parents, and gave me the freedom I needed to read books all summer long (even if my mom sometimes thought I should go outside for a bit) and to take apart old radios or mechanical calculators, or solder together some electronic contraption in the basement of our house. Later, when I spent all my free time after school in the computer room, they were concerned that I was negligent with my home work, but they never forced me to abandon programming. And when I look back, I realize that all those thousands of hours spent in the computer room is what made me to what I am today.

So again, to everyone who in one way or another had a hand in bringing me to where I am today, a huge thank you. And forgive me if I did not list everyone, or I would be writing this list until Christmas…

Part of the Lotus community/bloggers meeting for BALD at Lotusphere 2011.

Part of the Lotus community/bloggers meeting for BALD at Lotusphere 2011.

 

The traditional end-of-Lotusphere picture, from Lotusphere 2010.

The traditional end-of-Lotusphere picture with part of the community, this one from Lotusphere 2010.

 

Blogger community at Lotusphere/Connect 2013. Photo by John Roling (CC-BY-NC-ND).

Blogger community at Lotusphere/Connect 2013. Photo by John Roling (CC-BY-NC-ND).

My IBM Notes project on GitHub

Posted on August 28, 2013 by Karl-Henry Martinsson Posted in Lotusscript, Notes/Domino, Programming Leave a comment

github_small

I decided to play around a little, and as an experiment put up one of my Notes projects on the open source repository GitHub. You can see the result here: http://github.com/TexasSwede/Class.MailMerge

This is a script library in Lotusscript to create documents based on a source document and a template document. I have blogged about it before, but I added some functionality to it, and thought it would be easier for people to download a complete database.

 

jQuery – An Overview

Posted on July 19, 2013 by Karl-Henry Martinsson Posted in Frameworks, Javascript, jQuery, Notes/Domino, Programming, Web Development 1 Comment

Yesterday my boss asked me about a simple overview/tutorial explaining jQuery, Bootstrap and some other web technologies, and how they work together. I decided to also post the result on my blog, so here is the first part. You may recognize some code from a previous blog entry.

jQuery is a currently very popular Javascript framework/library. There are other ones, like Dojo (used by IBM in XPages) and YUI (originally developed by Yahoo), but jQuery is right now at the top when it comes to usage.
jQuery contains the plumbing behind the scene, it contains functions to let the different elements on the page talk to each other and interact, for example trigger events on click or change. It also have functions to hide and show elements (either directly or fade in or out).

One of the big benefits with jQuery is that many functions are much easier to do than in traditional Javascript. It also addresses browser inconsistency, so you don’t have to write different code for Firefox and Internet Explorer. jQuery is Javascript, just packaged in a nice library and simplified. There are also UI components and mobile components, found in jQuery UI and jQuery Mobile. Here are a couple of examples, comparing plain Javascript with jQuery: http://blog.jbstrickler.com/2010/06/vanilla-javascript-vs-jquery/.

jQuery ties into the DOM (Document Object model) of the browser/webpage in a very easy-to-use way. The way elements are addressed is identical to how you do it in CSS, using . (dot) for classes and # for individual elements.

It is not hard to start with jQuery. You do not even have to host the library on your own server, several companies (including Microsoft and Google) host jQuery (as well as other libraries and frameworks) in what is called a CDN (Content Delivery Network). You simply include a line of code in the head section of your HTML, telling the browser to load jQuery from a specified location, and you are all set:

<head>
    <title>Hello, jQuery</title>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
</head>

Notice that you don’t use http: or https: at the start of the URL. This is a trick that makes it work both on a http or a https site. However, if you have the code locally in the file system on your computer (like many do before uploading the html file to a server), you must add http: at the beginning for it to load.

Let take a look at our first jQuery example. Below we have a very simple piece of HTML code:

<body>
    <button id="btnSave">Save</button>
    <div id="messageBox"></div>
</body>

What we want to do is that when the button is clicked, a message should be displayed in the div with ID messageBox. That is done with the following piece of jQuery:

$("#btnSave").click( function() { 
    $("#messageBox").html("You clicked the Save button."); 
});

What this do is to replace everything inside the div with the text/HTML code we specify. The second line is the code to execute when the event specified triggers/fires. You can put triggers on almost any element, and depending on the element type, you have different triggers.

The code between the first and last curly brackets { } is being executed when the event is triggered. As you can see, I have the code I showed earlier nested inside this code. What all this does is to wait until the page is loaded, then start creating event triggers.

There are two schools when it comes to where you put the jQuery code. Soem developers prefer to put the code inside <script> tags at the end of the page, after all HTML code and right before </body>. That is is so that the code is not executed until the page (and all the elements on it) have been loaded.

There is another way to do it, as well. This one allows you to put the code in the <script> section of the header section, but it us using jQuery to not load any code until the page has finished loading:

$(document).ready(function () {
    // Setup the element with id "btnSave" to react on click
    $("#btnSave").click( function() {
        // When clicked, set the innerHTML of the element with
        // id "messageBox" to the specified html string.
        $("#messageBox").html("You clicked the Save button.");
    });
});

The important thing is that you can not start put events on elements until they have been created on the page, or nothing will work.

One of the really cool features with jQuery is how easy it is to call another page/url and get something back. This is commonly called Ajax (Asynchronous Javascript and XML), even if it these days more often than not involves getting JSON back instead of XML.
JSON stands for Javascript Object Notation and is a way to package data in the same way you would do if you created a Javascript object. A simple example would look like this:

{
    "FirstName":"Karl-Henry",
    "LastName":"Martinsson",
    "Department:"IT"
}

I can now assign the object to a variable (let’s call it employee) and I can then access the values using regular Javascript:

alert(employee.FirstName + " " + employee.LastName + " works in " + employee.Department);

This ease of parsing makes JSON ideal to use to retrieve values from a data source and display them on a webpage, using Javascript.

Let’s look at a more complicated example. I will call a URL on a server, which will trigger an agent to run to retrieve data from a database and return it in HTML format. This particular URL points to a Domino agent written in Lotusscript, but it could be written in any language supported by the server, like php. For a Domino server, you could also use an XPages agent.

Here is the Javascript code to call a URL and put the content returned into a element on the web page:

function loadProgressNotes(clientunid) {
    $.ajax({
        url: "/mydatabase.nsf/GetProgressNotes?OpenAgent",
        data: {"ClientUNID":clientunid,"Start":"1","Count":"10"},
        cache: false
    }).done(function(returndata) {
        $("#progressNotes").html(returndata);
    });
}

I broke this code out as a separate function, as I need/want to call it in several places. The function just contains one single jQuery function call, .ajax(). I pass a Javascript object to the function, containing the data needed by the function. Many jQuery functions works like this, you pass a Javascript object with arguments instead of passing a large number of individual arguments. You can do the same in Lotusscript, by passing an object or a custom data type to a function instead of numerous arguments.

In this particular case, I am calling .ajax() with 3 arguments. The first one is the URL to go to, the second one is the data to send to that URL, and the last one is a flag telling jQuery to add a cache buster to the end of the URL it constructs. If I would not add that, and I had recently made the same call, I would get old data, as web servers and browsers cache data for performance reasons.
The interesting thing in the code above is perhaps that the data I pass to the URL are itself a Javascript object, so we have a Javascript object where one of the elements is another object.

So what happens is that jQuery performs a call to www.domain.com/mydatabase.nsf/GetProgressNotes?OpenAgent&ClientUNID=something&Start=1&Count=10&_15614312653

The last number is the cache buster, simply a timestamp (milliseconds since midnight, Jan 1, 1970).
The program/agent on the server reads the arguments, performs whatever database lookup it needs, and generates HTML based on that. This HTML is returned by the .ajax() call in data above. The jQuery call is sitting in the background and waiting for the agent to return the data. When this is done, the .done() event is triggered.
In that event, I have written some jQuery code to update the contents of the element called “progressNotes” with whatever the AJAX call returns, in this case some HTML.

It may be more common to have the agent return JSON and parse it, putting different values into different elements on the page. Here is an example, where I go through all the input fields and text area fields on a HTML form and collect the field values/contents for any of the fields having the custom attribute called notesfield. The value of the attribute is the field name in the Domino database, making it very easy to send the data to the correct place on the server.  A typical input field could look like this:

<input notesfield="FirstName" type="text" value="" placeholder="First Name">

Below is the Javascript code, using jQuery to update the record in the Domino database and return JSON that will indicate success or failure, as well as a custom message that will either explain the reason for failure or a message that the document was updated.

var json = new Object();

myjson["ClientUNID"] = "E7A2D820EE10123C86257BAD0056A5F4";

$('input[notesfield]').each(function() {
    fieldname = $(this).attr("notesfield");
    fieldvalue = $(this).val();
    myjson[fieldname] = fieldvalue;
});

$('textarea[notesfield]').each(function() {
    fieldname = $(this).attr("notesfield");
    fieldvalue = $(this).val();
    myjson[fieldname] = fieldvalue;
});

$.ajax({
    url: "/mydatabase.nsf/UpdateClient?OpenAgent", 
    data: myjson,
    cache: false
}).done(function(returndata) {
    if (returndata.status=="Error") {
        $(".errorMessageClient").html("Error! " + returndata.msg).show();
    } else if (returndata.status=="Success") {
        $(".successMessageClient").html("Success! " + returndata.msg).show();
    });
});

As you can see, it is easy to retrieve values from the JSON you get back.

That’s all for now. Next time I will talk about Bootstrap.

IBM Notes/Domino growing in Asia?

Posted on May 24, 2013 by Karl-Henry Martinsson Posted in IBM/Lotus, Notes/Domino 3 Comments

Judging from an unscientific survey of postings in the IBM developerWorks forums, and also in the Lotus/Domino related forums on LinkedIn, the adoption of IBM Notes and Domino seems to have increased dramatically in Asia during the last few years. The growth seems to be mainly in India, with China coming in at number two, while Notes jobs in the US seems to be dropping or being stagnant.

The indications that they are new or recent adopters are very strong. Many of the questions are very basic in their scope and it is obvious (and sometimes directly admitted) that a number of the posters are new to the Notes/Domino platform.

However, as many of the questions relates to older version of Notes/Domino (mostly 6.x and 7.x ), IBM should have a huge opportunity to Notes/Domino 9.0 on that market. It is slightly confusing why all these new adopters are on such old platform, but there might be some logic reason for that…

Also, there is a big interest on LinkedIn for certification, there are frequent requests for the answers to the certifications tests, mostly from people located in Asia. It also seems like IBM is pushing Notes harder in the Asian markets, as I even seen IBM employees in that region asking for the test answers.

A developer who does not know what replication conflicts are.

A developer who does not know what replication conflicts are.

 

Note: I am sure this has absolutely nothing to do with US/European companies outsourcing development to those countries…

Wonka

Stack Exchange

profile for Karl-Henry Martinsson on Stack Exchange, a network of free, community-driven Q&A sites

Recent Posts

  • Domino 14 is now available
  • Domino 14 Early Access Program
  • Announced: Engage 2024
  • Integrate Node-RED with Notes and Domino
  • Notes and Domino v12 is here!

Recent Comments

  • Theo Heselmans on Announced: Engage 2024
  • Lotus Script Multi-thread Message Box [SOLVED] – Wanted Solution on ProgressBar class for Lotusscript
  • Viet Nguyen on Keep up with COVID-19 though Domino!
  • Viet Nguyen on Keep up with COVID-19 though Domino!
  • Mark Sullivan on Looking for a HP calculator? Look no further!

My Pages

  • How to write better code in Notes

Archives

  • December 2023 (1)
  • October 2023 (2)
  • September 2023 (1)
  • June 2021 (1)
  • April 2021 (2)
  • March 2021 (1)
  • August 2020 (3)
  • July 2020 (2)
  • April 2020 (2)
  • March 2020 (1)
  • December 2019 (2)
  • September 2019 (1)
  • August 2019 (2)
  • July 2019 (2)
  • June 2019 (3)
  • April 2019 (2)
  • December 2018 (1)
  • November 2018 (1)
  • October 2018 (5)
  • August 2018 (2)
  • July 2018 (3)
  • June 2018 (2)
  • May 2018 (1)
  • April 2018 (2)
  • March 2018 (1)
  • February 2018 (2)
  • January 2018 (4)
  • December 2017 (3)
  • November 2017 (2)
  • October 2017 (2)
  • September 2017 (1)
  • August 2017 (2)
  • July 2017 (6)
  • May 2017 (4)
  • February 2017 (1)
  • January 2017 (2)
  • December 2016 (2)
  • October 2016 (3)
  • September 2016 (4)
  • August 2016 (1)
  • July 2016 (2)
  • June 2016 (2)
  • May 2016 (3)
  • April 2016 (1)
  • March 2016 (4)
  • February 2016 (2)
  • January 2016 (4)
  • December 2015 (3)
  • November 2015 (2)
  • October 2015 (1)
  • September 2015 (2)
  • August 2015 (1)
  • July 2015 (5)
  • June 2015 (2)
  • April 2015 (2)
  • March 2015 (3)
  • February 2015 (2)
  • January 2015 (10)
  • December 2014 (1)
  • November 2014 (3)
  • October 2014 (3)
  • September 2014 (13)
  • August 2014 (6)
  • July 2014 (5)
  • May 2014 (3)
  • March 2014 (2)
  • January 2014 (10)
  • December 2013 (5)
  • November 2013 (2)
  • October 2013 (5)
  • September 2013 (4)
  • August 2013 (7)
  • July 2013 (3)
  • June 2013 (1)
  • May 2013 (4)
  • April 2013 (7)
  • March 2013 (8)
  • February 2013 (9)
  • January 2013 (5)
  • December 2012 (7)
  • November 2012 (13)
  • October 2012 (10)
  • September 2012 (2)
  • August 2012 (1)
  • July 2012 (1)
  • June 2012 (3)
  • May 2012 (11)
  • April 2012 (3)
  • March 2012 (2)
  • February 2012 (5)
  • January 2012 (14)
  • December 2011 (4)
  • November 2011 (7)
  • October 2011 (8)
  • August 2011 (4)
  • July 2011 (1)
  • June 2011 (2)
  • May 2011 (4)
  • April 2011 (4)
  • March 2011 (7)
  • February 2011 (5)
  • January 2011 (17)
  • December 2010 (9)
  • November 2010 (21)
  • October 2010 (4)
  • September 2010 (2)
  • July 2010 (3)
  • June 2010 (2)
  • May 2010 (3)
  • April 2010 (8)
  • March 2010 (3)
  • January 2010 (5)
  • November 2009 (4)
  • October 2009 (7)
  • September 2009 (1)
  • August 2009 (7)
  • July 2009 (1)
  • June 2009 (4)
  • May 2009 (1)
  • April 2009 (1)
  • February 2009 (1)
  • January 2009 (3)
  • December 2008 (1)
  • November 2008 (1)
  • October 2008 (7)
  • September 2008 (7)
  • August 2008 (6)
  • July 2008 (5)
  • June 2008 (2)
  • May 2008 (5)
  • April 2008 (4)
  • March 2008 (11)
  • February 2008 (10)
  • January 2008 (8)

Categories

  • AppDev (10)
  • Blogging (11)
    • WordPress (5)
  • Design (5)
    • Graphics (1)
    • UI/UX (2)
  • Featured (5)
  • Financial (2)
  • Food (5)
    • Baking (3)
    • Cooking (3)
  • Generic (11)
  • History (5)
  • Hobbies (10)
    • LEGO (4)
    • Photography (4)
  • Humor (1)
  • IBM/Lotus (178)
    • #Domino2025 (14)
    • #DominoForever (8)
    • #IBMChampion (46)
    • Administration (7)
    • Cloud (7)
    • CollabSphere (9)
    • Community (49)
    • Connect (33)
    • ConnectED (12)
    • Connections (3)
    • HCL (15)
    • HCL Master (1)
    • IBM Think (1)
    • Lotusphere (46)
    • MWLUG (25)
    • Notes/Domino (99)
      • Domino 11 (7)
    • Sametime (8)
    • Verse (14)
    • Volt (3)
    • Watson (6)
  • Life (8)
  • Microsoft (7)
    • .NET (2)
    • C# (1)
    • Visual Studio (1)
  • Movies (3)
  • Old Blog Post (259)
  • Personal (23)
  • Programming (84)
    • App Modernization (11)
    • Formula (4)
    • Lotusscript (47)
    • NetSuite (4)
      • SuiteScript (3)
    • node.js (4)
    • XPages (4)
  • Reviews (9)
  • Sci-Fi (4)
  • Software (24)
    • Flight Simulator (2)
    • Games (4)
    • Open Source (2)
    • Utilities (6)
  • Technology (37)
    • Aviation (3)
    • Calculators (2)
    • Computers (6)
    • Gadgets (7)
    • Mobile Phones (7)
    • Science (3)
    • Tablets (2)
  • Travel (7)
    • Europe (1)
    • Texas (2)
    • United States (1)
  • Uncategorized (16)
  • Web Development (50)
    • Frameworks (23)
      • Bootstrap (14)
    • HTML/CSS (12)
    • Javascript (32)
      • jQuery (23)
  • Prev
  • 1
  • …
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • Next

Administration

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tracking

Creeper
MediaCreeper
  • Family Pictures
© TexasSwede 2008-2014