354 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Getting mail.box from Domino server
Thu, Mar 20th 2014 299
Domino and No trusted certificate found
Tue, Jan 28th 2014 324
Issues when developing IBM Domino Notes applications
Fri, Oct 18th 2013 90
IBM Designer Java Console effect?
Thu, Oct 3rd 2013 118
How we cook GitHub, Jira and Jenkins with Domino
Fri, Aug 9th 2013 117
Java as backend for web applications based on Domino
Thu, Aug 8th 2013 78
Frontend developers without knowledge about Domino
Wed, Aug 7th 2013 73
Top 10
Domino and No trusted certificate found
Tue, Jan 28th 2014 324
Getting mail.box from Domino server
Thu, Mar 20th 2014 299
Exception occurred calling method NotesAgent.runWithDocumentContext(lotus.domino.local.Document) null
Fri, Aug 3rd 2012 137
Node.js first experience and first simple project
Wed, Jan 30th 2013 124
IBM Designer Java Console effect?
Thu, Oct 3rd 2013 118
How we cook GitHub, Jira and Jenkins with Domino
Fri, Aug 9th 2013 117
Copy/Paste substitutions freezes my Lotus Notes
Tue, May 31st 2011 101
Split backend & frontend when build web applications
Tue, Aug 6th 2013 94
Issues when developing IBM Domino Notes applications
Fri, Oct 18th 2013 90
Rewriting URL in Domino using DSAPI.
Wed, Mar 6th 2013 88


Error pages in Domino
   

First of all I'd like to briefly describe few another ways we can use to manage error pages in Domino.
Also notice, I will definitely update post few times more after all.

1. Lazy solution $$ReturnGeneralError and MessageString
It's the most fast and easy solutions, it require to create 1 design element (form) $$ReturnGeneralError, style it and add MessageString somewhere to explain what is wrong
Benefits:
- I see only 1 advantage compare to another approaches, its time to implement. Once you create $$ReturnGeneralError it starts to work. So few clicks and few minutes to manage output UI and you have solution.
Disadvantages:
- works inside of application only. So if you have 10 web applications, you need to manage error page in each of it. However you can setup inheritance and manage all error pages from 1 place etc.
- not very flexible on my opinion as we can operate with form-design elements only.

2. HTTP response headers
Simply create error page as design element or as document (does not matter) and create rule for your website in Domino Directory database. It does not require special knowledge and it is simple to use.


Benefits:
- easy to manage
- path to Error page (means we can use different database to keep error pages)
- we can use both: Design Elements and Documents as error page.
Disadvantages:
- require minor Administration of Domino skills.
it works in the same way as client side redirection. i.e. user will see “blink” of standard 404 page before loading custom 404 page.

3. "Whole server" solution
Use HTTPMultiErrorPage property in the Notes.ini file, for example HTTPMultiErrorPage=/error.html. Create rule on the Domino server for /error.html to be substituted corresponding page.
Benefits:
Disadvatages:

4. DSPAI as error handler for Domino
Most complicated approach but also most flexible from my point of view. There is quite low information about how to use it. It requires knowledge of Notes C Api as well. If you want to see how it looks, here is very good exampe (it helped me a lot) on loggin using DSAPI
Company I worked in use DSAPI for handling URL already, and now we are near to implement error handling using DSAPI as well (it already implemented it on development server, so soon I will show you real links etc).
DSAPI allows us to catch responses Domino generated for users and we can replace output in case if responce 400, 404 or any another.

I will post most important part of logic here, just to how overview how DSAPI works and what is gives to us. Notice I've changed code a bit, to show only most important part of it (I will copy comments from Paul's example just to make things faster) 

