Eclipse Plugins – reminder to myself

If you’re using a images in eclipse plugins: DO USE THE RESOURCE MANAGER !

Posted in Uncategorized

Fiddling with gradle

I’m getting more and more into the Java World at the moment. Switching from pure Domino to pure Java. Outside of Domino, there’s a lot about manageing dependencies. The freedom of choice is paid by work to beat different runtimes.
Looking for a decent tool to help managing dependencies I came across Ant, Maven and Gradle.
Ant I new from the past. It’s ok but seems to be a lot of code to write and it’s XML…
Maven? Seems that I’m not smart enough.
I was not able to setup a working multi project setup without installing my sub projects in a repository. And it’s XML too.
Gradle, the youngest among these three, groovy based. After reading through some tutorials, and combing through stackoverflow I was able to setup my multi-project build,
with integratopm into my eclipse environment.

Even a Vaadin client is compiling with the right plugin. So I was not forced to use the Vaadin eclipse plugin at all. One thing I was not happy, the Vaadin plugin compiles some JavaDoc and Sources into my final EAR.

Step 1: Remove the JavaDoc and Sources from the deployment descriptor

deploymentDescriptor{
....
withXml {
def javaDocNode = asNode().module.find { it.ejb.text().contains('javadoc.jar') }
if (javaDocNode) {
asNode().remove( javaDocNode )
}
def sourceNode = asNode().module.find{it.ejb.text().contains('sources.jar') }
if (sourceNode) {
asNode().remove(sourceNode)
}
}
}

 

Step 2: Removing the actual Jar’s from the EAR

This page  helped me creating the following block

import org.apache.tools.ant.taskdefs.condition.Os
task removeJars (dependsOn:'ear'){
description 'Entferne unnötige Source und JavaDoc Jars'

doLast {
	if (Os.isFamily(Os.FAMILY_UNIX)){
	println "Entferne unnötige Source und JavaDoc Jars"
	 exec {
  		executable "zip"
  		args "-d", "build/libs/${project.archivesBaseName}-${project.version}.ear", "*-${project.version}-sources.jar"
 	 }
     exec {
     	executable "zip"
  		args "-d", "build/libs/${project.archivesBaseName}-${project.version}.ear", "*-${project.version}-javadoc.jar"
 	}
 	}
 	else
 	{
 		println "get Linux!"
 	}
 	}
}

 

Now I can build my EAR by simply calling gradle assemble removeJars
 

Posted in Connections Tagged with: , ,

Connections Communites – Default Membership – Default Following

A long time ago, on a server far, far away….
There was this Connections Community everybody had to be a member, as there would be most important news posted there. And though shall not only be a member of that community no though shall follow it wherever the community may roam.

I accepted the quest and prepared for a long journey through the internet. From the depth of the IBM Infocenter and other resources I brought back an Assembly Line and some shell scripts.
And all was fine, quest completed, I thought. Creeping back to my cave to find some rest.

Short after I finished the quest I heard a cry. It was demanded to add another community which everybody has to be part of. And some communities you should not be able to not follow or even leave.

My crystal ball revealed that there will be more changes and new communities in the future.
This led me to the decision to throw away Assembly lines and scripts and rebuild the processes with a proper UI.
Soon I’ll be able to delegate that work to my principals and find some rest in my beloved cave….

Posted in Connections

OpenNTF JUnit integration – nice

I used the Openntf Junit plugin the first time today.
I was really surprised how easy it is to use and how fast it was integrated in my current project. Setup instructions.

With JUnit integrated this way I’m able to do my backend testing without writing any additional Xpage.

Posted in Domino Tagged with:

IBM Docs 2.0 file viewer not working in Activity Stream in Connections 5.5

Thanks to Michele Buccarello and the IBM Support
A workaround for the issue with the file viewer not working from the Connections 5.5’s activity stream has been discovered.

see this for more details.

Posted in Connections

Nginx Proxy for Domino – err_connection_refused

