bookmark_borderFRULE!!!: 9h to find ignoreRequestParams=”true” needs to be set!!!

In continuation of this I faced another problem in my target database. The first time the dialog for the sensitive data was called, it worked just fine. All subsequent calls just failed. After a very long time (you know it………) I finally figured out: the dialog box was using the parent document in subsequent calls.. but why? And why did it work on my test application.

With help from a coworker I finally, by accident!, figured the only difference between test and my actual database was ignoreRequestParams=”true”!! On test this parameter was set and there it worked. I gave it a try, without actually knowing what I was doing. Why I didn’t know? That’s a rhethorical question, right? 😉 On the web I have been stumbling across some other blogs mentioning it, which might have been the reason why I, ghosted  as I was through the lack sleep, tried it out on test. I honestly don’t know how that parameter came there.

But what the heck… finally my approach worked and I could save all my special infos with special access rights to another document!

Anyone: Would it be possible for someone knowing in detail what this parameter is about to write about it? Would be highly appreciated.

What I then figured was also very interesting in itself: Even though the “events” for the data source were not “visible” in the events viewer they were available! Under all properties etc.. you will find it:

That’s by the way also the place where you can toggle the flag for “ignoreRequestParams”!
The cool thing with those events: my defined document datasource is acting like an xPage in itself! Means I can change fields, run my custom validation approach etc. to my liking. Really neat!

bookmark_borderFRULE: pay attention to access rights, especially when working locally!!!!

In one of our applications we need to store more “sensitive” data with less access rights than the normal documents. In Lotus Notes the parent/child paradigma is just about perfect for this task.

My idea was to have a dialog popup where the user could enter this sensitive data.

I did a test in a test database, with a few hiccups I got everything working. The hiccups were kind of related to the fact:

  1. how do I ensure that every dialog would go to the same child document
  2. how do I ensure that the dialog has the same document mode (read/edit) than the parent
1. I solved by presaving a child, getting it’s unid and adding it to the document source. That was per se not sooo complicated disregarding the fact that the functionality was located on a custom control.
2. Was a bit a weireder (german-english for “more weired”) issue. On the test db all worked fine. The dialog’s document source edit mode was put to the same as the parent document and that worked.
In the actual db where I needed this feature I built everything 100% identical, yet the dialogbox was never going to edit mode. By accident then i figured: if the fields are not bound to the document then they can be edited. Of course they wouldn’t be saved also. So what the heck was going on? Then this morning I had an “almost” revelation: it must be access rights!!! I was sure, not being at the computer, this must be related to insufficient access rights for “anonymous”. When I was back at my computer I was disappointed to find out: that was not the case! Same access rights for anonymous on both dbs.
So I did what I usually do when I’m clueluess: tried to explain it to someone “stupid” (stupid in the sense of having no idea what an xPage is).
And guess what: this time the demo effect worked the other way around! Instead of NOT working during demoing, it actually worked!
So I was happy to find out that my approach did work.
But what was the problem when it did not work?
First you must know: I almost 100% of the time work locally (so I can debug easily my Java code), and working at home i’m not even “online”!
Well.. turns out in the test application I had “Enforce consistent ACL” checked. In the actual application this was unchecked, but by accident during demo I was connected to the server (ie. location=online). So during the demo by some interesting feature I cannot explain the web server could, even though local, determine (cause I was online) the appropriate author access for anonymous, hence the whole thing worked!
Summary:
Do not forget to think about the fact that xPages ARE indeed still Lotus Domino applications with all their nice access rights. And if you work locally ensure that you have always checked “Enforce consistent ACL”!

bookmark_borderunQUINDIPping QUINDIP and other accronyms

according to Tim Tripcony (read the comment on this blog) quindip means confusion, I am now trying to unConfuse you about the confusion I created with my accronyms I use 
  • INDIP: INDispensabletIP (those ones which I deem very important in any xPages developers knowledge bag)
  • QUINDIP: QUickINDIP (those ones I deem quickly explained, 2min to read,  understand and implement)
  • FRULE: FRUstratedLearningExpierence (things I learned the hard way (shall I repeat how hard?), ie. it took me hours/days to get the hang of it and mostly in the end it was so obvious only I lacked some very basic knowledge in the first place)
  • CRYFH: CRYForHelp (when I have no clue anymore how to proceed and I need your input)
  • YOUFEB: YOUrFEedBack required (please gimme comments, ask questions what you want me to blog about etc)
  • DYHOP: DoYouHaveOtherProposals for accronyms? 😉
