Design suggestions needed: Too much data for text field, can't use RTF

I have a Notes application (for very demanding lawyers) which must display a long list of clients and client matters. The data is retreived using various lookups, sorted, and placed in a text field. The data is way over the 64k text field limit.

Further, the data must be manipulated. For example, the user must be able to select certain lines to remove, or re-sort the data, or move just a few lines. This manipulation currently takes place via dialog boxes which rules out using a rich text field.

All of the data must be displayed so the letter can be printed. In other words, I can’t use embedded views which will have scrollbars.

Last, I can’t use the web; this is a Notes based application.

I am at a loss as to how to design a solution. I am looking for suggestions.

Thanks in advance.

-Jeff

Subject: Design suggestions needed: Too much data for text field, can’t use RTF

How about using @PickList? This gives you a pop-up ‘view’ which also gets around the 64k limit.

Subject: Design suggestions needed: Too much data for text field, can’t use RTF

I’d opt for embedded views.For printing you can use an agend to read the view and format the output.

HTH,

Simeon

Subject: I second that. Esp. if you also use in-view editing.

Subject: Design suggestions needed: Too much data for text field, can’t use RTF

Ok, forgive me if this is a stupid idea grin but how about using the new rt table manipulation stuff in R6? I’ve seen a dynamic table database that lets you add/modify/delete table entries. Maybe you could manipulate the order as well? I don’t know. But it was a thought! :slight_smile:

Deb

Subject: Design suggestions needed: Too much data for text field, can’t use RTF

Complex and time-consuming but not impossible. I’m doing something along these lines right now (and mine has to be in Japanese) and if I can do it so can anyone else.

You have to separate from the form the logic that creates the letter. The form, while still vital, is no longer doing all the work, it’s just a vehicle for displaying whatever the logic spits out. The form probably should not contain any dblookups etc - those, or their Lotusscript equivalent, are performed elsewhere.

You should have one class - call it the back end class - that gathers all the data, adds rows, removes rows, sorts rows and so on. This class has no idea what is being done with the data and does not display it anywhere. This class might have a method on it for computing and returning the complete text of a letter - everything from the date at the top to the cc at the bottom. (Such a method would be useful if you needed to use the class in an agent where front end objects are not allowed.) Or it might return the complete text as an unsaved notesdocument, or it might have methods for doing either.

Another class - the front end class - takes that data and pushes it onto the form. For example you might have a computed text for the address - the front end object would get the address data from some back end method and push it onto the form using uidoc.fieldsettext(). This class doesn’t know where the data comes from, it just asks the back end to return the address. This class has methods for doing picklists, dialogboxes and so on. The front end class is a wrapper both for the back end object and for notesuidocument.

The front end class will probably, for simplicity, contain an instance of the back end class, just as notesuidocument returns a handle to a document.

The form should contain an instance of both a front end and a back end object in its declarations event. The back end object is obtained after the front end is instantiated.

Very rough outline:

public class LetterBackEnd

public notesdocument document

sub new(d as notesdocument)

set me.document = d

' call methods for finding the data we want, preparing lists and so on.

end sub

’

’ other methods here…

’

public function HardCopyText as string

' figure out the text of an entire letter using current settings, return it as a string suitable for previewing in a form.

end function

public function HardCopyDocument as notesdocument

' figure out the text of an entire letter using current settings, return it as a notesdoc.

end function

end class

Public Class LetterFrontEnd

public BackendLetter as backendletter

private ws as notesuiworkspace

private uidoc as notesuidocument

sub new

set me.ws = new notesuiworkspace

set me.uidoc = me.ws.currentdocument

set me.BackendLetter = new BackEndLetter( uidoc.document )

me.paint

end sub

public sub Paint

' pushed various values onto the uidoc field, and calls uidoc.refresh.

end sub

End class

Form declarations event:

use “FrontEndLetter” ← this script library uses “BackendLetter”, ie, you can use BackEndLetter alone in an agent.

dim FrontEnd as FrontEndLetter

dim BackEnd as BackEndLetter