I like the nginx server.
Easy to install, simple configuration file.

I built a new Development VM with Domino 9 and installed nginx on it.
Changed the Domino’s http port to 8088. restarted it, tested it. worked.
Removed the nginx default config. Created new config files.
I ran nginx -t, to check the config and service nginx start to startup the server. It started.

When I tried to connect to it, I got an err_connection_refused.
Checking with netstat I could not find anything listening on port 80.
Checking the nginx error log. empty.
Checked that the config file was under /etc/nginx/conf.d present.
Googled to see wether someone else had this issue before, found some hints but nothing worked.

After another cup of coffe I got back to my config file.
Sometimes the error sits in front of the screen.
I screwed the config file on purpose and restarted the nginx without getting an error.
Checking back at my config file I recognized my failure. The file extension was wrong.
Remember the extension has to be .conf ….

Posted in Domino Tagged with: ,

Session As Signer – Note to myself

If this code returns Null

public static Session getSessionAsSigner() {
 Session sessionAsSigner = null;
 try {
  FacesContext context = JSFUtil.getFacesContext();
  sessionAsSigner = (Session) context.getApplication().getVariableResolver().resolveVariable(context,"sessionAsSigner");
 } catch (Exception e) {
 Util.logError(e);
 }
 return sessionAsSigner;
 } 

Then your code might have been signed by different user / servers.. Just sign it with your user ID and try again.

Posted in Domino

Configure the Connections IBM HTTP Server as a reverse Proxy

Open the httpd.conf.

Uncomment the following lines

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

Add a new Virtual Host entry.

<IfModule mod_ibm_ssl.c>
 NameVirtualHost *:443
 Listen *:443
 #Virtual Host for the Connections Server
 <VirtualHost *:443>
  ServerName connect5.belsoft.ch
  SSLEnable
  RewriteEngine On
  RewriteRule ^/$ https://connect5.belsoft.ch/homepage [R,L]
 </VirtualHost>

 #VirtualHost for the proxied Domino
 <VirtualHost *:443>
  ProxyPreserveHost On
  ProxyPass / http://ldap.lab/
  ProxyPassReverse / http://ldap.lab/
  ServerName tools.belsoft.ch
</VirtualHost></pre>
<pre></IfModule></pre>
<pre>

 

Posted in Connections

Keep an X-Page in Memory

Evreybody knows that starting an XPage for the first time takes some time. Using the Notes.ini parameter for preloading the xpages can become slightly difficult if you have a lot of apps.

My solution is quite simple

 
#!/bin/bash 
USERNAME="UserName" 
PASSWORD="Password" 
BASEPATH=/opt/ibm/apps 
LOGIN_URL="https://[SERVER_NAME]/names.nsf?login" 
XPAGES_URL="https://[SERVER_NAME]/[PATH_TO_NSF]/myXpages.xsp"
if [ -f $BASEPATH/last.run ]; then
rm $BASEPATH/last.run
fi
wget --save-cookies cookies.txt --keep-session-cookies --post-data "Username=$USERNAME&Password=$PASSWORD" --delete-after $LOGIN_URL 
wget --load-cookies cookies.txt --delete-after $XPAGES_URL
if [ -f $BASEPATH/cookies.txt ] ; then 
 rm $BASEPATH/cookies.txt 
fi 
touch $BASEPATH/last.run 

Place this file on the server and call it through cron on a regular schedule and your xpages should be always loaded.

As always, use on your own risk.

Posted in Domino

IBM Connections – Wiki RichText editor missing

After installing Connections 5.5 and migrating the content, the wikis would no longer be editable. The richtext editor would not load.
The newly created lab environment without any customizations/data worked.
After digging around the system, I found that we had the some additional ckeditor widgets activated in the wikis.
Removing the file from /ConnectionsData/shared/customization/javascript/lconn/wikis/ckeditor.js and restarting common and wikis app resolved the issue.

 

Posted in Connections