A very useful undocumented Domino URL command

The other day in the IBM Business Partner Forum (I checked the permission's it said this could be published), someone casually mentioned that there is an undocumented URL command "?OpenField".

What this URL command does, is return the HTML rendering of a specified Rich Text Field, with no head, no body tag etc.  So for example, if you were take one of the blog entries here, which are stored in a Domino database, the Rich Text I write is stored in a Rich Text Field "EntryRICH"  so if I wanted just the HTML from that field for a blog entry last week, I would enter something like:
http://www.iminstant.com/iminstant/iminstant.nsf/d6plinks/CTYR-7GZK8S/EntryRICH?OpenField

Where the format is:
Server/databasefolder/databasename/view/LookupKey/RTFFieldName?OpenField.

Why is this helpful, well I think there are a number of opportunities this provides, one is to extract out RTFs as HTML programmatically very easily, without having any LotusScript or Domino knowledge.  It makes retrieving information from RTFs to use with AJAX very easy.  I;m just getting my head around this Command, but I think it's one we'll see people use more and more.

 

 

http://www.iminstant.com/iminstant/iminstant.nsf/d6plinks/CTYR-7H6S6R

 

 

Domino Technote - Undocumented function plus cool code lets you get the current location name, thus any data from the current location in pure formula language.

By Andrew Pollack on 2006-07-01 at 23:24 EDT

 

I don't post technotes like this often, but rest assured fans of mine, the old man still knows a few things. Someone we all know and love was bouncing a problem off me. He needed to lookup the currently active location document name. @Environment wouldn't work because you can't lookup non-user variables. The tricky part is that it had to be all formula language.

He tipped me to an undocumented function "@LocationGetInfo". After dumping the mail6.ntf and pernames.ntf to dxl, I came up with only a few parameters for that function.

@LocationGetInfo([HomeServer])
@LocationGetInfo([InternetMailAddress])
@LocationGetInfo([NamePreference])
@LocationGetInfo([BookmarksFilename])
@LocationGetInfo([SametimeServer])

None of these did what we wanted. After some hacking and a little educated guesswork, I came up with this one:

@LocationGetInfo([UNID])

That was magic. Once we had that, I quickly wrote this formula to get the name. With the name, you can lookup any field on the document of course.

n := @Text(@LocationGetInfo([UNID]));
locList := @DbColumn("":"NoCache" ; "": "Names.nsf" ; "Locations"; 1);
@For( x := 1 ; x <= @Elements(LocList) ; x := x+1 ;
t := @DbLookup("":""; "":"Names.nsf"; "Locations"; @Subset(@Subset(loclist; x) ; -1) ; "Name" ; [ReturnDocumentUniqueID]);
@If(n = @Text(t) ; @Do(@Set("LocationName"; @Subset(@Subset(loclist; x) ; -1) ); x := @Elements(loclist) + 1 ) ; "")
);
@Prompt([Ok];"";LocationName)

Looking at this, the first line gets the unid of the current location. Next, we get a list of all the locations. Then we lookup each location in order and check the unid. When we have a match, we set the value of the name to our internal variable "locationName" and then also set x to larger than the list of locations so we don't do any more lookups than we have to.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值