Customizable menus

Brian K. White brian at aljex.com
Fri Nov 4 14:59:38 PST 2005


----- Original Message ----- 
From: "Jeff Harrison" <jeffaharrison at yahoo.com>
To: <filepro-list at lists.celestial.com>
Sent: Friday, November 04, 2005 4:42 PM
Subject: Customizable menus


> filepro dmakemenu 5.0.13.D4  SCO Unix
>
> I have the need to show the company name on all of a
> client's menus.  The problem is that this client is
> running multiple companies by using qualifiers.
>
> With Menu Master/Maestro this was pretty trivial, but
> I am struggling to do this with filepro menus.
>
> I figured that I could copy all of the menus to a
> holding area called $PFDIR/filepro/menuorig,  Then
> just before calling a given menu I would copy/edit it
> on the fly and substitute my string into the menu
> file.


We do 2 things:
First all company enviroment setup happens in a single company start script 
for each company.
No more menu F5 files that set PFQUAL etc... every company has a start 
script, and all work in that company uses that script.
The script can parfom one command in the env and leave you still in the env 
you are in, or you can run the script by itself and it moves you into that 
env until you exit.

top level qualifier menus and other places that need to dip into other 
companies use the scripts.

so for developing you say
# aaa
and it sets a bunch of variables and execs a new shell at the end and your 
are then in the aaa env.
things like pfqual and pfdldir and pftmp have been set to per-company values 
that don't collide with other companies

in a users .profile at the end you usually have one of two common things

exec p qual
or
exec aaa p main

in the qual menu the action lines look like:

1 : aaa company
aaa p main
2 : bbb company
bbb p main
3 : ccc company
bbb p main

a different menu that needs to just do some particular action in each 
company not run that companies main menu, might look like this:

1 : aaa activity
aaa rreport journal -f activity -u -s recent -h "recent activity"
2 : bbb activity
bbb rreport journal -f activity -u -s recent -h "recent activity"
3 : ccc activity
ccc rreport journal -f activity -u -s recent -h "recent activity"

and it wouldn't matter what company you are in when you hit this menu, you 
can run a command with the start script for a given company from within any 
other company at will.
you do want to avoid unecessary nesting but it's an efficiency guidline not 
a rule necessary for functionality

In cron jobs and cgi scripts you might have special reports that run from a 
specific company or a list of them:

COMPANIES="aaa bbb ccc"
for COMPANY in $COMPANIES ; do
        $COMPANY rreport payables -f dailysum ...
done

The start script sets, among other things, a variable COMPANY, and all 
variables it sets are exported so they live through the entire session and 
wherever they go in the app, the app can refer to these variables when 
necessary for odd things that aren't already handled naturally by fp itself 
by virtue of the PF variables. Like storing, or looking for, scanned 
documents in "/pix/"{getenv("COMPANY"){"/"{@fi{"/"{1{"-*.png"   etc


Ok, I know that all seems like a diversion but the point is, because we only 
ever set up a companies environment that way, we have 2 things we can do in 
those start scripts and it works almost everywhere. It only works because we 
always use those start scripts to get into those companies. We don't a have 
a lot of menus and .profiles and other things scattered around that set 
PFQUAL directly. everything uses the start script.

One thing is we set PFNAME, which puts "current file name aaa company 
(ttyp123)"
And I manually binary edit runmenu to change "file name" to "workspace" in 2 
places.

The other thing is we take the same "aaa company (ttyp123)" string and use a 
little script I call wtitle to send an escape sequence to the terminal that 
puts the value into the title bar.
I just say "wtitle $PFNAME" actually.

The script can write to the title bar of several terminal emulators 
(including facetwin, anzio, & putty) and even xterms & rxvt on <unix of your 
choice> most of the other xterm replacements like ksession, gome-terminal, 
eterm etc all understand the xterm sequence so it works on most all 
unix/freebsd/linux xterminals. It tests a coupel environment variables that 
some terminal programs are known to set, and failing to find any of thise it 
just sends the xterm sequence which works on many terminals and doesn't 
cause more than a harmless beep on most that don't understand it. (the sco 
console beeps for example, other programs ignore it silently, most actually 
understand it)

It looks like this:
http://nj.aljex.com/images/fptitle.gif

In the old days, we deliberately forced the pfterm to be a mono-only 
termcap, and we used setcolor to set the basic foreground & background to a 
different color combo for each company. A green screen with white text meant 
company b, yellow on blue meant c, etc... but all manus, screens, dialogs 
all had the same colors which is kind of not too attractive these days.

Brian K. White  --  brian at aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



More information about the Filepro-list mailing list