jump to article
...intermittent thoughts

@WebDBName in XPages

In the last days I have worked quite a bit with Domino XPages Technology. One thing that came up was the lack of an @WebDBName function that is missing in XPages. But the solution is more than easy and requires just a few lines of code. You may want to copy that because you just don't want to code it every time. For me this is a function I have put that function into some core Serverside JavaScript-Library I include into every page and Custom control anyway, so I can use it everywhere. I took the name I expected to have which is the only critical part - if that function is included at anytime in the future, that hand crafted function may cause problems or incompatibilities, so it might be a good idea to give it another name.

/** *****************************************************************
* provides functionality of the function with same name from @Formula
*
* @return the name of the current database in a websave format
* @author Michael Gollmick
* @version 1.2
* @date 20090119
****************************************************************** */
function @WebDBName() {
        try {
                if (typeof this.name === 'undefined') {
                        var path = database.getFilePath();
                        var re = new RegExp("\\\\", "g");
                        path = path.replace(re, "/");
                        var arr = path.split("/");
                        for (var a = 0; a < arr.length; a++) {
                                arr[a] = escape(arr[a]);
                        }
                        this.name = arr.join("/");
                }
        } catch (e) {
        }
        return this.name;
}
/* ******************************************************************
* END @WebDBName
****************************************************************** */

Feel free to use it!
  1. 1) kopior klockor said: (03.05.2017 11:41:54 GMT)
    watch

    This is a great watch

    Successful person's selection<a href="{ Link } kopior</a>

    Identity status symbolizes only one watch to prove your advantage

    You just need a symbol of this watch

  2. 2) kopior klockor said: (03.05.2017 11:42:15 GMT)
    @WebDBName in XPages

    This is a great watch

    Successful person's selection[url={ Link } klockor[/url]

    Identity status symbolizes only one watch to prove your advantage

    You just need a symbol of this watch

  3. 3) online said: (22.05.2017 15:31:24 GMT)
    quick online loans instant approval

    RSS { Link } , puns feeds cialis pills for sale and intrusive sucidial thoughts.

  4. 4) kopi rolex said: (25.05.2017 11:03:48 GMT)
    @WebDBName in XPages

    Det finns ett brett utbud av [url={ Link } rolex[/url]

    <a href="{ Link } rolex</a>

  5. 5) kopi rolex said: (25.05.2017 11:04:27 GMT)
    @WebDBName in XPages

    <a href="{ Link } rolex</a>

  6. 6) kopi rolex said: (25.05.2017 11:04:54 GMT)
    kopi rolex

    Det finns ett brett utbud av [url={ Link } rolex[/url]

    <a href="{ Link } rolex</a>


Add Comment
 
Subject:
   
Name:
E-mail:
Web Site:
 
Comment:  (No HTML - Links will be converted if prefixed http://)
 
Remember Me?