Tag Archives: Domino - Page 2

Part 2 of Partial Refresh in Notes Forms

I couldn’t actually accept myself defeated in the battle to get partial refresh into old school Notes applications. And after a second look at my code I found a way, so I rewrote the javascript library to be a javascript object class so all calls are made inside the class. So now partial refresh of the entire form tag is the standard way of refresh but you can also narrow the refresh to everything inside a div or a table sell if you want to. And Serverside refreshes from a QuerySave agent also works.

So what you need to do is to add the AjaxCall scriptlibrary to your database.

Call the function PartialDomino.onloadAjax() in your onload event

Now all refresh events on the form will be handles as partial refresh.

If you want to also add clicks from a button, give the button a id and add that id using PartialDomino.addPartialRefreshId(“refresh”,””)

The next time the button is clicked a partial refresh is done.

If you would have added a second id to the function, only the element with that id will be replaced after the refresh.

Download the database and see the working example

disk

PartialDominov2.zip

Holiday Hack: Get some XPage power in old Notes apps

UPDATE: Post with fully working example with serverside redirects working

One of the great things with XPages is the partial refresh that help you to update information inside the page without a full reload of the page. Well that is not possible with older notes applications because it does a full roundtrip to the server each time we change something. But we can update the screen without the users notice it with ajax. What I did was create a copy of the main js function that Domino uses _doClick and replace that with my own copy of that function in onload.

function onloadAjax(){

  window._doClickNew=window._doClick

  window._doClick=window.newDoClick

}

I store the original function within _doClickNew that is the great thing in this case with javascript. Everything is an object including functions and I can place myself before the original function. My function will now be called when something happens on the Domino form. There is two types of events on a old school Domino form. There is a refresh post and a full post, the script detects if you are trying to do a refresh post and convert that into a ajax request. You can also add entries to an Javascript array PartialRefreshArray by pushing new entries PartialRefreshArray.push(“mybutton”) if you then add a button to the form with the id mybutton it will also be ajax refreshed.

But there are some down sides to this functionality, we can’t use server side redirects. When the form is posted the referer is used when returning data, and because we have ajax refreshed the form the url isn’t updated correctly if we have created the document using the following url

server/database/form?openform

What we need to do is to create the document before we open it the first time and load the document using

server/database/view/UNID?editDocument

If that is used the code can imitate partial refresh, but remember no server side redirects can be used, webquerysave agent runs but not the redirect, so if you want to move away from the form you need to use client side JS.

I’ve created a simple database to show the functionality that you can download here 

disk

Conclusion, the partial refresh behaviour can be added but then you need to hack any redirects done using agents and you need to pre create the document and have a scheduled agent to delete the forms not saved.

This is only an hack example not any production code, and may stop working if IBM/HCL changes anything.

 

Setting up a sFTP server to be used with an existing Domino SSL certificate

With the new way of creating SSL certs for Domino a new opportunity occurred to me and actually it worked great. Because we create the certificates using OpenSSL the generated Key and certificate can actually be used on the same server to setup a FTPS server. Saidly because the Domino FTP server on OpenNTF.org doesn’t support FTPS I had to use the FileZilla server the setup was super simple.

Run the setup

go into settings and enable FTP over SSL select your .Key file and your certificate file that you got back from your certifier. Also check the other option to force all connections to the server to be FTPS.

FileZilla Server Settings

And now you have a FTPS server that can deliver external content to you Domino server. The last thing you need to setup is the users and groups that should be able to connect to the server.

Update: Paul Farris commented that this is an SSL based FTP server not an SSH based so the real name should be FTPS not sFTP.

Maximum file upload size in HCL Domino all the places to edit

If you ever wanted to increase the file upload size in Domino you have probably seen that there are several places to update depending on the configuration. I was increasing this on a server this week and missed one of the places and couldn’t understand where I missed, Per-Henrik Lausten pointed me what I missed. So I though I would write a post about this I might help someone else, or help me the next time I forget.

Open up the Server document and go to the “Internet Protocols” tab and the “HTTP” tab

FileUpload1

 

 

 

 

 

 

At the bottom right corner, to the “HTTP Protocol Limits” Section

FileUpload2

 

 

 

 

 

 

 

And change the “Maximum size of request” to the size you want to increase to

Now move to the basic tab and check if the server is using “Internet Sites”

FileUpload3

 

 

 

 

 

 

 

 

If your server doesn’t load from “Internet sites” you need to open the “Internet protocols” tab again

and follow the same instruction as in “Internet Site” document.

in other case close the server document and open up the view “Server\Internet Sites”

FileUpload4

 

 

 

 

 

 

 

 

 

Open up the corresponding Internet Sites that you want to change or open all of them and change if you want the same size on everybody. On the “Domino Web Engine” tab

FileUpload5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

