This is an easy one, but I still think it is worth mentioning all the different findings about a new technology like IBM Bluemix. During my tests with XPages on IBM Bluemix, I once made a little mistake. I forgot to switch to the IBM Bluemix ID file before I started modifying the design of the Bluemix app.
Obviously this is easily possible within Domino Designer. I was also able to deploy my changes to IBM Bluemix, but the new XPage could not be called due to an access issue we know from our good old domino environment too!
Signing the design element and another deployment to Bluemix solved the issue.
Good old Domino security - makes perfectly sense to me :-) It would be really nice to have an option to sign the design during the deployment process though!
(BTW: this is a rather old post which was still unpublished - but I think the deployment process is still the same)
Showing posts with label Development. Show all posts
Showing posts with label Development. Show all posts
Sunday, 31 January 2016
Thursday, 3 December 2015
Image processing using JaxaXT in a Notes / Domino Agent
Today I stumbled
across JavaXT. JavaXT is
described as
a collection of Java libraries and utilities
that provide a number of functions not available in the standard JDK. It is an
extension of the Java core, written to simplify Java development.
I needed a
library to resize images - from a good old java agent :-/ So far I used the Java Advanced Imaging API but I had issues resizing
some JPEG images. I was not able to find a correlation what caused the issues: And to be honest, my code was not very clean and neat so this was a good opportunity for improvements anyway.
Using JavaXT I refactored my whole code to very few lines to do some resizing of images and save them in a NotesDatabase.
Using JavaXT I refactored my whole code to very few lines to do some resizing of images and save them in a NotesDatabase.
This sample processes all Files in a given folder and resizes them to a fixed width of 200 pixel.
import java.io.File;
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
File[] files = new File("D:/tmp/pix/").listFiles();
for (File file : files) {
if (!file.isDirectory()) {
String srcFileName = "D:/tmp/pix/" + file.getName();
javaxt.io.Image image = new javaxt.io.Image(srcFileName);
String destFileName = "D:/tmp/pix/resize/" + file.getName();
image.setWidth(200);
image.saveAs(destFileName);
}
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
Job done! In a few lines of code :-)
Besides
image processing JavaXT provides a lot more, I can only recommend to check it
out.
If you have suggestions , e. g. for a better approach I am more than happy about your feedback.
If you have suggestions , e. g. for a better approach I am more than happy about your feedback.
Thursday, 5 June 2014
How to overcome Domino Webservice Timeout issues
Many of you might be aware of the restriction described here. I was not, and it caused me and my colleague quite some time to investigate, and fix this. Additionally, it caused us a lot of pain, because this issue increased the pressure on our project. So this might be relevant to some of you too...
So this is the story: We had a very annoying issue with a Domino WebService Consumer which was running in a timeout (almost all the time). As with many other projects the WebService was running fine in our Development environment. In both, our Integration as well as our Production Environment, the WebService always ran into the following error:
You have experienced this yourself too, don't you? Obviously, the amount of data in our development system was a lot smaller than in the integration and production environment. This is why the issue did not occur in our DEV system. But why the heck does the WebService stop at all??
After quite some research and opening a PMR we were pointed into te right direction:
The default Web Service Timeout is set to 60 seconds. It is a hard coded limitation, IBM seems not to be willing to fix this. To overcome the issue you have to be smarter than me and set the timeout on each WebService consumer individually at runtime. You can do this by calling the setTimeout() function of the WebService and pass the number of miliseconds.
More details can be found in APAR LO48272: WEBSERIVCE CONSUMER BREAKS THE CONNECTION AFTER 60 SECONDS
So this is the story: We had a very annoying issue with a Domino WebService Consumer which was running in a timeout (almost all the time). As with many other projects the WebService was running fine in our Development environment. In both, our Integration as well as our Production Environment, the WebService always ran into the following error:
Error while reading data from server, Network operation did not complete
in a reasonable amount of time; please retry
You have experienced this yourself too, don't you? Obviously, the amount of data in our development system was a lot smaller than in the integration and production environment. This is why the issue did not occur in our DEV system. But why the heck does the WebService stop at all??
After quite some research and opening a PMR we were pointed into te right direction:
The default Web Service Timeout is set to 60 seconds. It is a hard coded limitation, IBM seems not to be willing to fix this. To overcome the issue you have to be smarter than me and set the timeout on each WebService consumer individually at runtime. You can do this by calling the setTimeout() function of the WebService and pass the number of miliseconds.
More details can be found in APAR LO48272: WEBSERIVCE CONSUMER BREAKS THE CONNECTION AFTER 60 SECONDS
Labels:
Development,
Domino,
IBM,
Java,
LotusScript,
Tips,
WebServices
Thursday, 8 May 2014
Extract Top-Level-Domain from a URL using client-side JavaScript
I needed a way to extract the top-level-domain from a url in a client-side javascript. I use the window.location object to achieve this (as I needed it in a CSJS anyway). There might be an easier way to do this, but this is my version of doing this:
/*
* This function returns the TLD part of the url based on window.location => CSJS
*/
function getTLD() {
var hostName = window.location.hostname;
var hostNameArray = hostName.split(".");
var posOfTld = hostNameArray.length - 1;
var tld = hostNameArray[posOfTld];
return tld;
}
Looking forward to your approacches to to this ;-)
Labels:
Client-side,
Coding,
CSJS,
Development,
JavaScript,
Tips
Thursday, 16 January 2014
Some thoughts on Source Control Management for XPages development
In my career as a Domino developer I have been playing with various Source Control Managent solutions already. I used TeamStudio Ciao! for many many years and this tool proved to be a life saver in many occasions already. So I owe some drinks to the guys from TeamStudio... (don't tell them!!)
Since IBM started opening Domino Designer in Release 8.5.3 (was it 8.5.2 ???) towards the "standard" SCM systems (Git, SVN, Mercurial) I have been playing with these options a lot. There was quite some pain involved, I lost source code, my repositories lost the link to the NSF/ODP, etc... No pain, no gain! The good news for me: Today I have a working environment which fits my needs :-)
My first steps were with SVN, but I admit that I was not able to get this setup running properly. Additionally, I was not too happy about the centralized approach. That said I started using Mercurial. Finally I ended up using Git, first the implementation in Domino Designer and nowadays using SourceTree. This setup provides me with such a high flexibility with regards to my work-related projects as well with my pet-projects.
The last missing bit so far was a proper SCM system. I have been looking around for a while and playing with various systems. As I am a corporate developer, using a hosted environment was not an option at all. So I was looking for a solution to run my self-hosted SCM server for my code coming from both, work-related projects as well as pet-projects. Finally, I think my journey has ended successfully (or at least I have reached an intermediate stop). I have played with GitLabHQ for a a while now and it looks very promising to me. I got it up and running relatively painless on a local Ubuntu VM. If you are looking for a self-hosted SCM server, I can highly recommend looking into GitLab (it is very focussed on SCM though).
There is a lot of useful information available in- and outside the XPages community. In the upcoming weeks I will describe my environment and approaches and specifically GitLab a little more in detail and hopefully add some more useful bits. So stay tuned!
Since IBM started opening Domino Designer in Release 8.5.3 (was it 8.5.2 ???) towards the "standard" SCM systems (Git, SVN, Mercurial) I have been playing with these options a lot. There was quite some pain involved, I lost source code, my repositories lost the link to the NSF/ODP, etc... No pain, no gain! The good news for me: Today I have a working environment which fits my needs :-)
My first steps were with SVN, but I admit that I was not able to get this setup running properly. Additionally, I was not too happy about the centralized approach. That said I started using Mercurial. Finally I ended up using Git, first the implementation in Domino Designer and nowadays using SourceTree. This setup provides me with such a high flexibility with regards to my work-related projects as well with my pet-projects.
The last missing bit so far was a proper SCM system. I have been looking around for a while and playing with various systems. As I am a corporate developer, using a hosted environment was not an option at all. So I was looking for a solution to run my self-hosted SCM server for my code coming from both, work-related projects as well as pet-projects. Finally, I think my journey has ended successfully (or at least I have reached an intermediate stop). I have played with GitLabHQ for a a while now and it looks very promising to me. I got it up and running relatively painless on a local Ubuntu VM. If you are looking for a self-hosted SCM server, I can highly recommend looking into GitLab (it is very focussed on SCM though).
There is a lot of useful information available in- and outside the XPages community. In the upcoming weeks I will describe my environment and approaches and specifically GitLab a little more in detail and hopefully add some more useful bits. So stay tuned!
Labels:
Coding,
Designer,
Development,
Domino,
Eclipse,
Git,
GitLab,
IBM,
Mercurial,
SCM,
SourceControl,
Subversive,
SVN,
XPages
Subscribe to:
Posts (Atom)