Document Locking in XPages

People editing documents at the same time can be a big pain for the developer resulting in unwanted problems in an deployed application. To handle this problem I created a managed bean DocLock to handle the problem. The managed bean stores the username and an id each time the users edits a document. If another user tries to edit the document, you can block the user from entering edit mode. 

To implement the managed bean in your own database is very simple, Copy the java class and add the managed bean setup into faces-config.xml ( check the supplied readme file)

The project is released on Openntf –> Link

Snap83

Enjoy getting less document conflicts.

Designer quick tip – Database compare

Compare databases for differences

If you have two versions of an application and have missed to document what the differences between them were. Here’s how you could find out how.

Add the two versions to Domino Designer. Goto package explorer, select the two databases and right click.Database Compare DDE

And when you compare the databases, you will get a structure where you can see what’s different.

database compare

There are folders that you can skip to look at like the local folder. If we now open up the xpage folder we will in this can find that an xpage called document is changed.

Snap81

The differences is highlighted with grey, I have also added a red line below them in this example. the buttons at the top also makes is simple to add the changes between the databases displayed. Or if you only want to document the changes.

There is not difference between Notes 9 and 8.5.3 this works the same in both versions.

Installing Raspberry pi with Raspbmc as an media center

There is a great new mini computer called Raspberry pi developed as a experimental/educational computer that has blown away in sales with more than 1 000 000 units sold, Google donated 15000 unit for UK schools recently.  In the autumn of 2012 a new model was released with 512mb memory making this a great product to build a media center on. My installation is based on Raspbmc a ready to run distro based on Debian and XMBC. What do you need besides the Raspberry pi 512mb model and a microsub powersupply (This need to be a high power model).

You also need a SD card, I would recommend a 16GB Class 10 card with 30mb/s read speed. This will make your installation and a fast boot time.

When you have all things time to get started.

Download the windows installer for Raspbmc

raspbmcinstaller

Accept the license agreement and select you SDCard in the listbox above, make sure you select right device because the installer will wipe the device.

When this is done, Add your SD Card to the Raspberry, ethernet cable with internet access and hdmi or RCA video. Time to boot up for the first time.

Installig RaspBMC

And after 5-15 minutes the XMB will boot up

raspbmc_start

Add your video folder by clicking on Files and add a video source and adding  what scaper you want to use.

Enjoy, your new media center.

Backup and Restore your Domino Designer settings

There is alot of settings in the designer client, displaying linenumbers in the Lotusscript editor, different settings in the editors. And when you have done all these settings you never remember what you have done when everything is working like you want it to do. A backup of you settings would be great but how to you do this?

(My screenshoots are from Designer 9 but this works in older versions also )

Quite simple actually, open up package explorer right click in panel and select Export

Import Export

Open General and select Preferences and press Next

Saving Preferences

Export All, Browse where you want to save you backup.

What to export

And press finish, now the backup is done.

If you want to Restore the backup later if you have a new installation or restore everything after you have done some modifications.

Select Import instead of Export at the first step

Snap61a

Select General and Preferences in the next dialog and press Next

Snap68

Browse for you backup file, select import all and press Finish

Snap67

You have now restored you settings from an backup file.

The registry change for settings in Notes 9

If you have tried out the public Beta of Notes 9, you might have noticed that IBM has removed Lotus in the registry also. Earlier versions of Notes are stored in HKEY_CURRENT_USER\Software\Lotus\Notes but
Notes 9 is stored HKEY_CURRENT_USER\Software\IBM\Notes. This means that all software that uses the registry to find the client directories needs to be updated, as with my Utilities that is updated to work with a Notes 9 installation.

If you have a software that doesn’t work with Notes 9 there is a easy way to make it work

use this commandline to export the keys from HKEY_CURRENT_USER\Software\IBM\Notes

regedit /e ibm.reg HKEY_CURRENT_USER\Software\IBM\Notes

a file called ibm.reg will be created in the directory where you currently are write

Notepad.exe ibm.reg

Change all entries where the line starts with [ change IBM to Lotus

From: [HKEY_CURRENT_USER\Software\IBM\Notes]

To: [HKEY_CURRENT_USER\Software\Lotus\Notes]

when you have saved the file, double click on the file or run

Regedit.exe ibm.reg

Get the designer client 8.5 and 9 to run smoother

Designer memory configurator version 2.0 is released. This version has some enhancements to make your life easier. Support for Notes 9 so you can configure the Notes 9 designer client to run even faster.

I have also added so you can control the program using the commandline to get the max potential.

Check out the extras Group where the Designer Memory Configurator is installed. With this command line switch. you can easily add it to the startup of you computer and never have to care about the memory configuration resetting because of installation of Fixpacks or reinstalls.

Happy Coding

Download the new version here –> Designer memory configurator

Notes Client Killer 3.0 released

I have released a new version of the Notes Client Killer, this new version has support for

Notes 9 it also have a new feature Forced Mode, this will kill the tasks for the Notes client like the old
KillNotes application does. I have also repackaged the software so now it comes with an installer to make the installation process better and primary when you want to use it again.

Enjoy and hope it helps you when you are in trouble.

Download Notes Client Killer

What a year for XPages

The year started early with the release of Upgradepack 1 for domino.
We have got 3 fixpacks for domino and 6 releases of the extensionlibrary.
And so much knowledge published as blog posts/applications/custom controls/code snippets.
What a year!
I think that 2013 will bring alot of good stuff to. With the release of Domino 9.0 and hopefully Upgradepack 2.

Happy New Year to everybody!

IBM Champion I’m honored

I’m one of the lucky ones that have been awarded IBM Champion 2013 for Collaboration Solutions.

All the Champions 2013

Thanks again IBM and congratulations to everybody else who got awarded. 

XPages SSJS will run forever if you let it

If you add some code behind a button, and a user clicks that button. This code will run until it’s finished no matter what you do.

try{
var LoopBreak=0;var x=0
var thing=1
var now=@Text(@Now())
var nownow=""
while(thing==1){
LoopBreak++
print(now+":"+LoopBreak)
for(x=0;x<10000;x++){ nownow=@Text(@Now()) } if(LoopBreak>30){
break;
}
}
}catch(e){
print("Error:"+e.toString())
}
print("Done:"+now)

If you place the code above behind a button on an XPage.

(Of couse at your own risk, and not on a production server)

Open the XPage in a webbrowser, also open up so you can watch the server console in realtime.

Click on the button and close the browser window directly afterwards, and watch the server console.

The code will continue to run until it’s done, imagine what will happen if you remove the line LoopBreak++  you will get a infinite loop.

And the CPU of your server will boost up to 100% and you will not be able to stop your Domino server with out killing it.

So my tip to you is to always have a fail safe, a loop breaker for your loops.