ups.. something very important I almost forgot…

let the game begin (provide your ideas in the comments): any idea what the anagram of in-mood is?

well.. a hint: in-mood is the anagram of the actual word. When I had my own company few years ago, I was so in (good) mood about stuff I was doing that time.. that I figured: great this will be my company name!

Unfortunately I cannot offer anything as a price to the winner besides maybe some special mentioning in a blog entry or my personal effort trying to help to solve an interesting xPage problem!

bookmark_borderFRULE: DominoDocument is a wild animal

Here’s the story:

We needed multiple “dynamic tables” in our projects. Thanks to Russel Maher I had something to start off with.

Too bad his solution worked on the “backend” document. After I had managed to get a “container” around his solution another problem popped up: Save conflicts.

I couldn’t figure out why this happened. I could only imagine it was some sort of “timing issue”. In his solution upon a save a cleaning of the table is done. This merely renames the fields such that they order properly (in case some rows had been deleted). In this process the document was saved in the end. Cause I had several such “tables” to handle the saves of each of those kind of interfered and created those save conflicts.

But how could I solve this?

After a LOT, you should by the time now (if you followed my blog for a while) know what a LOT means!!! Enough to almost give up! Luckily I didn’t.

I figured: if I could only “reorder/rename” those items in the DominoDocument, then those changes would “magically” be transferred to the document upon the actual save. This is all thanks to the architecture of JSF, the data store etc.. (don’t ask me details, I am just about to get a hang on this one!)

So while I tried to get this working I always came accross this thing here.

As I mentioned in that other blog: that guy reporting this error on the Lotus forum had mentioned it happened when trying to put a NULL value vector somewhere.

After a LOT of testing I found: this is exactly what happened in my case!!! I was trying to copy values from date fields over (in order to rename them). But date fields which have no date simply have a NULL in them.

So the final solution was pretty simple: Just check if that item is available or has a NULL value.

Now my solution works smooothly: no more save conflicts, just the way I imagined!

Here’s how it could look like:

bookmark_borderFRULE: NotesException: Note delete failed

Error while saving document
Could not save the document NEW_1d NotesException: Note delete failed

NotesException: Note delete failed
lotus.domino.local.Document.Nsave(Native Method)
lotus.domino.local.Document.save(Unknown Source)
lotus.domino.local.Document.save(Unknown Source)
com.ibm.xsp.model.domino.wrapped.DominoDocument.save(DominoDocument.java:1087)
com.ibm.xsp.model.domino.DominoDocumentData.doSaveDocument(DominoDocumentData.java:567)
com.ibm.xsp.model.AbstractDocumentDataSource.save(AbstractDocumentDataSource.java:76)

what the heck is this???
I only found a very old note in the 6/7 LN forum. The guy thought it was related to some “null value vector”..

any ideas?

Update:
It happens when you try to put a NULL value vector somewhere, see also this blog It’s a feature not a bug!

bookmark_borderFRULE: frustrated about stupid error messages

Scenario:
created xPage, added some fields, changed some properties, added custom control with buttons to save etc…, tried to create and save a “document” …
wouldn’t save…  wtf makes fun with me???

damn…

tried to find out what the problem was, got the idea to add an “display errors” control, guess what, there WAS an error!!

Search??? what search??? and WHERE?????

almost went nuts!!!

finally, you guess: after HOURS!!!, I had a brilliant or stupid idea: remove the form validations on “save” as the xPage wasn’t really “connected” to an existing form, and guess what!!

THE SEARCH ERROR MESSAGE DISAPPEARED!!!

Lesson learned:
1. xPages error messages are stupid as stupid can be
2. never use form validations if the xPage isn’t associated with an actual form

FRUstradedLearningExperience

I know.. usually all this wouldn’t happen when you start from scratch.. but as all lazy developers.. I sometimes “copy&paste” and this ain’t really helping sometimes!