1. initiation of filter and register for response event
/*---
* FilterInit() - Required filter entry point. Called upon
* filter startup, which occurs when HTTP server task is started.
*/
DLLEXPORT unsigned int FilterInit(FilterInitData* filterInitData) {
   filterInitData->eventFlags = kFilterResponse;
}
so what we did there, say to filter that we want to process response events
2. Link events we registered with functions
 /*---
* HttpFilterProc() - Required filter entry point. Dispatches the event notifications to the appropriate functions for handling the events.
*/
DLLEXPORT DWORD HttpFilterProc(FilterContext *pContext, DWORD dwEventType, void *pEventData)
{
 switch (dwEventType) {
  case kFilterResponse:
   return Response(pContext, pEventData);
 }

 return kFilterNotHandled;
}
Now we can process Responses to users
3. This is how we process Response to users
int Response(FilterContext* context, FilterResponseHeaders* eventData) {
 int responce = eventData->responseCode;

 if (responce==404) {
  if (Send404(context) == TRUE) {
   return kFilterHandledRequest;
  }
 }
 return kFilterNotHandled;
}
4. Finally code for Send404() how we replace content to users
While you read code you need to know that when we load filter we also initiate a table with KEY-HTML arrays. Yes we keep in memory Error HTML pages with keys we need. Our Keys - domain, we handle error pages on domain level, means for domain1.com - is 1 error page, for domain2.com is another error page. But you can do it in another way its up to you.
int Send404(FilterContext* context) {
 FilterResponseHeaders         response;
 unsigned int   errID = 0;
 char     szBuffer[DEFAULT_BUFFER_SIZE]={0};
 char     pszErrorPage[ERRRO_PAGE_SIZE]={0};
 FilterParsedRequestLine pRequestLine;
 unsigned int   pErrID;
 int      i;

 // As we are returning the entire page to the browser, we can 
 // set the response code to 404 (so the domino web log will show the error)
 response.responseCode=404;
 response.reasonText="Bad Request";
 
 // get domain name (its our key), could be done faster? right now its simple walk via 10-20 documents which is fine for now
 context->ServerSupport(context, kGetParsedRequest, &pRequestLine, NULL, NULL, &pErrID);
 for(i=0; i<errorPagesCount;i++) {
  if (strcmp(errorKey[i], pRequestLine.pHostName)==0) {
   strcpy(pszErrorPage, errorHTML[i]);
   i=errorPagesCount;
  }
 }

 if(strlen(pszErrorPage)<10) {
  sprintf(szBuffer, "Error page on %s is very small, something wrong", pRequestLine.pHostName);
  writeToLog(CRITICAL_MSG, szBuffer);
  return FALSE;
 }

 sprintf(szBuffer, "Content-Type: text/html; charset=UTF-8nnContent-length: %inn", strlen(pszErrorPage));
 response.headerText = szBuffer;

 if (context->ServerSupport(context, kWriteResponseHeaders, &response, 0, 0, &errID) != TRUE) {
  sprintf(szBuffer, "Error sending redirect, code: %d", errID);
  writeToLog(CRITICAL_MSG, szBuffer);
  return FALSE;
 }
    if (context->WriteClient(context, pszErrorPage, (unsigned int) strlen(pszErrorPage), 0, &errID) != TRUE) {
  sprintf(szBuffer, "Error sending redirect, code: %d", errID);
  writeToLog(CRITICAL_MSG, szBuffer);
  return FALSE;
 }
 return TRUE;
}
OK guys, I've shared most complicated part of this DSAPI for error handling, rest you have complete yourself (homework :)), but feel free to ask my help here if you need.
benefits:
- most flexible approach (at least from those which I know)
- our logic control everything we want and we clearly see what is going on
disadvantages:
- most complicated ways from all I described
- require knowledge of Notes C API
- I did not try yet this solution with Linux servers (but I know it is possible to do)
- it may crash your Domino server in case if you did you filter wrong (memory leak etc)


5. xPage error handling is on way (on pause actually) and would be nice if somebody help me with that. I've read few articles in past from Per Henrik: XPages custom 404 and error page and Controlling the HTTP response status code in XPages, I think they can be very useful for those who doing in xPages. We will try this approach as we have ongoing huge projects based on xPage. 

Hey:
- ask to update/more details to article
- notify me about issues
- let me know if you know better way to handle errors

strongly recommended as it can help to many developers in future.

---------------------
http://feedproxy.google.com/~r/dpastov/~3/sypIIHW2wac/error-pages-in-domino.html
Jan 24, 2012
66 hits



Recent Blog Posts
299


