Showing posts with label xPages. Show all posts
Showing posts with label xPages. Show all posts

Friday, July 12, 2013

Replacement for DSAPI in Java/XPages

I've written few articles about how DSAPI could help you to control classic web application built on Domino. That solution worked perfect for us and difficulties I encountered were:
  • slower development process due to my skill in C;
  • poor documentations about how things work in DSAPI (probably most weak side for me);
  • deployment process (you need to create new DLL each time and upload it to Domno Server, then restart HTTP);
  • you have to be 'very-very' careful with everything, one mistake (i.e. memory leak somewhere) can crash the server at some point;

Last months we worked on new Web CMS based on Java/Velocity in Domino and result I must say was really great. I will make post about most interesting things later: the topic will be about java, html/templates, velocity, git, jenkins, jira and how it works together. I would call it pure Java approach to do development in Domino. The beauty using java as engine allow us to get rid of DSAPI. So everything what have been done with DSAPI (and in total I spend maybe 2-3 weeks) we replaced in 2-3 hours with Java.

case #1: Re-write URL from http://domain/page/subpage/ to http://domain/page/subpage with 301 status. We simply set new location in header and new status
  getResponse().setStatus(MOVED_PERMANENTLY_STATUS);
  getResponse().setHeader(LOCATION_HEADER, uri);
case #2: 404/500 etc error pages we only set correct status for response + throw out required content
  getResponse().setStatus(DEFAULT_ERROR_STATUS);

So my feeling about DSAPI is actually quite good, however be sure you know how to cook it, otherwise - don't go with that solution. Remember my example: I've spent weeks doing DSAPI via C and now we did exactly same in few hours. That feeling when I compared what I spent with DSAPI (via C) compare to new solution with Java. 100 hours agains 3.


Related topics
DSAPI for Domino
Rewriting URL in Domino using DSAPI
Solution for Lotus Domino to the trailing slash problem

Friday, August 03, 2012

Exception occurred calling method NotesAgent.runWithDocumentContext(lotus.domino.local.Document) null

Tried to run agent with 'context document' in xPage (via SSJS) and got this problem. I did not find a way how to solve that except to enable checkbox 'Run as Web User' for agent, however I need to run agent from 'signer' as 'runner' has Reader access and my agent update should document. It's terrible with this problem (if it is problem ofc :)). What should I do know?

Friday, March 04, 2011

Wednesday, January 19, 2011

trying to get full control over xPage auto generated html

I know xPage is great especially for RAD but I feel bad when I see how Domino generates HTML for xPage's application and dojo why it loads even if I do not want to use it? yea, I know that most of xPage's controls use it but anywhere I want to keep control over each html-tag. I want nice html. I want to know what is going on with my html. I'm sure all of you saw what html we get from xPage, and I want to repeat once again "I'm not fan of that".
Here are couple steps for those who want to get some more control over xPage. I will show example with new application that has only one xPage.

so let's start. we created new application and created new xPage, let's call it 'index'. Open it in browser. what do you see? My Domino generates already lot of staff.

1. included dojo.
2. included css.
3. created form and put there ~6 fields for some reasons. I do not know why.
4. html, head, title, body tags and !DOCTYPE

So instead to display empty page, Domino generated ~1Kb of some data we did not ask.

1-st step: disable default dojo in xPage.
You can disable the loading of the default Dojo, for example in order to use a more recent version of Dojo. In the Package Explorer in Domino Designer open your database and find the WebContent/WEB-INF/xp.properties file.
Edit the file and addxsp.client.script.libraries=none
Switch to Java perspective and Package Explorer there by default, so go there and make update. Save and check results. 2 line disappeared.

2-nd step: disable CSS.
create new Theme and remove extends="webstandard" and add this Theme in application properties as one we want to use. check hmtl source again - 3 lines with css went out.

open our index xPage and go to properties, tab Basic and set CreateForm = false. Save. Check. 
nice! we are quite near :)

4-th step. get empty blank xPage.
I do not know yet the way how correctly suppress rest of these tags and how to change doctype, so next time when I found solution I will update article.

Funny, while I was looking for solution for 4-th step, I found absolutely similar article from Chris, so you can read more older one This is an xPage.

Monday, December 06, 2010

Expand and Collapse views in xPages

Found very nice solution

Collapse all
 var viewPanel = getComponent(compositeData.viewPanelName);  
 var model:com.ibm.xsp.model.domino.DominoViewDataModel = viewPanel.getDataModel();  
 var container:com.ibm.xsp.model.domino.DominoViewDataContainer = model.getDominoViewDataContainer();  
 container.collapseAll();  

Expand all
 var viewPanel = getComponent(compositeData.viewPanelName);  
 var model:com.ibm.xsp.model.domino.DominoViewDataModel = viewPanel.getDataModel();  
 var container:com.ibm.xsp.model.domino.DominoViewDataContainer = model.getDominoViewDataContainer();  
 container.expandAll();  

That's much better then save values in sessionScope/RequestScope and use property expandLevel in viewPanel.

Monday, October 11, 2010

xPage: date picker does not work in IE8

Just found that standard date picker does not work properly in IE8 (it always refresh page when we click on date/time picker. That's not funny :/ question - why do all another browsers work fine?

Workaround
http://www-10.lotus.com/ldd/nd85forum.nsf/0/579744cf7198e21785257731006c9cea?OpenDocument