Notes has a powerful templating ability. We can roll out several instances of a single design and create an application for each workgroup to use. However, when your work covers several workgroups that overlap, you may end up switching tabs a lot.
A previous recipe (Notes Link) showed you how to do on-the-glass integration by placing several different applications within an easy tab's reach of each other. This recipe goes a step further and shows you how to take a collection of Notes views and display them in a single table or tree.
What you need
You need to collect some information on each view that you want to display merged together. We need to identify the view, and for that view, what values from documents in that view we wish to display in each column.
(v1.view) You will need a notes URL to the view that you want to display. A Notes URL is kind of cryptic and complicated and not all that easy to create by hand. It's general form is "Notes://<server hint>/<replica id>/<view name>?OpenView". If you know all those details you can fill it in. If not, here is a trick to try.
Open the Composite Application Editor (select a Composite Application and choose Actions->Edit Application). Right click the component palette to the right and select Add Component->NSF Component. In the dialog box click "Browse". Select "View" from the top drop down. Select the database you are interested in. And select the view from the bottom drop down.
Click on OK. This will fill in the add component dialog with the Notes url. Cut and paste this off into a blank copy of Notepad or something.
(v1.select) Next we need to work out which documents in the view we wish to display. If you want to display all of them, then you can leave this blank. Note: the merged table cannot display document hierarchies. So if you are showing a hierarchal view, then it's best to come up with a formula that just selects the top level documents. The easiest way to do this is by specifying the form such as Form="MainTopic". While looking at the view in question you can do a right click on a document and select "Properties". The second tab contains a list of the field names and their values. Scroll through this till you "Form", and make a note of it's value.
(v1.1) You need the name of the field that contains the value for the first column. For a standard discussion based database, this is "Categories". But other databases may use other things. Use the technique above to see what the values of various fields are and learn the names of the ones you want. Actually, this can be an @formula so you can do advanced things here if you know how to use @formulas.
(v1.2) Repeat this process for each additional column.
(v2.view, etc) Repeat the last several steps for each view that you want to merge in!
1. Drop a Notes Join - Tree component Notes Link onto an empty page.
2. Drop a Document Viewer component Notes Link underneath.
3. Adjust sizes to fit screen.
1. Notes Join - Tree.Focused -> Document Viewer.Show Document
2. Notes Join - Tree.Selected -> Document Viewer.Launch Document
Advanced Component Properties
There are several properties that are defined to tell the table how to draw itself. All are set on the Notes Join - Tree component.
First we need to tell it how to draw the columns. For each column you can set
(Note: field names are case sensitive.)
1. col.1.title = <name to appear on top bar, " " (a single space) for no name>
2. col.1.width = <width in pixes of colum, defaults to 25>
3. col.1.sort = <use "up" or "down" if a text value, "mmddyyyy_up" or "mmddyyyy_down" down if it's a date. Leave blank not to sort.>
4. cal.1.categorized = <true if you want this to be collapsed with a twistie, false or unset if you don't. Note, all the categorized columns must be on the left.
The first uncategorized column stops the tree.>
5. Repeat for col.2, etc.
Now we need to plug in the values for each view that we want to have merged.
1. source.1 = (v1.view) that we picked out above.
2. source.1.select = (v1.select) that we picked out above
3. source.1.col.1.select = the field or @formula we identified above
4. source.2 and so on for each source.
How it Works
When the component is initialized, it looks at each source. It then indexes all of the documents in the view given according to the selection criteria. All the values for all the fields are extracted. It then builds up a tree of those values.
Sound like a lot of work? Yes it is. It takes a bit of time. But it caches the information so that it's much faster the next time. This does mean, though, that it will not always be up to date. You need to right click the view and select "Refresh" to make it update.
When you click or double click a line in the table it sends that value to the Document Viewer. It either shows it as a preview, or launches that document.
It does not initially show values. You need to right click the table and select refresh to display the values.
If you also have hierarchal data, you might add in the actual views in tabbed folders (as the bitmap illustrates) for easy access.