Form PostOpen

set FrontEnd = new FrontEndLetter

set Backend = FrontEnd.BackEndLetter

So there are two distinct jobs here: coming up with a set of logic - pretty much all of it Lotusscript, in this model - for getting and sortng the data, and another set of logic for creating a letter from that data.

So, complex but definitely doable.

Mail me if you want more details - thomas.kennedy@nospamplease.towersperrin.com

Subject: Design suggestions needed: Too much data for text field, can’t use RTF

Hey folks, thanks for the good suggestions. I hope you’re all still monitoring this thread, because I could use some more. Right now, I’m trying the embedded folder method. My boss has relented on allowing scrollbars (and we will work on getting the users to accept).

One issue I have with the embedded folder is that the documents moved to the folder are not saved in the open document. That is, the open document (the one with the embedded folder) can’t do any processing based on the documents in the folder. How would I get a list, or partial list, of the clients or matters in the embedded folder?

Thanks for your help.

-Jeff

Subject: RE: Design suggestions needed: Too much data for text field, can’t use RTF

Use NotesDatabase.GetView to get a handle to the folder. Use notesView.CreateViewNavFromCategory to get a collection of the view entries corresponding to the current containing document.

Subject: RE: Design suggestions needed: Too much data for text field, can’t use RTF

I’m not quite sure how this would work. Are you suggesting that I categorize the folder by the document ID of the open document and then show single category within the document? That wouldn’t work because the existing documents which would be placed in the folder do not have a field (er, item) with that value in it.

Did I mention that the documents in the folder are in a reference database where I may not modify the them?

I wonder if there is a way to create the folder as private (or shared, private on first)? Then, whenever a document is moved into the folder, it would only be for that single user.

Another issue I have is that the other folder (there’s actually two) needs to show only the categories, or, just the unique values of the clients selected.

In other words, the first folder has to show only the clients, the second folder has to show the matters categorized by client. But there is no Client document, there are only Matter documents, and the list of clients has to be culled from the matter documents. How could I display something like that in an embedded folder? The only idea I can think of is to create new documents for every client found, but I’m not sure that’s feasible.

Thanks Andre (and anyone else who contributes) for your suggestions.

-Jeff

Subject: RE: Design suggestions needed: Too much data for text field, can’t use RTF

I was assuming that you were displaying a subset of the items in the folder – I guess that was wrong.

The problem with putting search results in a shared folder is that, if more than one user is doing this at the same time, they will interfere with each other. You would need to make it a shared, personal on first use instead. These articles contain examples of that:

Extend the Power of Notes Views: Techniques for Creating User-Based Views and Query Assistants in the Notes Client

Extend the Power of Notes Views: Techniques for Enhancing Selection and Performance

Subject: RE: Design suggestions needed: Too much data for text field, can’t use RTF

Maybe you should complain to the author that he is using your name .

I’ll read them. Thanks.

In the meantime, I’ve now changed it to use two embedded, shared folders. The folders are categorized by a document key, and they are embedded as single category views (folders). Instead of saving the data on the document, I’m creating new, very small documents which exist just to appear in these folders. So far so good.

Andre, if you’re still monitoring this thread, I read the first of your articles. It’s very useful. But how do you get an embedded view to refresh after documents are added or removed? I can’t figure it out.

Thanks.

-Jeff

Subject: RE: Design suggestions needed: Too much data for text field, can’t use RTF

Oh, I don’t like this business of creating documents just to display something in a folder. You’ll have to delete them, and that means that you’ll leave behind millions of deletion stubs, which will almost immediately start to affect performance and ultimately may start causing errors. If you do this it will need to be in a simple little local database that you can set to retain no deletion stubs – not in the main database.

I don’t offhand know how to force the view to refresh, except by closing and reopening the document that displays the view. You can do this in LotusScript using NotesUIDocument.Close(True) followed by NotesUIWorkspace.EditDocument (specifying the NotesDocument object you got from NotesUIDocument.Document). Maybe someone else can suggest something better.