View documents
An AbtLnViewNote describes the properties of a Domino view. The fields in a view document hold information about the views layout, the view formulas (for example selection formula, forms formula, column formula) access rights and other view details. View documents can be used to retrieve information to build a view equivalent window in Smalltalk and to program part of the functionality provided by the view.
Note:
Most of the fields in a view document have a $-sign prefix, which means those are reserved names. You can learn about the meaning of each entry by consulting your Domino documentation.
Use the methods viewNoteByName: or allViewNotes implemented in the class AbtLnDatabase to retrieve view documents defined in a particular database.
Note:
A view document does not contain data displayed in a view. A view document is kind of meta description of how a view looks and how it operates. If you want to access data in a view, use the AbtLnDatabaseView class.
To learn more about handling formulas in Domino Connection, see Advanced topics.
View formatting -- AbtLnColumnFormat
AbtLnViewNote supplies a protocol for easy access to information about the view's columns. Each column is treated as a separate entity and is described by an instance of a class called AbtLnColumnFormat. You can ask for an OrderedCollection of AbtLnColumnFormats from your view note using the columnFormats method. The collection contains the column descriptions ordered from left to right. The first element in the collection represents formatting and functional information for the leftmost column in the view.
The class AbtLnColumnFormat offers a rich set of methods which help you find out every detail about a view column. You can read every property of the view that is accessible through the Notes client software. The following step-by-step sample shows you how to build a tool to display view definitions that works somewhat like the Domino database synopsis.
| connection database viewNote |
"Startup runtime system"
AbtLnEnvironment startUp.
"Create a connection to local databases"
connection := AbtLnConnection local.
"Open one of the sample databases provided with the feature"
database := connection openDatabase: 'VASAMPLE\VAFORMS'.
"Get the first view note from the database"
viewNote := database allViewNotes first.
"Print view information on the Transcript"
Transcript nextPutAll: 'View Name is: ', (viewNote title); cr.
Transcript nextPutAll: 'Analyzing the view Columns :'; cr;cr.
"Iterate through all columns in the selected view and print column
format information on the Transcript window"
viewNote columnFormats do: :columnFormat |
Transcript nextPutAll: 'Column Title: ', columnFormat title; cr.
Transcript nextPutAll: 'Column Item: ',
columnFormat itemName; cr.
Transcript nextPutAll: 'Column Formula: ',
columnFormat formula text; cr.
Transcript nextPutAll: 'Column Width: ',
columnFormat displayWidth; cr.
Transcript nextPutAll: 'Column isHidden: ',
columnFormat isHidden printString; cr.
Transcript nextPutAll: 'Column isSortAscending: ',
columnFormat isSortAscending printString;
cr;cr.
].
"Close the database"
database close.
"Shutdown runtime system"
AbtLnEnvironment shutDown.
Using this information you can tailor specialized windows for Domino views or even create your own generic database view display widget.
Last modified date: 01/29/2015