Assume protocol, server and path in Navigator URL

In a Hotspot on a Navigator, for a URL, if you begin with a “/”, then the current protocol and server are assumed. I have tested this and it works great. Does anyone know of a way of also assuming the current path and database? This way, the same replica can be on several servers with different path’s and still work. (With the gusto that got Notes to where it is today).

Subject: RE: Assume protocol, server and path in Navigator URL

How about giving people a couple of minutes to answer the question before asking it again?

Subject: RE: Assume protocol, server and path in Navigator URL

There is not a way to do this with a relative path. The way to do this would be in the design of the database – to use @webdbpath when creating dynamic links.

Subject: There is a easy way

for a given URL like this:

http://www.mydomain.com/apps/myapp.nsf/myview?openview

if you put only /apps/myapp.nsf/myview?openview, then protocol and

server are assumed. but if you put myview?openview (without the initial ‘/’), then filepath a

db are assumed too.

However, it is common (and a standard I would say) to use @webdbpath as

mentioned by Christopher.

Regards,

Oswaldo Escobar Mendoza

Lima, Perú

Subject: RE: There is a easy way

Relative URLs depend on the current location. If the code is sitting on a design element, that will work, but if it’s sitting on a document, then the result will be:

http://www.mydomain.com/apps/myapp.nsf/myview/myview?OpenView

… which will throw a 404. And that’s why @WebDbName is used.

Subject: Are you sure?. not test that but…

…I found these relative URL on a client’s app and it seems be working fine.

Fortunately I use to compute url’s in my applications with @wbdbname ;-). As I mentioned “It is common (and a standard would I say)”

Regards,

Oswaldo Escobar Mendoza

Lima, Perú

Subject: RE: Are you sure?. not test that but…

Absolutely sure. One hundred percent sure. (It’s a W3C spec and part of the HTTP RFC.)

Subject: RE: Are you sure?. not test that but…

OK, but, respectfully, where do this lead me? It’s still failing.

Subject: RE: Are you sure?. not test that but…

Kee-ripes, will you keep one spot in the thread? My reply here was to Oswaldo.

Subject: RE: Are you sure?. not test that but…

Sorry Stan, it’s just that I have been working with Notes since 1992 and it’s the most frustrated I’ve ever been.

Subject: RE: Are you sure?. not test that but…

Let’s see if I can straighten this out for you then. Break the URL into two parts:

Protocol + Server

and

path

You can eliminate the “Protocol + Server” part by using a “/” at the front-end of a relative URL. We’ve already covered that – the “/” at the beginning is what makes that work.

The path, at least as far as the NSF itself, is covered by @WebDbName, which is just a handy tool to replace the old @ReplaceSubstring(@Subset(@DbName; -1); “\”:" “; “/”:”%20") we needed to use in R5. So a relative URL to the NSF is:

“/” + @WebDbName

That will get you:

http://127.63.31.15/path/db.nsf

You now need to make that into a URL for the form, right? And THAT URL is:

http://127.63.31.15/path/db.nsf/FormName?OpenForm

To get from where we are to where you need to be, you need another “/”, and the “FormName?OpenForm” part, so the whole formula for the URL is:

“/” + @WebDbName + “/FormName?OpenForm”

Subject: RE: Are you sure?. not test that but…

You’ve really offended me with your bad language Stan. Any minute now you’re going to say ‘crikey’ or ‘jeez’ and I’m going to get really upset.

Subject: RE: Are you sure?. not test that but…

Oh, now you’ve asked for it, George…

Subject: RE: There is a easy way

I am sorry but it seems that @WebDbName is failing for me. I have tried this formula both within a button hotspot on a form and within a hotspot on a Navigator and it fails both ways. Instead of opening the form, it opens what is defined for the launch option in the properties of the databasen which happens to be in this case, the About Document. This problem has been persisting for several days now and I am getting really frustrated. Does anyone have any additional suggestions?

HELP!!

This is the formula:

@URLOpen(@WebDBName + PrefByDistrict?OpenForm)

Subject: RE: There is a easy way

You’re missing the “/” at the beginning and between the database and the form name. It makes the difference between:

path/db.nsfPrefByDistrict?OpenForm

and:

http://127.63.31.15/path/db.nsf/PrefByDistrict?OpenForm

Subject: RE: There is a easy way

Oswaldo you are absolutly correct! Using just the form name in the URL, without the initial “/” (CertByDistrict?OpenForm) worked! Thanks so much. You just relieved days of frustration. I am back loving Notes again!

Subject: RE: There is a easy way

Note that it won’t always work, Ken. that’s why I posted what I posted – if you were to embed the Navigator on a form, and that form was used to display a document, the URL would be broken. Do it right, whether it’s the easiest way or not, and you won’t have any problems in the future.

Subject: I am wondering…

…why the formula:

“/” +@webdbname + “/MyForm?OpenForm”

does not work for Kenn. It would must work, always.

Kenn, can you post your formula?

By the other hand, If I have to decide between write less code (with a possible bug) or write a little bit more code(avoiding that possible bug). Definitively I’ll choose the second option.

Regards,

Oswaldo Escobar Mendoza

Lima, Perú