POP3Collect – New release available

Andy Brunner has released a new version of his fantastic Pop3Collect. It fixes a few issues. Here is a list of fixes in release. 1.0.

  • New: Write a message to the log during initialization if the Domino notes.ini parameter JavaMaxHeapSize is not specified.
  • New: Call the Java garbage collector before message retrieval cycle to avoid OutOfMemory errors in JVM.
  • Update: Removed the Quickstart page in POP3Collect.ntf. The information has been moved to this page.
  • Update: Hardened the code if the POP3 message does not include valid sent and/or received date and time. Added “sent” timestamp to the created SMTP message. Thanks to Ivan Zhang for analyzing this problem.

You can download Pop3Collect from here.


Switching between tabs does not keep position of elements

I’m using the dojo.Layout TabContainer and TabPane controls from the extension Library. Inside of the tabs I have floating panes. When I move the pane I would like to keep the current position of the pane when I switch from tab1 to tab2. This does not work. The element is always moved to the original position.

I also tested with dijit.layout.TabContainer and dijit.layout.ContentPane and this works as expected. The video demonstrates the behaviour.

Is there any parameter to set for the controls to work like the dijit.layout.TabContainer and dijit.layout.ContentPane do?

 


XPages: Issue with Tabs and multiple datasources

In my current project I try to open documents from a view in a tab. Each document should open in a new tab. I’m using the extensionLib from OpenNTF ( 2011-04-10 ). This is working so far and I can access data from the underlying document and display in the tab.

But I want to display also data from at least 2 different documents that are related to the main document. This also works on a XPage, but not in the tab container.

I have 3 datasources on a custom control that is loaded, when a new tab is generated

 

 

The issue I’m fighting with at the moment is that for example “docCRMLocation” returns docCRMPerson as the Object Dump, while the computed field returns the correct UNID for the location.

Also using

var docCRMLocation:NotesDocument = database.getDocumentByUNID(getDocUNID(docCRMPerson.getItemValue(‘ID’),1));

returns the correct documemt. Anyone an idea what is going on? Or am I doing it completely wrong? Any help is appreciated.


@Formula Magic

How often have you created views to return a concatenated value as a result of a @DBLookup? You normally create a new column and add something like this as a column value:

fieldname1 +"~"+ fieldname2 + ...

The complexity of this formula increases with the number of items you like to concatenate.
And it gets even more complex if you want to build a view to return all items of a document ( except a few ) as JSON style data.

Then you would have to write a formula similar to this:

"{ \"" + "count\" :" + @Text(count) + " \"" + "Author\" :" + Author + ... +"\}"

A little @formula magic can make this work much easier

Simply put this formula snippet into a view column.

_exclude:="$FILE":"$Fonts":"Form":"$UpdatedBy":"$Revisions";
_fld:=@Trim(@ReplaceSubstring(@DocFields;_exclude;@Nothing));

"{"
+ @Implode (
@Transform (
_fld; "_fn" ; "\"" + _fn + "\":\"" + @Text ( @GetField ( _fn) ) + "\"" ) ; "," ) +
"}"

@DocFields gets all fields of the underlying document and @Transform and @Implode concatenate the fieldnames and according values. The result looks like this:

{
"fieldname1": "value",
"fieldname2": "value",
"fieldname3": "value",
...
}

Now you can use this view column as a JSON datasource …


XPages FloatingPane Custom Control

I have just ( almost ) finished a new control to submit for the OpenNTF Development Contest.

It’s a floating pane control. The control is similar to Ferry Kranenburgs control. The difference is that my control does not use any 3rd party libraries like jQuery. The control is fully built with dojo.

I need to write the documentation and wrap all stuff into a zip. I expect that the control will be available during the weekend.

As a teaser, I have produced a short video showing the control in action.

Don’t throw any stuff at me; it’s my first videoproduction


Holiday, a new job and upcoming conferences

It has been a bit quiet here for the past few weeks. So here is a wrapup of what has happened.

After my wife and I didn’t went on holiday in 2010 due to my wife’s lung desease, we spent almost 3 weeks in Side, Turkey this year. Although I booked the wrong hotel, it turned out that this hotel was a better choice than the hotel I had in mind when booking. It was a fantastic holiday to free my mind with a lot of sun (sunburn included), swimming, diving and other activities.

Many of you already know that I no longer work for WITTE Velbert. I had my last day at June, 8th. I started a new job on July, 1st.

I am now a fulltime XPages developer. I’m working for is@web, a company located in Nuremberg, Germany.

The decision to change the employer was already made in january 2011 when my friend Werner Motzet asked me to join the company. We had a telephone conference with CEO Jens Dinstühler and during this conference we agreed to meet a few days later in Nuremberg to discuss the contract details.

On January, 13th, I took a red-eye to Nuremberg and at the end of the day I signged the contract.

Although the company is located in Nuremberg, I am working in an office in Ratingen near Düsseldorf. I am the only employee in this office at the moment, but it is planned to increase the number of employees soon.

I am working on a Business Application Suite ( COIS V2 ). The application is completely based on XPages technology and used internally in the first place. It is intended to sell parts of the suite ( or the whole suite ) as soon as the application went to the internal quality assurance process and becomes gold release. More details to follow …

Let’s talk about upcoming conferences. Due to the job change, I’m not sure if I will/ can attend AdminCamp 2011 in Gelsenkirchen this year. In November I will talk at the DNUG conference in Bamberg.

Per Henrik Lausten invited me to give a session at the DanNotes conference in Danmark. I have confirmed the invite and looking forward to attending DanNotes.

 


Get custom properties from another custom control

Here is a quick tipp that can make your work with custom controls easier.

Each custom contConrol can have a set of customproperties that are accessible vie compositeData.PropertyName. But also each custom control has it’s own propertyMap. This makes it impossible to access a custom property from ccParent by ccChild.

I have put together a small piece of JS that let you access the custom properties.

function getParentProperty(_this, parentProp){
var parentID = getComponent(getComponent(_this.getId()).getParent().getId()).getParent().getId();
if(null != parentID) {
var parentComponent = getComponent(parentID);
var parentProperties = parentComponent.getPropertyMap();
if(null != parentProperties) {
var ret = parentProperties.getProperty(parentProp);
}
}
return (null != ret)? ret:null;
}

Download sample database


Using MySQL Data in XPages

In todays world, data is not stored in a single place but in different systems and on different platforms. On possibility is a SQL database. Assume, you want to access this data and use it in your XPages application.

I have created a new project and contributed the code on OpenNTF.

The javascript lib contains a single function “getSQLData()” that establishes the connection and retrieves the data acording to the connection parameters and SQL statement you provide.

The resultset can then be used in a XPages DataTable control. Simply bind the control to the “getSQLData()” function. This also works in a repeat control or a combo box.

Use “Select * from people” to retrieve all columns in the table; you can also use “Select FIRSTNAME, LASTNAME from people” to return only specific values.