On the “POST Data” section change the Max post size to the new maximum file size you want to have.

If you are using an old Domino application you are done now. After reloading the HTTP task on the server.

But if you application is an XPage application there is another place you need to control the file size, and that is in Application Configurations and xsp.properties file in you database and the File Upload Option.

Or if you want to add it globally add it to the xsp.properties file in the Domino\Data\Properties folder in xsp.properties.

FileUpload6

 

 

 

 

If you want to increase the size for iNotes there is a third place that you might need to increase and that is in the Servers\Configurations document for the server. Click on the “iNotes” tab and update the “Mamimum attachment size” and save the document. Restart the http task on the server to make the changes get affect.

FileUpload7

 

 

 

 

 

 

 

 

 

 

 

If you got any problems some Domino configuration or got help from this post, make a comment.

Long live Domino just give us TLS 1.3 support NOW!!

Setup a Free Git server with Domino Credentials in a few minutes

Today I’m going to show you hav to setup you own internal Free Git server in five minutes

Make sure that you have java version 7 installed in you windows server. JRE or JDK any version works. If you don’t have one goto java.com and install the a java jre.

Goto the java download page scroll down to the bottom of the page and download the JCE

Java_JCE

Open up the downloaded zip file and copy the 2 selected files

To the folder lib\security below your java installation folder in my case it was

C:\Program Files\Java\jre7\lib\security you might need to replace existing files nothing to worry about.

This is needed to be able to create the certificates later.

Next step is to  gitblit.com wher your download the Go Git Blit Server for Windows or if you are using Linux or Macosx use that version.

GitBlit

Unzip the zip file in the root to a folder called gitblit or a suitable sub folder, if you change the folder you might need to change url:s in the .cmd files.

Configure GitBlit

We are now going to configure gitblit to use LDAP as authentication method

Open up the file gitblit.properties in the data folder, search for the keyword realm.userService edit this line so the line should look like this realm.userService = com.gitblit.LdapUserService

Setup the connection to the LDAP server

realm.ldap.server=ldap://localhost change the row if your LDAP server isn’t on localhost remember if you want to connect to a domino server and it’s hosted on a windows machine that has AD LDAP on it you need to change the port for the Domino LDAP service.

The syntax if you want to change ip or port is like this ldap://192.168.10.10:399

You also need to change the login user to be able to use the domino LDAP Service

realm.ldap.username = LDAP Manager

realm.ldap.password = your password

To a Domino user and password

Clear the accountBase so it will search all Nodes

realm.ldap.accountBase=

Change the accountPattern to

realm.ldap.accountPattern = (&(objectClass=person)(cn=${username}))

Empty the groupBase to search all nodes for groupsrealm.ldap.groupBase =

And the groupMemberPattern to find groups

realm.ldap.groupMemberPattern = (&(objectClass=group)(member=${dn}))

realm.ldap.admins can be edited to add a admin group from LDAP

change the row realm.ldap.email from email to mail

And the row realm.ldap.uid also to mail

Important last step, search the file for localhost and remove that otherwise gitblit will only operate on localhost and you can access it from another machine

Save the file

Generate SSL Certificate

In the Gitblit folder in my case c:\GitBlit there is a cmd file called authority.cmd (if you have another url you might need to modify the file)

start authority.cmd add the information about your certificate

Write the password for your keystore, write gitblit if you don’t want that password you need to edit the gitblit config file so the password match.

The keystore is generated and the cert admin is opened

Close the Window

Start the Git Blit Server using the gitblit.cmd the server will now start in the window.

Your Git server should be up and running now. Let’s access it thru a browser.

Write https://servername or ipadress or localhost and end the adress with :8443

but if you want to use http instead you need to edit the gitblit.properties and change the row

server.httpPort =0 to have the port for the http server i.e. server.httpPort = 8080

The GitBlit interface will load.

Try to login using your Domino credentials

When you have logged in, logout again and login using the standard admin user

username: admin password: admin

and assign yourself as an administrator and change the password of the default admin

Login with your user again

Now your ready to create your first repository

Next step is to connect your git client to the repository. Some clients like sourcetree needs a special setup to accept ssl that is created using a self cert. But that is for the next post.

HTTP Server is waiting for threads to finish: the wait is over part 2

If you did read my post yesterday about how to break long running requests on the Domino server if not you can find it here The wait is over part 1
S
ven Hasselbach commented that this didn’t work for him and yes he is probably right because I suspect that Sven was trying a long running XPage and yes you can’t break them using Restart Task Http but I have a solution/workaround but that requires you to implement a failsafe into your long running code.
If you add this inside your long running loop

if(applicationScope.get(“BreakAllCode”)==true){
  break;
}

And create an Admin Failsafe XPage with a “Break it All” button with the code

applicationScope.put(“BreakAllCode”,true)

And a second button called “Reset” with the code

