|Built-in Property to publish Notes URL of selected Document|
A typical composite application use case in Lotus Notes is that you select something in a Notes view and then want to update some other component based on the currently selected document. You can do this easily in a declarative way by publishing the value of a column in a property. However this only allows publishing a column's value, not a Notes URL of the currently selected document.
In order to publish the Notes URL including the document UNID of the currently selected view entry we've added in M4 (first public beta) a so called 'built-in property'. You can configure to use this property without having to implement any code. Esentially you only need to import a certain WSDL part into your NSF and then you have to publish any other column declaratively from the same view you want to publish the Notes URL from.
Here is the WSDL:
<definitions name="Poperty Broker WSDL"
<part name="urlPart" type="idt:url"/>
<binding name="Notes_Binding" type="tns:NotesDB_Operations">
<portlet:action name="OutputPropertyOnViewEntrySelectionChange" caption="..." description="..."/>
<portlet:param name="SelectedNotesDocumentUrlChanged" partname="urlPart" caption="Notes Document URL" description="Notes Document URL"/>
As you can see in the WSDL you need to define the type 'idt:url' that I described in this blog entry. Then you need to use an output property and call it 'SelectedNotesDocumentUrlChanged'. You can also define this property via the Property Broker Editor so that you don't have to worry about the complexity of the WSDL. In that case you only need to use the name of the property.
The value of the property is a Notes URL pointing to a Notes document, e.g. "Notes://www.mycompany.com/leads.nsf/By+Rep/35AE8FBFA573336A852563D100741784?OpenDocument".
Then other components can access the document and fields in the document via the LotusScript API or Java API 'NotesSession.resolve'. This is a very powerful mechanism since you don't have to publish every field of a document any other component might be interested in. However if you use this feature your components will be tightly coupled. So you need to make a decision as to when you want to use this feature in your scenarios.
The WSDL that I've described above does not work in the first public beta since we only introduced the new type 'idt:url' recently. You can use this feature in the first public beta but need to use another datatype 'std:NotesURL' (see here).