Getting mail.box from Domino server
Thu, Mar 20th 2014 4:32a   Dmytro Pastovenskyi
Domino allows to setup up to 10 mail boxes for 1 server. By default it 1 mail box with name mail.box however if you increase number of mail boxes to 2 and more Domino will create mail1.box, mail2.box ... and you must remember about it. In order to get mail box without doing lookup to ServerConfig document, just try to initiate mail1.box first and if it does not exists go for mail.box public Database getMailBox(Session session) throws NotesException{ String server = session.getServerName(); Da [read] Keywords: domino database server
324


Domino and No trusted certificate found
Tue, Jan 28th 2014 8:09a   Dmytro Pastovenskyi
We have few agents that communicate with other systems via and today at 13:00 we got such answer from Domino when we tried to set connection with external system. That was a huge problem for us since it affect our business. javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.j: No trusted certificate found at com.ibm.jsse2.o.a(o.java:8) at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:549) at com.ibm.jsse2.kb.a(kb.java:355) at com.ibm.jsse2.kb.a(kb.java:130) at com.ibm.jsse2.lb.a(lb. [read] Keywords: domino ibm lotus application database java password security server
90


Issues when developing IBM Domino Notes applications
Fri, Oct 18th 2013 6:11a   Dmytro Pastovenskyi
Some minor stuff about Domino Designer. Undo/'Ctrl+Z' does does not work properly when you developing in Lotus Script, if you do it few times it might mess your code 'Ctrl+C'/'Ctrl+V' sometimes does not work from first attempt, so you need to do it twice 'Ctrl+C'/'Ctrl+V' sometimes it sets focus on penultimate character so you have to do 1 extra actions to continue write code I still have crashes in Domino Designer without any reasons and I've no customization to my Designer I'm no [read] Keywords: domino ibm lotus notes applications
118


IBM Designer Java Console effect?
Thu, Oct 3rd 2013 8:09a   Dmytro Pastovenskyi
I've faced up with interesting problems. I'm doing integration between MailChimp and Domino application. MailChimp service has very good API so it was not huge problem to push/poll data to/from it and we already implemented solution based on Java. The fun started when I tried to do LS2J part. That error does not happen if I enable Java Console in IBM Domino Designer. When Console is up - everything works perfect, otherwise this error: LS2J Error: Threw java.lang.SecurityException: not a [read] Keywords: domino ibm application integration interface java security
117


How we cook GitHub, Jira and Jenkins with Domino
Fri, Aug 9th 2013 1:39a   Dmytro Pastovenskyi
Why would I use it? I'll describe briefly how we use GitHub, Jira and Jenkins together to make better development process. More details will come later when I get some desire :). OK, lets look what benefits we have from using these tools. GitHub with Jenkins GitHub has number of Service Hooks and one of them is for Jenkins. It allows to trigger build jobs when pushes are made to GitHub. You don't need to have any skill to do that, let's look on screen below. So once you made a push, Jenk [read] Keywords: domino application development
78


Java as backend for web applications based on Domino
Thu, Aug 8th 2013 1:18a   Dmytro Pastovenskyi
Is it enough to use only Java? Yes. Our newly created applications have been written only for web and we did all back-end with Java only (the only exclusions are selection for Views). No, we do not miss @Formula, Lotus Script or SSJS, we simply do not need those languages in our daily work. Java is better than LS/SSJS for us. You can develop much better/faster using Java and get all candies: open sources, forums, stackoverflow or even shift at some point to Java completely if it has sense for y [read] Keywords: domino formula language ibm lotus notes xpages applications community development java server




73


Frontend developers without knowledge about Domino
Wed, Aug 7th 2013 12:32a   Dmytro Pastovenskyi
Do FE developers must have understanding of IBM Domino/Notes platform? I believe they should know we use Domino as server, however that's it. Domino is server, so it is responsibility of BE developers. Few years ago when we had mixed UI and Backend in our projects each time FE developer had to do something in IBM Designer I saw such face. I do not like such face :), one more reason why we forced our self to do what we did. More details how FE developers works I will try to describe work [read] Keywords: domino ibm notes application eclipse server workspace
94


Split backend & frontend when build web applications
Tue, Aug 6th 2013 6:10a   Dmytro Pastovenskyi
Is it really a problem to mix Backend (BE) and Frontend (FE)? Yes, it is a problem, it's simply wrong. Some of you will argue with me and say: I'm doing both: FE and BE and I'm 'pro' in both areas. Our FE developers learned Domino platform in few weeks, so we have no problems, they feel comfortable with doing stuff with IBM Designer. Our FE guys simply say what to change and we do that, they send us some template each time we need to change something. We are doing internal website and o [read] Keywords: domino formula language ibm lotusscript ntf xpages application applications css java properties
80


How we build our applications based on Domino
Mon, Aug 5th 2013 6:18a   Dmytro Pastovenskyi
Intro I've been working with Domino for many years (however very possible less than many of you :-), I started to work with version 5 at the beginning and in few months we migrated to 6.X). I worked in few companies with absolutely different projects and processes of development. There were lot of 'hell projects' (without any structure inside, just mess) and few really 'cool projects' where I could learn something. I always tried to bring the best of the old projects into new. Now I'd lik [read] Keywords: domino ibm applications development java server
54


Frontend developers without knowledge about Domino
Fri, Aug 2nd 2013 1:20p   Dmytro Pastovenskyi
Do FE developers must have understanding of IBM Domino/Notes platform? I believe they should know we use Domino as server, however that's it. Domino is server, so it is responsibility of BE developers. Few years ago when we had mixed UI and Backend in our projects each time FE developer had to do something in IBM Designer I saw such face. I do not like such face :), one more reason why we forced our self to do what we did. More details how FE developers works I will try to describe worksp [read] Keywords: domino ibm notes application eclipse server workspace




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