applicationScope.remove(“BreakAllCode”)

To bring back the application to a normal state.

If you then open up the “Failsafe” XPage if your code has gone wild and click the button you can quit the code that has gone wild.

 

10 Developer Things I like IBM to show at Connect 2014

Exciting times Connect 2014 is around the corner unfortunately, I’m not attending in person but I will follow it closely as always.

These are the top 10 things I would like to see IBM show at connect

  • Update of Eclipse version in Domino Designer to get better coding environment
  • DOTS Designer Editor, an integrated editor in Domino Designer for DOTS tasklets. So they are as easy to create as an XPage/Agent.
  • Webdav support for attachment editing both for iNotes and Custom applications so users can edit and save files without download and upload attachments
  • Closer integration with Source Control, we want to do automated builds, and better fine tuning of DXL exports (Not all Binary or none binary)
  • New version of One UI that uses responsive design
  • Dojo or JQuery as backend framework for all controls
  • Editor for Faces-config to setup beans and all other things that needs to go in there
  • Social Business Toolkit upgrade for easier use of internet services, twitter, facebook, dropbox and more services. SBT has to much configuring today, with end points and configuring lots of files. This must be easier to get the wider use of this. 
  • HTML5 Websocket support 
  • Better richtext editing experience for the endusers To get a more smoother transition from old Notes Applications to XPage Applications

What thing do you wish??

Update: What is the next xpagedeveloper utility?

With my two client utilities I have recieved several email with greatful users. I think it’s time to expand the family of utilities but what should be the next one?

What do you need? Have any ideas ? Write a comment and let me know.

Update: I have an interesting developer utility in development that will probably be released in the next couple of weeks. 

Setting up your Domino server to prevent password attacks

There as been some writing around attacks against WordPress based sites and a lot of them has been taken over and malicious code was injected on these sites. How was most of these attacks done? Well I think that this was probably done thru so called brute force attacks. The hacker have a software that is posting in attempts on the login page and they know that the default admin account is “admin” on WordPress, alot of sites haven’t removed this account. This type of Brute Force attacks can be done against your Domino environment also. But there are several ways to prevent it and one way is “Password Lockout”. It’s very easy to implement on your server so if you haven’t I suggest you do.

This is how you add this to your Domino Site.

In your Name and address book for the server goto Configurations

Snap169 

Open up the corresponding document for your server, Some times there is only a entry like thisSnap171

Then I take a copy of this document and open it you need to change to it affects you server you need to uncheck the “Use these settings as the default . . . .” checkbox

 Snap173

When this is done the new field where you specify your Server name is revealed write the name of you server.

Snap176

Go to the second tab “Security”

Snap179

Change “Enforce Internet Password Lockout” to Yes and a checkbox to log “Failures” and save the configuration and restart the http service on the server the “Password Lockout” database (inetlockout.nsf) is created the first time a password failure occurs so I suggest your try with your own login so the database is created and you can adjust the acl as you like it.

UPDATE: make your SMTP server from leaking passwords

Check out this guide on disable authentication on smtp turn off smtp authentication

Now your Domino sever a bit more secure.

Adding a dojo calendar control to traditional Notes date fields

When web enabling old Domino forms date fields has never been fun. users setting the wrong format, and the save breaks the form giving a error 500. There has been alot of dhtml calendar pickers that has been used some better and some worse of handling other browses than IE.  We all have these applications that is  very large and that you don’t can convert directly to XPages, then adding dojo to your old forms can help you.

 What do you need to do to get a dojo calendar control to work with a old date field in a form, not much actually. Dojo is really good of helping you to do this move.

First you have to decide if you want to host the dojo toolkit locally or thru i.e Google CDN.

It’s just the url:s in my example that you need to change if you want to host the dojo files in the html directory on your Domino server.

Add the following with passthru html to a subform

<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js"
djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
dojo.require("dijit.form.DateTextBox");
</script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.8/dijit/themes/tundra/tundra.css"/>

Update:
In 8.5.3 you could use this internal url to dojo instead of the CDN
/xsp/.ibmxspres/dojoroot-1.6.1/dojo/dojo.js 

When this is done you need to add this subform to your form.

You also need to add the theme class to the body attribute section of the form. 

“class=\”tundra\”

 

On your date fields on the form add the following to the HTML attributes to the field

“dojoType=\”dijit.form.DateTextBox\” ” 

And your done, add the last row to all your date fields to get a calendar control in all of them.

This calendar control will use browser locale when deciding how the date should be displayed.

Or you can like I like to do set a pattern that matches the date format on the server by changing the dojo type we specified on the field to

“dojoType=\”dijit.form.DateTextBox\” constraints={datePattern:’yy-MM-dd’}”

The Dojo series will continue with more controls both in traditional Notes and in XPages.

Enjoy