Wednesday, May 31, 2006

JS querystring params when ! is the command delimiter

I faced a problem receiving the querystring params using only JS code.
Scratching the web I found examples of JS functions which rely on document.location.search to retrieve the querystring, then parsing it into oject.property=value

This solution works well on standard URL (which Domino generates by default):
myserver.com/db.nsf/docUNID?OpenDocument¶m1=value1

This is because the document.location.search would return everything after the question mark, meaning OpenDocument¶m1=value1

But what we can do when the Domino generated URL is:
myserver.com/db.nsf/docUNID!OpenDocument¶m1=value1 ?

This change can be performed server-wide by setting a parameter into the server document, then all generated URL will change the question mark with the exclamation mark. And in this case, document.location.search would be empty :)

My solution was something like this:

if(document.location.search=="") {
if (document.location.href.indexOf('!') != -1) qryString = document.location.href.substring (document.location.href.indexOf('!')) ;
} else {
qryString = document.location.search ;
}

meaning that if location.search is empty, I search for the first ! into the location.href and assume everything after is the querystring to be searched for required parameters. Not sure if this is the best approach, though ...

Thursday, May 18, 2006

domain search related

these days I'm very tired and busy trying to somehow improve the search results which are thrown by the Domino Domain Search.

while I do know how to configure the customization of the search results form, I still haven't quite understood how to control what gets display into the DSDocSummary field. I wonder if this can be controlled at all ...

So far I read somewhere that the Search engine is adding the most relevant phrases to this DSDocSummary, for each entry it founds. Doh ... so what is considered to be relevant or not ? I managed to get some summary in the results, however it didn't make any sense ...

Disclaimer: The information in this weblog is provided "AS IS" with no warranties whatsoever, and confers no rights to any institution/person/organization. These are my personal thoughts and ideas. When I am inspired by others I give credit, I do not assume other's work and efforts. This site is NOT supported, approved, blessed etc. by Lotus Software and/or IBM Corporation.

Creative Commons License

This work is licensed under a Creative Commons Attribution 3.0 License.