354 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
Latest 7 Posts
XPages: Bootstrap File Input
Wed, Mar 26th 2014 115
XPages: A Bootstrap Skin for CKEditor
Mon, Mar 17th 2014 124
Quick-n-Dirty: Use “isDocEditable” in an old school Java Agent
Fri, Mar 14th 2014 69
XPages: Set a Theme for a single XPage
Fri, Mar 14th 2014 175
Quick-nDirty: A Hotfix for CKEditor4
Mon, Mar 10th 2014 97
XPages: Use async / defer option for external CSJS Script Libraries
Mon, Mar 10th 2014 93
XPages: Add an attribute to the BODY-Element
Sun, Mar 9th 2014 112
Top 10
XPages: SSJS & How you can have fun at the office
Tue, Mar 4th 2014 192
XPages: Set a Theme for a single XPage
Fri, Mar 14th 2014 175
Quick-n-Dirty: Use “Old-School” Javacode in your XPages-Application
Thu, Feb 13th 2014 172
XPages: Optimized Partial Refreshs
Fri, Mar 7th 2014 169
XPages: Events, ActionListeners & Parameters
Sun, Mar 2nd 2014 157
XPages: A Bootstrap Skin for CKEditor
Mon, Mar 17th 2014 124
XPages: Modify the File Selection Button
Fri, Jan 24th 2014 122
Quick-n-Dirty: How to use the NAPI in a Java Agent
Thu, Jan 23rd 2014 116
XPages: Bootstrap File Input
Wed, Mar 26th 2014 115
XPages: Add an attribute to the BODY-Element
Sun, Mar 9th 2014 112

Sven Hasselbach
Blog Title blog@hasselba.ch
Blog Description XPages & Domino - Killing me softly
Blog URL http://blog.hasselba.ch
RSS Feed http://hasselba.ch/blog/?feed=rss2
PlanetLotus Feed http://planetlotus.org/profiles/rss/sven-hasselbach
Validate Feed feedvalidator.org or validator.w3.org
Feed Last Checked Apr 17, 2014 8:12:58 PM EST. Realtime Update:
Landed Here Nov 22, 2011
Location Wiesbaden, Hessen, Germany
Posts: # / 1st / Latest - -
Total Hits 2,979. myPL RSS Selections: 7

Recent Blog Posts

XPages: Bootstrap File Input
Wed, Mar 26th 2014 5:16a   Sven Hasselbach
When using the default file upload control in a Bootstrap application, the default file upload button does not fit anymore to the design: To fix this issue, you can use a small jQuery plugin named Twitter Bootstrap File Input. When this plugin is added to your XPage, the button will look like this: To initialize the jQuery plugin, you have to call it with a selector which selects all DOM elements of type file: The description of the button can be changed by setting the title attr [read] Keywords: xpages application css java twitter

XPages: A Bootstrap Skin for CKEditor
Mon, Mar 17th 2014 7:59a   Sven Hasselbach
I have found a very nice skin for CKEditor, the “BootstrapCK-Skin”. It gives a bootstrap look and feel to the Editor: The dialogs are also skinned: You can find and download the skin here http://kunstmaan.github.io/BootstrapCK-Skin/ To use the skin in one of your applications, you have to import the unzipped files into your NSF… … and add your “own” declaration of a xspCKEditor instance: This is required to remove an URL parameter, which is added automa [read] Keywords: ibm R8 richtext xpages applications dojo java widget

Quick-n-Dirty: Use “isDocEditable” in an old school Java Agent
Fri, Mar 14th 2014 4:40a   Sven Hasselbach
If you want to check if a document is editable, you can do this in an old school Java agent with the NAPI function isDocEditable provided by the XSPNative class. First you have to add the required JARs to your agent. Then, you have to call XSPNative.isDocEditable with the document you want to test: import lotus.domino.AgentBase; import lotus.domino.Database; import lotus.domino.Document; import lotus.domino.Session; import com.ibm.domino.napi.c.xsp.XSPNative; public class JavaAgent exte [read] Keywords: agent domino ibm lotus database java