Here is some sample code for custom control containing a DataTable using the result from an SQL statement as source.

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.resources>
<xp:script src="/ssMysql.jss" clientSide="false" />
</xp:this.resources>
<xp:dataTable id="dataTable1" rows="30"
value="#{javascript:getSQLData();}" var="rs">
<xp:column id="column1">
<xp:this.facets>
<xp:span xp:key="header" style="font-weight:bold">FirstName</xp:span>
</xp:this.facets>
<xp:text escape="true" id="firstname">
<xp:this.value><![CDATA[#{javascript:rs[1]}]]></xp:this.value>
</xp:text>
</xp:column>
<xp:column id="column2">
<xp:this.facets>
<xp:span xp:key="header" style="font-weight:bold">LastName</xp:span>
</xp:this.facets>
<xp:text escape="true" id="lastname">
<xp:this.value><![CDATA[#{javascript:rs[2]}]]></xp:this.value>
</xp:text>
</xp:column>
<xp:column id="column3">
<xp:this.facets>
<xp:span xp:key="header" style="font-weight:bold">
Country
</xp:span>
</xp:this.facets>
<xp:text escape="true" id="computedField1">
<xp:this.value><![CDATA[#{javascript:rs[3]}]]></xp:this.value>
</xp:text>
</xp:column>
<xp:column id="column4">
<xp:this.facets>
<xp:span xp:key="header" style="font-weight:bold">Age</xp:span>
</xp:this.facets>
<xp:text escape="true" id="computedField2">
<xp:this.value><![CDATA[#{javascript:rs[4]}]]></xp:this.value>
</xp:text>
</xp:column>
</xp:dataTable>

</xp:view>

And here is the code for the XPage

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://www.ibm.com/xsp/custom">
<xc:ccSQLViewSample SQLQuery="Select * from people">
<xc:this.connection>
<xc:connection port="3306" db="xtest" password="password"
server="localhost" username="root" />
</xc:this.connection>
</xc:ccSQLViewSample>
</xp:view>

And finally here is the output in the browser

If you want to access data from a DB2 datasource instead of MySQL, simply use the appropriate driver.


LNT 8.5.3 – New Widgets For Android

Domino and Notes 8.5.3 have reached Code Drop 5 and so I (as members of the Domino Design Partner Program) am allowed to blog about all the awesome features and enhancements that will be brought to you when 8.5.3 will be released later this year.

So here are a few notes on whats new in Lotus Notes Traveler 8.5.3.

Lotus Notes Traveler on Android has been given new home page widgets for mail and calendar.

Both widgets come as “small” and “large” , which means 4×2 and 3×7. I personally prefer the small 4×2 widgets for mail and calendar.

Tapping on the icon in the upper left will open the mail or calender on the device.

Lotus Notes Traveler on Android now supports multi-line signatures.

Name Lookup requests are executed against the user’s mail server directory

In previous versions, when a mobile device did a search for a user using the Name Lookup application,  that search was executed against the Domino directory on the Traveler server.  This could sometimes lead to different results that a lookup search executed by your Notes client, since the notes client will search the directory on your mail server.

This behavior is configurable if it is not desired by setting the configuration key NTS_TRAVELER_AS_LOOKUP_SERVER=true in notes.ini on the Traveler server.

On Nokia devices, Lotus Notes Traveler  8.5.3 will support Symbian^3 and Symbian^3 device encryption enforcement.

Here are some more things that have been added:

  • Lotus Traveler data only remote wipe for Apple iOS devices
  • Reply and Forward indicators from Apple devices
  • Select which applications are allowed to sync for Apple devices
  • New security policy option which requires approval for new devices
  • Domino encrypted mail support for Android

 


OpenNTF: XPages ActiveBar Custom Control

Activebar is a crossbrowser information bar, which tries to mimic the look and feel of these bars used by modern browsers. Such bars are commonly used to display important informations to the user. Requests to open a popup window, install some components or to remember some sort of password are prominent examples of what these bars are commonly used for.

Unfortunately modern browsers do not allow any website to access these kind of information bars because of certain understandable security concerns. Activebar is written in pure javascript utilizing the jquery js library for crossbrowser compatibility and ease of development. It simulates the behavior as well as the look and feel of current browser information bars using simple html and css. Therefore it can easily be embedded into your website to display certain information to the user in an unobtrusive way.


OpenNTF: Xpages PagePeel Control

Xpages PagePeel Control is a special control that I created for the Xpages contest on OpenNTF.

You have probably seen these forms of advertisings where you can peel a corner of a website and see a message underneath. It seems most are flash driven, but I decided to try it out using some simple lines of jQuery. There is also a Dojo version of the control.

It depends on your environment, which version you want to use. If your application already includes jQuery, I suggest to use the jQuery custom control.


Domino on Linux: “Could not load de strings from resource”

Today I had the pleasure to consolidate 2 Domino server on Windows into a brand new Linux based Domino 8.5.2 server.

I did not expect any bigger issues. But I was proved wrong. After starting the http task on the new server I saw the following lines on the server console:

Could not load de strings from resource module: nstrings_de
Could not load de strings from resource module: nstrings
Could not load de strings from resource module: nhttprs_de

No big deal, as such error is caused by a wrong setting of the default language in the server document or the default website document.

A quick look into the document and … everything was OK. The server is EN and no language pack is installed. And the default string resource language in the website document was also “English”.

I resaved the document but the server still complained about the missing resources.

I then set the “Load Internet configurations from Server\Internet Sites documents:” to disabled and looked into the Web Engine Settings section of the server document. And there it was

I changed the setting to English, set the “Load Internet configurations from Server\Internet Sites documents:” to enabled again and saved the document. Now the HTTP task starts without an error.

I found the same wrong setting on another Domino running on Windows. On this server the HTTP task starts without any error.

 


OpenNTF: XPages TimeGlider Custom Control

I have released a new custom control on OpenNTF: TimeGlider.

Timeglider is a zooming, panning data-driven timeline — great for history projects, project planning, and much more.

 

The timeline can be zoomed by dragging the vertical slider at right: up for zooming in (less time shown) and down for zooming out (more time shown). The mousewheel also works as a zoom controller. Any white area on the “stage” of the timeline can be dragged left and right, as can the blue “ruler” which marks out different units of time. Clicking on an event brings up a small modal window with a description and links if any are provided in the data.

Timeglider timelines can load directly from data you provide in a view.

It uses jQuery and an open-source timeline component ( http://timeglider.com/jquery/?p=intro )

The control works best in modern browsers like Safari, Chrome and Firefox. It has some problems rendering correctly in IE. No surprise is that.

I have only included the compressed version of zhe javascript components. You can download the uncompressed version from the above link.


OpenNTF: XPages DailyDilbert Custom Control

I have just released a new custom control for the OpenNTF Development Competition. It reads the xml data from http://dilbert.com/xml/widget.daily and displays the image for the current days strip.

The control uses only a few lines of code to retrieve and parse the data.

var domfactory:javax.xml.parsers.DocumentBuilderFactory = 
javax.xml.parsers.DocumentBuilderFactory.newInstance();
var xmldocument:javax.xml.parsers.DocumentBuilder = domfactory.newDocumentBuilder();
var domdoc:DOMDocument = xmldocument.parse("http://dilbert.com/xml/widget.daily");
var CurDay:DOMNodeList = domdoc.getElementsByTagName("CurrentDay");
var CurDayVal:DOMNode = CurDay.item(0);
var domelements:DOMNodeList = domdoc.getElementsByTagName("URL_Strip");
var domnode:DOMNode = domelements.item(parseInt(CurDayVal.getFirstChild().getNodeValue()));
return '<img src=\"http://www.dilbert.com' + domnode.getFirstChild().getNodeValue()+ '\" />';

If you find any business value from using this control, please let me know. I doubt there is one …


DNUG 2011 – XPages Sample Application

Here is the sample application, I used at my Special Interest Group session at DNUG 2011 in Bonn.

The sample shows a very simple XPage application that you can use to learn the very basics of XPages development. The sample includes:

  • catogorized views ( with custom expand/collapse indicators)
  • Export to Excel
  • Dojo charting for data visualization

Screenshot

Download


DNUG 2011 – Arbeitskreis Anwendungsentwicklung

Zusammen mit Werner Motzet durfte ich gestern im DNUG Arbeitskreis “Anwendungsentwicklung” zum Thema XPages referieren. Dabei ging es in erster Linie darum, den Teilnehmern die unverzichtbaren Grundlagen zu vermitteln. Die Präsentation finden Sie hier:

Zur DNUG allgemein noch ein paar Worte. Ich habe zum ersten Mal an dieser Konferenz teilgenommen. Und ich muss sagen, dass ich nicht enttäuscht wurde. Der Arbeitskreis war gut besucht. Nach Aussage des Veranstalters sogar besser, als im Vorjahr. Die Teilnehmer waren interessiert und nutzten auch die recht knappe Zeit zwischen zwei Sessions für das Networking.

Im Anschluss an die Session hatte ich die Gelegenheit, an einer offenen Diskussion zusammen mit Maureen Leland (IBM), Niklas Heidloff(IBM) und Werner Motzet(IS). Auch hier entstand von Anfang an eine rege Diskussion. Im Vordergrund standen nicht so sehr die technischen Probleme sondern eher das Image der IBM und die Frage nach dem “Wie kann ich … vermitteln, dass wir mit Notes auf das richtige Pferd gesetzt haben”.

Zu meiner großen Freude wurde ich auch schon für die Herbstkonferenz in Bamberg eingeladen. Dort wollen wir das Thema XPages weiter vertiefen.

An dieser Stelle sei noch einmal darauf hingewiesen, daß die Teilnahme an den Arbeitskreisen auch für Nicht-Mitglieder der DNUG kostenlos möglich ist.

Ich denke, dass ist ein interessantes Angebot und sollte nach Möglichkeit genutzt werden. Als Referent ist es immer schön, wenn auch jemand da ist, zu dem man sprechen kann. Sollten Sie also an dem Thema XPages interessiert sein, so freue ich mich, Sie in einem der nächsten Arbeitskreise begrüßen zu dürfen. Und wenn Sie ein konkretes Thema haben, das als Vortragsthema geeignet ist, so lassen Sie es mich wissen.