nsftools blog | comments

[1] Duffbert @ 03:58AM | 2005-08-23

Well... I certainly don't feel so "special" any more...


[2] Julian Robichaux @ 04:06AM | 2005-08-23

Neither do I, since you never actually took the time to respond to the e-mail I sent to you with the template in the first place...


Then again, I really shouldn't pick on you. None of the other people responded either.

- Julian


[3] Bruce Elgort @ 05:30AM | 2005-08-23

I responded!


[4] Julian Robichaux @ 12:47PM | 2005-08-23

So you did Bruce. I thought that was from an earlier e-mail thread. I stand corrected and shamed.

- Julian



[5] Jorge Coelho @ 05:06PM | 2005-08-23

In regards to the server DNS name give this a shot. Add pass-thru html to your View Template to create a hidden field above the view. The value of the field should be set to your base URL (e.g. http://www.nsftools.com/). You can compute this dynamically as you would on other elements using CGI variables (e.g. HTTPS, HTTP_Host, etc.).

Then in your view include a script tag where you want the base url to be inserted and include something like the syntax below in between the script tags.

document.write(document.forms<0>.baseURL.value)

When your view renders, it will include the host name you computed.

Not glamorous, but it works.


[6] jonvon @ 07:21PM | 2005-08-23

i think

window.location.protocol + "//" + window.location.hostname

might do it, and then of course use document.write to print it out to the source.




[7] Julian Robichaux @ 12:16AM | 2005-08-24

Well, here's the problem.

The view contents are being read directly as XML. So it's got to be right when it's displayed, because XML could care less about JavaScript.

An RSS reader doesn't process the JavaScript and then take the resulting information as an XML stream, it just takes the raw data it's given. You could do all the document.writes and DOM parsing that you want, but it ain't gonna work in the RSS reader.

So all the computing and replacing and everything has to happen on the server side, not the client side.

Keep thinking, though.

- Julian


[8] Jorge Coelho @ 02:40AM | 2005-08-24

Ok ... how about this? Add a computed field to each post that contains the base URL (as pointed out in my previous post) . Then include a reference to this field in your view. This will work as long as you don't suddenly migrate the database from one server to another or as long as users are not accessing the database from multiple server replicas. If there is a migration to another server, a simple agent could do the trick.


[9] Michael (domB father :-)) @ 12:55PM | 2005-08-24

I think we could programmatically modify the RSS view so I imagine the following :

- in the configuration profile doc, user put it's hostname
- on query save, we modify the view column to "hardcode" the hostname


[10] jonvon @ 02:05PM | 2005-08-24

oh fine, make me go look at the db design. sheesh. you junior developers, i swear...




[11] Julian Robichaux @ 10:28PM | 2005-08-24

Hmm, I never thought about modifying the view column formula programmatically. That would be super-cool...

- Julian


[12] Tim Tripcony @ 09:28PM | 2005-08-25

One approach I've grown fond of is to create an agent named with a .rss extension (i.e. "RandomDrivel.rss") that loops through a view and formats the XML for each entry. Because the ContextDocument for agents launched this way automatically has an item for every CGI variable supported by Domino, the DNS address can be easily inserted into the URL for each entry. Just don't forget to include the initial content-type print statement that omit Domino's headers and sets the content-type to text/xml. In theory this could overload agent manager, but it hasn't caused me any problems thus far.


add a comment

name:
e-mail:
www:

HTML markup is not allowed in your comments, although URLs will be automatically converted to links (make sure there is a space before and after the URL).