XPages: Set a Theme for a single XPage
Fri, Mar 14th 2014 4:00a   Sven Hasselbach
… or how you can use your own FacesContext implementation. What we need first is our own FacesContext implementation with new methods to set the StlyeKitId (which is the name of the Theme) for initializing the StyleKit instance: package ch.hasselba.xpages; import javax.faces.context.FacesContext; import com.ibm.xsp.application.ApplicationExImpl; import com.ibm.xsp.context.FacesContextExImpl; import com.ibm.xsp.stylekit.StyleKit; /**  * ThemeSwitcherFacesContext  * allows to sw [read] Keywords: domino ibm xpages application database java javascript security xml

Quick-nDirty: A Hotfix for CKEditor4
Mon, Mar 10th 2014 1:01p   Sven Hasselbach
Russell Maher wrote a very interesting article about using CKEditor 4 in XPages, but the current solution requires to change to HTML files directly on the server. But with this little Hotfix you can use CKEditor form a NSF an don’t need to change the HTML files on the domino server: 1. Switch to package explorer perspective 2. Open the file ckeditor.js 3. Search for the variable timestamp… 4. …and remove the 4 characters 5. Save it. That’s it! Now, CKEditor 4 can be [read] Keywords: domino xpages java server

XPages: Use async / defer option for external CSJS Script Libraries
Mon, Mar 10th 2014 6:56a   Sven Hasselbach
When adding CSJS libraries to your XPage, try to use the defer or the async option for a better user experience. When not using this options, the Page might be blocked during page load. Have a look at this example XPage which contains two external CSJS scripts (for demonstration purposes they are computed to get a remote script out of nowhere): Foo! Bar! When opening the XPage, the DOM is blocked, until the operation times out: The best you can do i [read] Keywords: ibm xpages javascript xml

XPages: Add an attribute to the BODY-Element
Sun, Mar 9th 2014 8:22a   Sven Hasselbach
Today I wanted to add an attribute to the element of my XPage. My goal was to generate HTML code like this: After some testing I found a solution by overwriting the method encodeHtmlBodyStart. To do this, you have to extend the class ViewRootRendererEx2: package ch.hasselba.xpages; import java.io.IOException; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; import com.ibm.xsp.component.UIViewRootEx; import com.ibm.xsp.renderkit.html_basic.ViewRootRende [read] Keywords: ibm xpages java xml

XPages: Use a Method Binding as Converter
Sat, Mar 8th 2014 3:17a   Sven Hasselbach
I accidentally found a way to add a method binding as a converter to a component, because I have added a managed bean as a converter directly in the source code. The DDE does not support this. If you go to the converter property of a component, you can only add one of the predefined converters: But you can go to the source and add a method binding to the option, in this case my bean which implements my converter functionality. If you now reopen the saved XPage, the converter property is fille [read] Keywords: xpages


XPages: Optimized Partial Refreshs (2)
Fri, Mar 7th 2014 9:11a   Sven Hasselbach
With the Optimized Partial Refresh you can do a lot of nice things: If only a part of the form is sent to the server, only this part of the components in the JSF component tree will be processed. This means that only submitted values are applied, coverted and validated, which can result in less server usage and a better performance. Normally, if you have two required fields on you XPage and do a Partial Refresh, both fields will have a validation error: But with this technique, you can choose w [read] Keywords: ibm xpages dojo server xml

XPages: Optimized Partial Refreshs
Fri, Mar 7th 2014 3:58a   Sven Hasselbach
Inspired by the last post of Mark, I have created a small CSJS snippet which allows to optimize the behaviour of a Partial Refresh. Normally, if you execute a Partial Refresh, all elements of a form are sent to the server. Take a look at this XPage:                                                                                      The button refreshes only a small portion of the XPa [read] Keywords: ibm xpages dojo java javascript server vm xml

XPages: SSJS & How you can have fun at the office
Tue, Mar 4th 2014 2:20a   Sven Hasselbach
This article is a demonstration of what harmful things you can do when using the SSJS & prototyping wrong( decribed here by the great Mark Roden). Don’t do that! Especially not on a productive server!   Wanna have a lot of fun in the office with the other developers? Just overwrite some global SSJS functionality! They will never find out what happend to their applications! This is the application we destroy Our demonstration application uses a small Java class which has only a singl [read] Keywords: ibm R5 R6 xpages application applications java javascript office server xml

XPages: Events, ActionListeners & Parameters
Sun, Mar 2nd 2014 4:21a   Sven Hasselbach
To access the event parameters of an event within your actionListener, you have to access the source object of your actionEvent object: package ch.hasselba.xpages; import java.util.List; import javax.faces.event.AbortProcessingException; import javax.faces.event.ActionEvent; import com.ibm.xsp.complex.Parameter; import com.ibm.xsp.component.xp.XspEventHandler; public class MyActionListener implements javax.faces.event.ActionListener {     public void processAction(ActionEvent eve [read] Keywords: ibm xpages java javascript xml

Quick-n-Dirty: Disable Validation for FileDownload control (2)
Wed, Feb 19th 2014 2:36p   Sven Hasselbach
Because my old snippet does not work anymore for ND9 (the IBM changed the internal methods / objects) I had to create a new way to disable the validation of the FileDownload control. Now I have switched to a PhaseListener which waits for to any XspEventHandler and checks if this event handler is a child of the FileDownload control. If so, it skips the validation. Here is the code for the PhaseListener: package ch.hasselba.xpages; import java.util.Iterator; import java.util.Map; import jav [read] Keywords: ibm R5 R6 xpages java vm xml

Quick-n-Dirty: Use “Old-School” Javacode in your XPages-Application
Thu, Feb 13th 2014 4:06p   Sven Hasselbach
Because I often have read that it is not possible to access “Old School” Java elements in XPages, but never understood the reason why, I have written my own class loader for fun to demonstrate how to do this: 1. I have created a simple Java library: 2. The library contains a single class “LoadedClass“: The class is very simple. When it is instantiated, it just prompts the current timestamp to the server console: package ch.hasselba.test; public class LoadedClass { [read] Keywords: domino ibm lotus R4 xpages application database java javascript properties server xml

XPages: Modify the File Selection Button
Fri, Jan 24th 2014 4:21a   Sven Hasselbach
With Dojo, you can easily customize the file upload button, f.e. to change the label, add additional style sheets or use HTML5 or Flash plugin for uploading. Here is basic example which adds a label and a blue border around the button:                                                                                          Have a look at dojox.form.Uploader for more details. [read] Keywords: ibm xpages dojo xml

Quick-n-Dirty: How to use the NAPI in a Java Agent
Thu, Jan 23rd 2014 3:32a   Sven Hasselbach
The undocumented NAPI for direct API calls in Java can easily used in normal agents. You just need to add two jar files to your java agent: lwpd.commons.jar lwpd.domino.napi.jar These files can be found in osgisharedeclipseplugins. After importing, you do lot of funny things, f.e. opening a Session in Full Administration Mode, etc. NotesSession nSession = new NotesSession(); nSession.setFullAdminMode( "SERVERNAME", true ); But don’t forget: These calls are native API calls and can ea [read] Keywords: administration agent domino notes eclipse java

Das Unitymedia-Fiasko
Tue, Jan 14th 2014 3:55p   Sven Hasselbach
Es begann im Frühjahr 2013, als der bestehende DSL-Vertrag in meinem damaligen Büro auslief, und ich – in weiser Vorraussicht, demnächst in meinem Haus Kabelanschluss zu benötigen – vorübergehend in mein Büro einen Internetanschluss von Unitymedia legen ließ. Da ich bisher keine Berührungspunkte mit Unitymedia hatte und Telefon sowie HD-Fernsehen haben wollte, kam mir das 3play Angebot gerade recht: 100 Mbit Down / 2,5 Mbit Up, Telefon-Flat, und “demnächst” dann [read] Keywords: email

Java: Reflection Madness
Mon, Jan 13th 2014 2:51p   Sven Hasselbach
A very interesting presentation about reflection in Java: Reflection Madness from Heinz Kabutz. You can find the slides here. [read] Keywords: java

A productive period: cyccle.net
Fri, Jan 10th 2014 6:57a   Sven Hasselbach
During the last weeks I started to think about my next steps leaving the yellow bubble. While I am still inside the bubble (and available for developement work, just contact me), I am in a very productive period: I continued to finalize the cyccle project. I started the development in 2012, but had a lot of breaks and was unable to finish the work. But in the next weeks, I am launching a new company and the beta phase will begin. Stay tuned… [read] Keywords: development

So Long, and Thanks For All the Fish
Tue, Oct 22nd 2013 10:28a   Sven Hasselbach
During the last three months I searched for a new project. I hoped to obtain a larger XPages development project. But in short, there are no projects. Even „normal“ Lotus Notes development projects does not exist anymore, or are extremly rare (and you don’t want to know their daily rates…). It is the same procedure as every year. But it’s getting harder. Year by year. In the last years, I always hoped that Lotus Notes is not dead. But the tribal wisdom of the Dakota Indians [read] Keywords: ibm lotus notes xpages development

Quick-n-Dirty: Ajax Fileuploads
Mon, Sep 9th 2013 1:42p   Sven Hasselbach
Here is an example how to upload a file with Ajax to a XPage. It is a simple Javascript, and adds the required fields to the xhr request. This example works in FireFox and Chrome and should work on Domino >=8.5.2.                                                                                                                                    The fileupload control execute [read] Keywords: domino ibm R7 ajax dojo firefox javascript server xml

XPages: File downloads and blocked UI
Wed, Jul 24th 2013 1:26p   Sven Hasselbach
Yesterday Christian asked a very interesting question: He had observed that the browser UI is blocked when clicking a button which generates a PDF on the server and sends the result. For about 30 seconds no button is working, no events are fired. My first thought was that this behaviour is caused by the submit locking during partial refreshs, and after testing a XSP.allowSubmit() in the debug console I could prove myself that I was right. It looked first like an easy solution, but after thinking [read] Keywords: ibm xpages ajax application archive dojo java javascript server xml

Quick-n-Dirty: Upgrading XPiNC / XULRunner
Wed, Jul 17th 2013 3:41p   Sven Hasselbach
I have tested a small upgrade of XULRunner (the internal browser used for XPiNC applications) and successfully changed the version from to in DDE 8.5.3 and 9.0. Version was released on 15.10.2010 Release Notes for Firefox 3.6.10 Version was released on 13.03.2012 Release Notes for Firefox 3.6.28 To do this by your own you have process the following steps: Close Notes and Designer completly Download the package for your platform from mozilla.org Extract the [read] Keywords: ibm notes applications eclipse firefox wiki

The Haunted Field
Wed, Jul 17th 2013 11:52a   Sven Hasselbach
I am currently working on a huge application which exists for many years now, and has a long history with different developers and just a few manuals and/or documentations. But as often it is a critical business application which is in use across different countries 24/7. The more danger, the more less honor: Every fault is just a further nail in the coffin of the developer… Today I had to develop an extension for this application, and this has driven me crazy, because it was a pain to ide [read] Keywords: agent ibm application xml

XPages: Use a PhaseListener for global URL commands
Thu, Jul 11th 2013 2:56p   Sven Hasselbach
One of my customers wanted an easy way for printing XPages in different formats and with different content, depending of the current XPage opened in the browser. It was a requirement to develope a global solution for every XPage-based application in his company. That is why I created a global Java class which does not require to modify the existing applications at all. But it allows to customize and configure the output for the different needs of the departments and their required reports and pr [read] Keywords: xpages application applications java server xml

XPages: Create your own Required Validators
Thu, Jun 20th 2013 3:30p   Sven Hasselbach
If you try to implement your own JSF Validator (by implementing javax.faces.validator.Validator), you will notice that you are unable to check for an empty value. The reason for this is rather simple: The method validate() is only called, if there is something to do. If the value is empty, there is nothing to do, that’s why nothing happens. But wait! What about the available required validator for XPages?       And yes, this is a validator, but the IBM implemented a workaroun [read] Keywords: ibm xpages bug interface javascript oracle xml

XPages: Dojo 1.8.1 & jQuery Mobile 1.3.1
Thu, Apr 25th 2013 10:46a   Sven Hasselbach
As David Leedy got into trouble with Dojo 1.8.1 and jQuery Mobile 1.3.1  and after reading the follow up from Ulrich Krause with the analysis of the problem, I thought that this problem is caused from the AMD loader of Dojo. That’s why I changed the loading order (by forcing the jQuery libraries to get loaded before Dojo), and this seems to work. I have tested it in IE 8, FF 20.0 and Chrome 26.0. Here is my test XPage:                                       [read] Keywords: domino ibm xpages css dojo java javascript mobile properties xml

Quick-n-Dirty: Dojo 1.8 & Domino 8.5.3
Thu, Apr 25th 2013 3:53a   Sven Hasselbach
If you want to use Dojo 1.8 with Domino 8.5.3, you can do the following: 1. Grab the Dojo JAR file from a ND9 installation: osgisharedeclipsepluginscom.ibm.xsp.dojo_9.0.0.jar 2. Create a folder “dojo-1.8.0” in your notes data directory dominojsdojo-1.8.0 3. Unpack the JAR file 4. Copy the content of the subfolder resourcesdojo-version of the unpacked JAR file in this folder: 5. Restart HTTP task. 6. Enjoy!     document.write(dojo.version)           P.S. Keep in mi [read] Keywords: domino ibm notes dojo eclipse javascript oracle xml

XPages: Add inline CSJS with a Theme
Thu, Apr 18th 2013 12:06p   Sven Hasselbach
I needed a way to add some inline CSJS to an existing application which affects any XPage, that’s why I did this them with a theme. Et voilà:                          alert('THEME JS!')             true              The javascript code is added and executed as expected: [read] Keywords: R6 xpages application java javascript

XPages: Inject CSJS code at page top
Tue, Apr 9th 2013 3:05a   Sven Hasselbach
Sometimes it is required to add a some CSJS code at the beginning of the XPage before the Dojo libaries are loaded and are executed. This can be easily achieved by using the resource aggregation feature and including a CSJS library with the . First you have to create a CSJS library which contains the code you want to execute: Then you have to add the which loads the CSJS library:                                                          [read] Keywords: ibm R6 xpages application dojo javascript properties xml

Notes 9: Some interesting xsp.properties
Wed, Apr 3rd 2013 2:22p   Sven Hasselbach
Some interesting new xsp.properties were introduced with Notes 9: xsp.client.resources.uncompressed When set to true, all Dojo libraries and CSS resources where delivered in the uncompressed version. The path changes f.e. to /xsp/.ibmxspres/dojoroot-1.8.1-u/dojo/dojo.js. xsp.client.script.dojo.html5attr When set to true, the Dojo HTML5 Data attribute is added to all Dojo component on the XPages. Here is an example for a Date/Time field: xsp.radiobuttongroup.item.label.prefixSpace When set [read] Keywords: ibm notes xpages css dojo properties widget

Notes 9: No Comment!
Tue, Mar 26th 2013 1:15p   Sven Hasselbach
[read] Keywords: notes

Quick-n-Dirty: How to add HTML 5 events
Tue, Mar 26th 2013 5:13a   Sven Hasselbach
One way for adding unsupported events to an XPage or a component is the trick from Keith. But this is limited to CSJS only. If you need to execute a server side event, you just need change the name of the event to a new HTML 5 event name which does not exist in the DDE. Here is an example for the new onSearch event:                                                                       After entering a value and hitti [read] Keywords: ibm bes javascript server xml

In Ya Facet!
Wed, Feb 20th 2013 6:27a   Sven Hasselbach
Using Facets in XPages is very nice, because it gives you an easy way for a global design of your application (and much more). It can be used in all XPages and their custom controls. The xp:callback element defines a section, and this section can be filled in by the parent component with the xp:key attribute. Take a look at this custom control: It has a single callback area (I will never understand why it is called “Editable Area” in the DDE), and a xp:text which is filled [read] Keywords: ibm xpages application javascript properties xml

A performance bottleneck?
Sun, Feb 17th 2013 7:17a   Sven Hasselbach
Paul Withers wrote an very interesting article about the difference between a passthrough UIComponents and the corresponding XPages elements. This means the use of instead a , or a instead of a . A while ago I have tested if this would affect the performance, and as far as I know it makes no difference. Here is the code I used to test the performance: Test with a Open the page Partial Refresh Test with [read] Keywords: ibm xpages java javascript xml

XPages: The Problem with DataContext Variables
Mon, Feb 11th 2013 5:40a   Sven Hasselbach
There is a large problem with data context variables if they are bound dynamically. They will be recomputed again and again, even when in Partial Execution mode and if they are not in use. Here is a small demo XPage: If you are open the XPage, a dataContext variable will be recalculated for three times: Clicking on the button will recalculate them up to eleven times: Keep in mind: Partial Refresh & Partial Execution is enabled. T [read] Keywords: ibm R7 xpages java javascript xml

Quick-n-Dirty: Disable all validators at once
Sun, Feb 10th 2013 7:47a   Sven Hasselbach
In a larger project there are a lot of forms to fill in, each form has many fields with validators and converters. During the development of the workflow it was really helpful to disable all validators at once by using the setDisableValidators() method of the facesContext. To control the behaviour I have added an URL parameter which is checked in the afterRestoreView event. If you open the XPage in the format http://hostname/db.nsf/xPage.xsp?noValidators=true all validators and converters will b [read] Keywords: ibm development javascript xml

XPages: compositeData is undefined
Sun, Feb 10th 2013 3:50a   Sven Hasselbach
An interesting question was asked on StackOverflow.com: The compositeData of custom control is undefined in beforeRenderResponse event. I have never noticed this before, but if you are accessing the compositeData object in the before-, afterRenderResponse or the afterRestoreView event, the object is undefined. Here is a simple demonstration CC which just prints the type of the compositeData object to the console:                                          [read] Keywords: ibm xpages javascript xml

Quick-n-Dirty: Import SSJS libraries with DXL
Thu, Jan 10th 2013 3:02p   Sven Hasselbach
In the last time I have developed different techniques for manipulation the design elements of XPages applications. While I am still working on a way for manipulating the localization files, I was playing a little bit with DXL imports. Here comes a Java class to import a SSJS library with DXL to a database. It allows to create a new library directly from the browser: By clicking the Import button the new Library will be added to your database (perhaps you have to refresh the DDE): To use the [read] Keywords: acl dxl ibm lotus R6 scriptlibrary xpages applications database java javascript security xml

XPages: UI for editing localization files (1)
Mon, Dec 17th 2012 12:39p   Sven Hasselbach
For one of my customers I am developing an easy way for editing the localization/translation of existing XPages applications: Instead of importing and exporting the property files with the Domino Designer (which is not an option for non-developers) it would be more suitable, if the users would have the possibility to edit the files directly in the browser. I am currently  working on a XPage solution for this, and this is my current beta version. This is a proof-of-concept with some known bugs, [read] Keywords: domino ibm lotus notes xpages application applications database java javascript openntf properties xml

XSnippets: viewPanelHelper
Wed, Nov 28th 2012 2:40a   Sven Hasselbach
I have added a new XSnippet, the viewPanelHelper. The code helps to keep the selection of the selected documents in a view panel even if pager is used or categories are expand or collapsed. It is not required to modify the view: Only the script and the hidden field must be added to the facets section of the panel and the CSJS class “viewPanelHelper” must be added to the XPage (the class is loaded only once and can be stored in a separate CSJS resource file). The selected documents ar [read] Keywords: openntf

XPiNC and Attachments: A better PDF handling
Thu, Nov 15th 2012 2:11p   Sven Hasselbach
For one of my customers I have created a small XPiNC application with contains a lot of documents with attached PDFs. One of the key requirements was the posibility to open and read a PDF directly in Notes Client, without storing it on the desktop. The first thing to know is that XPiNC applications are running in XULRunner, which means that there is a compatibility to Firefox. That’s why you can use FF plugins*, for example the Foxit Reader plugin (npFoxitReaderPlugin.dll) or the original [read] Keywords: domino ibm lotus notes notes client R4 R7 xpages application applications desktop eclipse firefox java javascript vm wiki xml

XPages: Disable iOS “autocorrect” and “autocapitalize” features
Wed, Oct 31st 2012 3:48a   Sven Hasselbach
Two of the worst features ever implemented are the “autocapitalize” and “autocorrect” features from iOS devices, because they are enabled by default. It does not make fun to write a blog comment in another language… Or if you just want to enter your email address in a form: The first letter is always upper case, and you always have to kill the suggestion while writing some text. To disable this behaviour, you have to add two attributes to the components, autocorrect [read] Keywords: domino ibm xpages apple application email

Quick-n-Dirty: Use your own Factory classes in XPages(2) – The VirtualPageTransformer
Wed, Oct 24th 2012 5:43a   Sven Hasselbach
While playing a little bit with core XPages functionality I found the interesting VirtualPageTransformer interface. With this interface it is possible to implement “virtual” XPages, and this allows to do something which can be described like an url mapping (the $$OpenDominoDocument.xsp url for example was implemented this way). To do create your own transformations you have to do the following: 1. Read the first article about using Factory classes in XPages and create the required /W [read] Keywords: ibm xpages database interface java properties

Quick-n-Dirty: Disable Validation for FileDownload control
Wed, Oct 24th 2012 3:12a   Sven Hasselbach
If you are using the file download control,  you sooner or later want to allow your users to delete an existing file. But if you have some required fields on your XPage, a deletion is not possible because the validation is always fired before the attachment is removed. To disable to validation you can use this little SSJS snippet which sets the “disableValidators” property for all events of the UIFileDownload control. Just add the following code to the beforeRenderResponse event o [read] Keywords: ibm java javascript

Quick-n-Dirty: Non Closable Dialog for ExtLib
Fri, Oct 19th 2012 2:53a   Sven Hasselbach
I have created a dirty hack for dialogs which prevents users to close the dialog by pressing the escape key or the close button. In my first approach  (StackOverflow.com)the hack has overwritten all dialogs for the whole XPage. This version allows to enable / disable it per dialog. To use this hack you have to add the CSJS library to your XPage and call the dialog with an additional parameter ‘nonclosable‘: XSP.openDialog("#{id:dialogNonClosable}", {'nonClosable': true } ); The [read] Keywords: ibm dojo xml

Quick-n-Dirty: Use your own Factory classes in XPages
Thu, Oct 18th 2012 5:27a   Sven Hasselbach
Here is a easy way to use your own factory classes in XPages: 1. Create a file named “com.ibm.xsp.factories.properties” in the WEB-INF-Folder of your NSF 2. In this file, define the factory classes you want to use in the format= HelloWorldFactory=ch.hasselba.factory.HelloWorld 3. Create a java class, in this example ch.hasselba.factory.HelloWorld package ch.hasselba.factory; public class HelloWorld {    public HelloWorld(){       System.out.println("Hello World Fa [read] Keywords: domino ibm lotus xpages application java javascript properties server xml

Quick-n-Dirty: Controlling Dojo generation for individual XPages
Wed, Oct 17th 2012 2:29a   Sven Hasselbach
Another interesting question has been asked on stackoverflow.com: How to enable or disable the Dojo libraries for individual XPages, not the whole application? Just adding the parameter as shown below to the XPage won’t work: The workaround is to add a single line to beforePageLoad or beforeRenderResponse event: facesContext.getRequestParameters().setJsLibrary(0); The parameter can be set as the following “0″ disables Dojo Framework “1″ enables Dojo Framwork [read] Keywords: traveler xpages application dojo javascript properties

Quick-n-Dirty: A simple isRecycled() method (2)
Thu, Oct 11th 2012 3:20a   Sven Hasselbach
Tommy Valand improved the idea: In his solution the isDead method of the NotesBase class is accessed, and this works better, because the method addionally checks for the C object handle. Here you can find the method: http://stackoverflow.com/questions/12740889/what-is-the-least-expensive-way-to-test-if-a-view-has-been-recycled [read] Keywords: domino lotus notes

Quick-n-Dirty: A simple isRecycled() method
Wed, Oct 10th 2012 3:24a   Sven Hasselbach
You will find that the domino java API does not have a suitable method to test if a domino object was already recycled or not. And because of the internal caching of some method calls it is not reliable to check for example for a specific property with a try/catch block. But domino objects have a private property isdeleted which is transient and gives us the required information. With Java Reflection it is possible to access this property: package ch.hasselba.domino; import java.lang.reflect. [read] Keywords: agent domino lotus xpages database java oracle

Teamstudio Unplugged: SSJS & Error Messages
Fri, Sep 28th 2012 5:06a   Sven Hasselbach
Today I had to fight with a mysterious error message in a XPage application which is running on Teamstudio Unplugged: SyntaxError: missing ; before statement This IS the message. No more information. No stack trace. No library name. Nothing! It was a hard piece of work to find the needle in the haystack: I used the synchronized keyword in a SSJS library. Hope in future Teamstudio will provide better error informations… [read] Keywords: application

XPages: Capture Signatures with the jQuery-Plugin ‘jSignature’
Wed, Sep 26th 2012 12:35a   Sven Hasselbach
In one of my current projects it is one of the goals that the members of the field staff have the possibility to sign a report directly on their iPad. After some research I found the very cool jQuery plugin jSignature, which easily allows to add a signature capture field to a XPage. The plugin is very easy to use: Just add a to your XPage and initialize the plugin with the .jSignature() constructor and that’s it! The API is very simple, but provides everything needed: The captured signatu [read] Keywords: agent ibm notes xpages css database javascript openntf wiki xml

Quick-n-Dirty: Development Helper for Unplugged
Fri, Sep 21st 2012 5:32a   Sven Hasselbach
I started today testing/evaluating Teamstudio Unplugged for a customer project. The first thing I missed during developement was a button to sync the current page directly to see my changes on the fly. That’s why I created this small custom control:                   Unplugged Development Helper                                                                                     The Wor [read] Keywords: ibm development workspace xml

XPages: High Performance Applications
Tue, Sep 18th 2012 3:22p   Sven Hasselbach
During the last months I worked on a high performance XPages application used by a lot of end users.  To get a better data throughput, I decided to use a reverse proxy for load balancing, caching of ressources, SSL connections etc. For static resources I am using some “special” domains: This means that the browser is allowed to do more HTTP requests at once to the same NSF. If you have for example some images in your database which are reachable from outside via http://www.example.c [read] Keywords: agent connections domino ibm lotus xpages application applications css database java javascript security server xml

XPages: Lost in Translation
Tue, Sep 18th 2012 2:29a   Sven Hasselbach
The localization feature is really nice and helps a lot, but you also can have some trouble using it. The first problem is that the language codes which are used in XPages are different from the language codes in java.util.Locale. This SSJS code for example will not work: var locale = new java.util.Locale( "fr_BE" ); context.setLocale( locale ); context.reloadPage(); It will not work because the java.util.Locale object returns “fr_be“, but the PageDetails are set to “fr_BE [read] Keywords: ibm xpages css database java javascript xml

This is not me!
Wed, Sep 12th 2012 9:17a   Sven Hasselbach
Hey! This is not me on CollaborationToday.info! That’s me: [read] Keywords: xpages

XPages: The Outputstream and binary data
Wed, Sep 12th 2012 2:49a   Sven Hasselbach
If you want to get control over the outputstream of a XPage, you can use the response object from the ExternalContext: var response = facesContext.getExternalContext().getResponse() This will give you access to an object of type com.ibm.xsp.webapp.XspHttpServletResponse which allows some basic operations, but the response will always be encoded to UTF-8. You can not return any binary data directly. But if you access the underlying LCDAdapterHttpServletResponse directly, it is possible to get the [read] Keywords: ibm xpages java javascript oracle xml

Security: Another XSS Vulnerability in Domino
Tue, Sep 11th 2012 3:55a   Sven Hasselbach
Stephan Wissel wrote about a XSS vulnerabilty for Domino servers (< 8.5.4) and in his post you will get a advise how to protect your domino server against this attack. Thanks for this! Works great! But there is still a problem with another URL pattern: */xsp/.ibmmodres/* This resolves resources from databases, that’s why it only works in a database URL. But normally domcgf.nsf is reachable from outside. [read] Keywords: domino database security server

Quick-n-Dirty: Disable Domino’s Cache for easier development
Sat, Sep 8th 2012 4:31a   Sven Hasselbach
I am currently developing a larger application and have a lot of different mobile devices for testing purposes. After making some changes it is required that all test devices have the latest version of my XPages running, and that the clients get the latest version of the frontend libraries (CSJS, CSS, Images, etc.). Because it is rather annoying to always check whether the browser cache is cleared or not I decided to disable the caching on the domino server directly via a web rule. This works re [read] Keywords: admin domino dwa R7 xpages application css development mobile server

SSJS: Execute remote SSJS Code
Fri, Aug 24th 2012 6:26a   Sven Hasselbach
I have created a small helper class to run SSJS code from a remote server. The basic idea behind this class is a question on stackoverflow: http://stackoverflow.com/questions/12054733/include-jss-file-from-notes-document-as-resource As far as I know there is no way to add a SSJS resource via the src attribute, this won’t work: It will always fail, even if the file is available, has the correct file extension etc. That’s why I wrote the code, it’s only a proof of concept. [read] Keywords: ibm notes xpages java javascript security server xml

SSJS: What’s “this”?
Fri, Aug 24th 2012 4:31a   Sven Hasselbach
In Serverside JavaScript the keyword this always refers to the “owner” of the function which is executing,  or rather, to the object that a function is a method of. This means f.e. that this refers to the UIComponent which contains the SSJS code. If you add a label to a XPage and compute the value…                … this will always return the current corresponding instance of the XspOutputLabel: But if you are inside a function this will return th [read] Keywords: ibm javascript server xml

Quick-n-Dirty: @ClientType() in XPages
Thu, Aug 23rd 2012 6:27a   Sven Hasselbach
The @ClientType formula provides an interesting behaviour: If you add the value to a label, the result will be as expected. It returns “Web” in Browser and returns “Notes” in XPiNC. But if you add it to a computed field on a form and use this form in a datasource, the result in XPiNC is not “Notes“, it is “None” instead.                                [The computeWithForm property of the datasource has [read] Keywords: ibm notes xpages javascript xml

XPages: Additional Facets for Viewpanels
Thu, Aug 16th 2012 3:08a   Sven Hasselbach
Today I found some additional facets sections for a normal view panel component which can help to design a layout of an application. They are named like the wind directions and  are equivalent to the position information for the relevant content. The following screenshot shows all facets in use. In the center you can see the content of the view panel. The pagers are not used, only place holders for a better demonstration: As you can see there is some HTML source code in the top of the page vis [read] Keywords: ibm xpages application javascript xml

XPages: Access a datasource from one custom control in another one
Sun, Aug 5th 2012 1:10p   Sven Hasselbach
On stackoverflow.com, a very interesting question was asked: How can you access a document datasource from one custom control in another custom control. And here comes my solution in a small SSJS function. First you have to add an id to the custom control which contains the datasource. This gives you a handle for other custom controls: Now it is possible to get the custom control by using the SSJS function getComponent(). The datasources are stored in the data attribute of the custom control. [read] Keywords: domino ibm xpages java

XPages: Access resources and their content (2)
Tue, Jul 17th 2012 7:21a   Sven Hasselbach
By using the same code as described in the previous article you can access the complied java classes. To get the correct path you have to do the following: 1. Select the java element you want to access 2. Have a look inside the “$ClassIndexItem” field 3. This is the path of the compiled Java class: 4. Change the variable url to the specific path var url = "WEB-INF/classes/ch/hasselba/jsf/servlet/MyServletFactory.class"; The first 30 Bytes of the resulting output are for internal [read] Keywords: xpages java

XPages: Access resources and their content
Sun, Jul 15th 2012 1:12p   Sven Hasselbach
To access XPages resources during runtime and to get their content as a string, you can use the following SSJS code snippet:                             [This displays the current faces-config.xml] By using the correct URL path it is for example possible to access the code of SSJS libraries or even the source code of java classes in the database. To access the source code of a XPage, just use the name of the XPage itself. Same procedure for SSJS libraries, just add [read] Keywords: ibm xpages database java javascript xml

XPages: Run your own Servlets
Mon, Jul 9th 2012 6:17a   Sven Hasselbach
A really interesting article about running your own servlets on domino server can be found here: http://www.ibm.com/developerworks/cn/lotus/xpage-servlet/index.html It’s chinese, but you can translate f.e. with Google’s Translator. With 8.5.3 I had have some problems because the required interface IServletFactory could not be resolved in DDE. To get the example running, you have to add a JAR to your build path. Open Project properties, select “Java Build Path” and click [read] Keywords: domino ibm lotus notes xpages eclipse google interface java properties server

XPages application events: Create your own ApplicationListener (2)
Sat, Jul 7th 2012 11:13a   Sven Hasselbach
There is another interface available which provides the additional method applicationRefreshed. This event is always raised if the method refresh() of the Application-Object is fired. Instead of implement the interface described in the previous posting, you have to use the interface named com.ibm.xsp.application.events.ApplicationListener2. package ch.hasselba.jsf.debug; import com.ibm.xsp.application.ApplicationEx; import com.ibm.xsp.application.events.ApplicationListener2; public class MyApp [read] Keywords: ibm xpages application interface javascript xml

XPages application events: Create your own ApplicationListener
Sat, Jul 7th 2012 9:02a   Sven Hasselbach
If you want to get a handle to application events and want to know if a XPages application is created or destroyed (which means the application was destroyed because of a time out), you can implement this by creating your own own application listener. For this you have to do the following steps: Create a class which implements the ApplicationListener interface Activate the class in XPages runtime To realise the first part, you have to create a class that implements the interface com.ibm.xsp.ap [read] Keywords: domino ibm xpages application interface java server

DocumentDataSource with Signer/SignerWithFullAccess-Rights
Thu, May 31st 2012 12:33a   Sven Hasselbach
Yesterday I read the very interessting question from Daniele Grillo at stackoverflow.com: Is a datasource available for XPages who can access the underlying document with different access levels? I have never seen one before, so I decided to do some tests and tried to find a workaround / hack for this problem. But after a while and a some lines of coding, I was unable to get a solution, so I decided to create a new datasource: A datasource which can access the documents in the backend with diffe [read] Keywords: domino ibm lotus xpages java javascript

Controlling the HTTP Expires Header
Wed, May 23rd 2012 6:59a   Sven Hasselbach
After reading a question on stack overflow about setting an own HTTP expires header and the problem that an additional header is generated automatically,  I made some tests how the domino server can be forced to stop this behaviour programmatically. During my tests I was able to stop it by using  facesContext.responseComplete() but this works only for “headless” XPages (set rendered to false). If you are calling the method in a normal XPage (set rendered to true), the generated ou [read] Keywords: domino ibm xpages java javascript server xml

Quick-n-Dirty: HTML5 UIComponents without effort
Thu, May 17th 2012 4:20a   Sven Hasselbach
Obviously it was Chris Toohey who first has discovered the way of manipulation UIComponents with the tagName attribute: http://www.dominoguru.com/pages/xpage_xptext_tagName_options.html The xp:text – element can easily manipulated to add HTML5 functionality to a XPages. By overriding the property tagName, the component can be accessed like every other UI component in the component tree. Normally the designer only allows a small list of choices for the tagName property: But this can be [read] Keywords: ibm xpages javascript xml

XSnippets: Cancel a partial refresh via SSJS
Thu, May 3rd 2012 12:18a   Sven Hasselbach
With the assistance of Philippe Riand I was able to shorten the original idea of canceling a partial refresh to a single SSJS function.  By setting the HTTP header “X-XspRefreshId” to “@none” it is possible to get the same result as in the posting before, but there is no “Dojo hack” required. function cancelPartialRefresh(){ var response = facesContext.getExternalContext() .getResponse();    response.setHeader("X-XspRefreshId", "@none");    response [read] Keywords: ibm ajax dojo java javascript openntf xml

Cancel a partial refresh via SSJS
Tue, May 1st 2012 4:29a   Sven Hasselbach
After reading Tim Tripcony’s blog post , I thought about a way how to cancel a partial refresh via server side javascript. To bring this to life, there are just three things to do: Abort the processing of the request on the server Give feedback to the client that request is canceled Stop Dojo to process the XHR request To stop the processing of a request on the server and to send an empty response to the client, this SSJS code can be used: var response = facesContext.getExternalContext() [read] Keywords: ibm ajax dojo java javascript server xml

Lotus Domino Entwickler ab 07/2012 verfügbar
Sun, Apr 22nd 2012 3:29a   Sven Hasselbach
Als erfahrener freiberuflicher Lotus Domino Entwickler suche ich ab Juli 2012 neue Herausforderungen in Form von spannenden Projekten, bevorzugt im XPages-Umfeld. Ich bin deutschlandweit verfügbar, bin aber anderen Länder gegenüber nicht abgeneigt. Auf Wunsch stelle ich natürlich gern mein Profil zur Verfügung. Bei Interesse bitte einfach eine eMail an contacthasselba.ch oder mich auf XING aufsuchen: [read] Keywords: domino lotus xpages email profile

XSnippets: Fire querySave / postSave – Events
Sun, Apr 22nd 2012 2:07a   Sven Hasselbach
The second XSnippet I have added to the XSnippet Contest is a help to fire the querySave- and postSave-events from SSJS: Save Datasource & Fire querySave/postSave events If you only do a simple document1.save() , the events of a datasource won’t be executed. To fix this, you have to use the save() method of com.ibm.xsp.model.domino.DominoDocumentData instead: var dsName = "document1.DATASOURCE"; // change this to the name of // the datasource you want // to save var app = facesCont [read] Keywords: domino ibm java openntf

XSnippets: XPages Localization Setter
Sun, Apr 22nd 2012 12:45a   Sven Hasselbach
I have submitted some XSnippets for the XSnippets-Contest. This is the first one, the XPages Localization Setter: The Snippet allows to change the language settings of a XPage “On-The-Fly”, including the browser language used, the dojo settings, the ressource files etc. package ch.hasselba.xpages.jsf.core; import javax.faces.context.FacesContext; import javax.faces.application.Application; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.even [read] Keywords: ibm xpages application dojo java javascript openntf xml

LotusScript in XPages (3): Quick-n-Dirty-Aktivierung
Tue, Apr 10th 2012 4:09a   Sven Hasselbach
LotusScript in XPages Dies ist der dritte Teil des Artikels “LotusScript in XPages”. Der erste Teil befindet sich hier, der zweite Teil hier. Die Quick-n-Dirty-Aktivierung Damit die BindingFactory verwendet werden kann, müsste eigentlich ein Plugin erstellt werden, doch es gibt auch eine “Abkürzung”, denn die Factory kann auch über einen angepassten ViewHandler in XPages verwendet werden. Dies ist beim Testen / Entwickeln eine sehr praktische Angelegenheit, da sich d [read] Keywords: ibm lotusscript xpages application xml

LotusScript in XPages (2): LotusScript-Wrapper
Sun, Apr 8th 2012 2:58p   Sven Hasselbach
LotusScript in XPages Dies ist der zweite Teil des Artikels “LotusScript in XPages”. Der erste Teil befindet sich hier. Der LotusScript-Wrapper Um dynamischen LotusScript-Code auszuführen, bietet sich die Execute()-Funktion an: Mit der Funktion lässt sich fast der gesamte Umfang der LotusScript-eigenen Backendfunktionalität nutzen, also auch Scriptlibraries einbinden uvm. Leider steht diese Methode jedoch nicht  in Java direkt zur Verfügung (im Gegensatz zur Session.evaluate() [read] Keywords: agent domino lotus lotusscript xpages database java

LotusScript in XPages (1): Basics
Sat, Apr 7th 2012 8:44a   Sven Hasselbach
LotusScript in XPages Wäre es nicht schön, wenn man in XPages direkt mit Lotus Script arbeiten könnte? Wenn es einen Weg gäbe, mit der sich Lotus Script-Code direkt in der XPage einbetten liesse, und wie folgt zu verwenden wäre? Prinzipiell ist das möglich, aber der hier dargestellte Weg ist eher als Workaround anzusehen und wird das Alpha-Stadium wohl eher nicht verlassen. Aber es lässt sich anhand dieser Anleitung zeigen, wie man XPages flexibel erweitern und weitere Interpreter-Sprach [read] Keywords: ibm lotus lotusscript xpages application javascript xml

ObjectDataSource: Kleines “How To”
Sun, Apr 1st 2012 5:33a   Sven Hasselbach
Mit der Extension Library bzw. dem Upgrade Pack 1 ist für XPages eine neue Datasource-Komponente hinzugekommen, die ObjectDataSource. Diese Datasource kann wie die Standard-Datasources für View und Dokument ebenfalls an den verschiedensten Elementen einer XPage angehangen werden, d.h. sowohl an die UIViewRoot der XPage, als auch in Custom Controls, Repeat Controls oder sonstigen Elementen, die eine DataSource verwenden. Grundlegend gilt für ObjectDataSources, das sie beliebige Java-Objekte be [read] Keywords: xpages interface java javascript oracle xml

Bug: facesContext.getRenderResponse()
Sun, Mar 11th 2012 1:28p   Sven Hasselbach
Eigentlich sollte die Methode  getRenderResponse() true zurück liefern, wenn der Code in der Render Response-Phase ausgeführt wird, doch leider ist die Funktion nicht korrekt implementiert. So liefert die Funktion bei einem normalen Seitenaufruf falsche Ergebnisse, bei einem Partial Refresh hingegen funktioniert sie jedoch wie sie soll. Zur Erläuterung verwende ich folgende XPage:                                                  Öffnet man [read] Keywords: ibm bug javascript oracle xml

Quick-n-Dirty: Id der UIViewRoot ändern
Sun, Mar 11th 2012 1:13p   Sven Hasselbach
Setzt man dem UIViewRoot-Element eine Id… … ändert sich der generierte HTML-Code entsprechend ab: ... ... Auch kann man auf die UIViewRoot nun mittels der Id zugreifen, ein getComponent(“abc”) liefert die Komponente zurück. [read] Keywords: ibm xml

Quick-n-Dirty: SSJS Code vor BeforPageLoad ausführen
Sun, Mar 11th 2012 12:10p   Sven Hasselbach
Um SSJS Code vor dem “BeforePageLoad“-Event auszuführen, kann der Code einfach in eine DataContext-Variable gepackt werden. Die Berechnung der DataContext-Variable sollte auf “ComputeOnPageLoad” gesetzt sein, dann wird der Code auch nur einmal ausgeführt. Als Rückgabewert sollte null verwendet werden, dann verschwindet Sie aus dem Speicher und die Variable ist auch nicht via SSJS referenzierbar. Natürlich bleiben die im SSJS-Code definierten Variablen Ereignisübergre [read] Keywords: ibm javascript xml

Performance-Killer in der XPage
Mon, Feb 20th 2012 3:51a   Sven Hasselbach
Dank einer Frage von Ulrich Krause im XPages Developer Forum wurde ein Thema “wiederbelebt”, das mir vor einiger Zeit in einem Projekt aufgefallen ist und sich als wahre Bremse bei XPages-Applikationen herausstellt: Sämtliche Datenquellen (DataContext-Variablen, Repeat Controls, usw.) werden bei jedem Partial Refresh neu berechnet, auch wenn sie nicht das Ziel (bzw. ein Kind-Element des Ziels) des Refreshs sind. Ich nutze als Beispiel hierfür die von Ulrich Krause gepostete Beispie [read] Keywords: ibm ldd lotus xpages ajax java javascript xml

Bug: Invalider Java-Code durch berechnete Tag-Attribute
Fri, Feb 17th 2012 8:40a   Sven Hasselbach
António A Ramos hat einen interessanten Bug entdeckt: Werden die Attribute eines HTML-Tags im Designer berechnet, wird die XPage nicht mehr verarbeitet und ein Internal Server Error tritt auf So wird der folgende HTML-Tag ordnungsgemäß gerendert… … jedoch ist eine Berechung nicht zulässig: Der Grund ist dabei die Umsetzung in den Java-Code, denn dieser verwendet das Attribute ungeprüft als Variablenname – was natürlich fehl schlagen muss. So sieht der generierte [read] Keywords: ibm ldd lotus R6 xpages bug java javascript server xml

“Compute Dynamically” Vs. “Compute on Page Load”
Sat, Feb 11th 2012 12:29p   Sven Hasselbach
Der Artikel von Mark Roden über den Mix von ${} und #{} zur gleichen Zeit brachte mich dazu, mich noch einmal ausführlich mit dem Thema “Compute Dynamically” und “Compute on Page Load” zu befassen, denn der hervorragende Artikel von Paul Withers erläutert zwar die grundsätzlichen Unterschiede zwischen den beiden Berechnungsvarianten, allerdings gibt es noch ein paar Ungereimtheiten. Um einen Überblick über die Unterschiede bei der Verwendung aufzuzeigen, sind hier z [read] Keywords: xpages bug java javascript

“It’s not a feature, it’s a bug!”
Fri, Feb 10th 2012 2:50a   Sven Hasselbach
In meinem letzten Beitrag habe ich einen Bug entdeckt, den ich an dieser Stelle noch etwas ausführlicher darstellen möchte, denn es handelt sich hierbei nicht um ein normales Verhalten von JSF, sondern schlichtweg um einen Bug während der Transformation nach Java. Im Vorfeld möchte ich jedoch auf einen sehr guten Artikel von Paul Withers aufmerksam machen, in dem ausführlich dargestellt wird, wie es sein müsste: http://www.intec.co.uk/xpages-bindings-when-runs-at-page-load/ Der Einfachheit [read] Keywords: odf R8 xpages bug java javascript

Bug: ${} in Output Script-Blöcken
Wed, Feb 8th 2012 5:48a   Sven Hasselbach
Bei der Verwendung eines Output Scripts muss darauf geachtet werden, dass kein Code verwendet wird, der eine Zeichenfolge beinhaltet, die eine “Compute On Load“-ähnliche Syntax hat: Ein Bug sorgt dafür, das bei der Verwendung von ${} (mit oder ohne Inhalt) einiges durcheinander gerät, und der komplette SSJS-Code falsch verarbeitet wird. So gibt folgender Code wie zu erwarten eine Messagebox mit der Id des Labels aus…                              [read] Keywords: ibm bug xml

Wed, Feb 1st 2012 5:05a   Sven Hasselbach
Will man auf die DataContext-Variablen einer XPage zugreifen, gibt es die Möglichkeit, die Methode getDataContexts() zu verwenden, die für jede UIComponent existiert. Die Methode liefert eine java.util.List zurück, die sich z.B. in einen Array verwandeln lässt, um auf die einzelnen Mitglieder zu zugreifen. Die Mitglieder wiederum sind vom Typ com.ibm.xsp.model.DataContext, mit getVars() lässt sich auf den Inhalt der jeweiligen Variable zugreifen. Hier ein Beispiel: view.getDa [read] Keywords: ibm java javascript xml

Security: Domino Server Backdoor (2)
Thu, Jan 19th 2012 8:11a   Sven Hasselbach
Aus einer XPages-Applikation lässt sich der XSP Command Manager (das zugrundeliegende OSGi Framework) fernsteuern. Das Kommando entspricht dem Befehl tell http xsp auf der Domino Serverkonsole, nur dass hierfür kein Serverkonsolenzugriff benötigt wird. Mit Hilfe der folgenden XPage lassen sich beliebige OSGi-Kommandos absetzen, also z.B. Prozesse starten, Bundles installieren (egal von welcher Quelle, auch aus dem Internet) und vieles mehr.                          [read] Keywords: domino ibm xpages java javascript security server xml

Security: Fernsteuerbare DocumentDataSources
Thu, Jan 12th 2012 1:22p   Sven Hasselbach
Analog zu den ViewDataSources lassen sich auch DocumentDataSources über die Adresszeile des Browsers manipulieren: Der URL-Parameter databaseName ermöglicht hierbei die Steuerung der zugrundliegenden Datenbank, und überschreibt einen eventuell in der XPage hinterlegten Wert.                                                                     Wird diese XPage mit dem Parameter databaseName=DB2.nsf aufgerufen und abgeschickt [read] Keywords: ibm db2 security xml

Quick-n-Dirty: Locale setzen (2)
Thu, Jan 12th 2012 10:12a   Sven Hasselbach
Wie die Locale-Einstellung für eine einzelne Xpage gesetzt wird, ist hier beschrieben. Um die Einstellung jedoch Applikationsweit zu setzen, kann dies durch einen eigenen ViewHandler umgesetzt werden. Dazu benötigt man eine eigene Java-Klasse, die die bestehende Methode calculateLocale überschreibt: package ch.hasselba.xpages.debug; import java.util.Locale; import javax.faces.context.FacesContext; import javax.faces.application.ViewHandler; public class ViewHandlerSH extends com.ibm.xsp.ap [read] Keywords: ibm xpages application java oracle xml

Security: Domino Server Backdoor
Sat, Jan 7th 2012 4:12p   Sven Hasselbach
Mit XPages lässt sich ein Domino Server auf einfachste Weise lahm legen, da man über die Java Runtime beliebige Threads starten kann. Ein kleiner Button startet z.B. Notepad auf einem Windows Domino Server: Bei jedem Klick wird auf dem Domino Server einmal Notepad gestartet. Eine kleine Schleife, und auch ein großzügig dimensionierter Server geht in die Knie. Richtig übel wird es allerdings, wenn dieser Button geklickt wird: ACHTUNG! NICHT AUF PRODUKTIVEN SYSTEMEN AUSFÜHREN! [read] Keywords: domino notes nsd R4 xpages java javascript security server

Quick-n-Dirty: Locale setzen
Thu, Jan 5th 2012 5:12a   Sven Hasselbach
Um die Locale-Einstellung einer XPage programmatisch zu beeinflussen, kann die Methode setLocaleString bzw. setLocale des context-Objektes verwendet werden.  Damit die Änderungen übernommen wird, muss die Einstellung im BeforePageLoad gesetzt werden. So ändert ein… context.setLocaleString("zh-tw") … bzw. ein … context.setLocale(java.util.Locale.TAIWAN) …die Spracheinstellungen der generierten XPage. Sowohl das lang-Attribute der HTML-Seite als die Dojo-Konfiguration [read] Keywords: R6 dojo java javascript oracle

Security: Fernsteuerbare ViewDataSources
Fri, Dec 30th 2011 5:12a   Sven Hasselbach
Ist bei einer Datenbank die Option “Don’t allow URL open” gesetzt, ist sie nicht mehr im Web erreichbar. Mit den URL-Parametern databaseName und viewName lässt sich in Verbindung mit einer ViewDatasource dieser Schutzmechanismus jedoch aushebeln, und könnte ein Problem darstellen, wenn sich nur auf diese Option verlassen wurde. Als Beispiel dient hier eine lokales NAB, dass zu Demonstrationszwecken eine offene ACL hat (Default = Manager), bei dem die genannte Option jedoch ak [read] Keywords: acl ibm xpages javascript security xml

Domino Datasources On-the-Fly (3): ValueBinding & MethodBinding
Thu, Dec 29th 2011 6:12a   Sven Hasselbach
Das ist der dritte Teil der Serie “Domino Datasources On-the-Fly”. Der zweite Teil findet sich hier. Will man eine Wertezuweisung berechnen lassen, muss ein ValueBinding erstellt werden. Damit lässt sich dann z.B. der Formname eines DominoDocumentData-Objektes berechnen (zugegebenermaßen ein kleinwenig sinnlos, da man dies im Code sowieso erledigen könnte…). Hierfür existiert die Methode createValueBinding() der Application-Klasse, mit der ein neues ValueBinding-Objekt instanziert [read] Keywords: domino ibm xpages application javascript xml

Domino Datasources On-the-Fly (2): DominoDataView
Tue, Dec 27th 2011 8:11a   Sven Hasselbach
Das ist der zweite Teil der Serie “Domino Datasources On-the-Fly”. Der erste Teil findet sich hier. Views lassen sich ebenfalls programmatisch erstellen, allerdings muss mindestens der Name der Ansicht angegeben sein (und ausserdem muss die Ansicht existieren): var data = new com.ibm.xsp.model.domino.DominoViewData(); data.setVar("view1"); data.setViewName("All"); view.addData(data); Hier eine Beispiel-Implementierung in eine XPage (in der Datenbank muss die Ansicht “All [read] Keywords: domino ibm javascript xml

Domino Datasources On-the-Fly (1): Basics
Fri, Dec 23rd 2011 9:11a   Sven Hasselbach
Um eine Datasource On-the-Fly mittels SSJS zu erstellen, muss zum Einen ein neues Datasource-Objekt instanziert werden, zum Anderen die neue Datenquelle der XPage bekannt gegeben werden. Mit dem folgenden Code wird eine neue Document Datasource namens document1 erstellt und dann dem UIViewRoot-Element bekannt gemacht: var data = new com.ibm.xsp.model.domino.DominoDocumentData(); data.setVar("document1"); view.addData(data); Direkt nach der Anlage lässt sich die Datenquelle leider noch nicht [read] Keywords: domino ibm javascript xml

Quick-n-Dirty: Die HTTP-Session des Domino-Servers
Wed, Dec 14th 2011 2:11p   Sven Hasselbach
Um mit SSJS auf die HTTP-Session eines Domino-Servers zuzugreifen, ist nicht viel Code nötig: var exCon = facesContext.getExternalContext(); var sess = exCon.getRequest().getSession(); Dadurch lassen sich folgende Informationen ermitteln: getAttribute(Name:String) Liefert gebundenes Objekt des Attributes “Name” zurück getAttributeNames() Liefert die Namen aller Attribute als java.util.Enumeration zurück. getCreationTime() Zeit der Session-Erstellung, Millisekunden seit 1.1.1 [read] Keywords: domino java

Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition