[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

573.0. "adding attendees without user intervention?" by WPOPTH::BEESON (Down Under in the bottom left corner) Sun Apr 26 1992 11:20

    Hi,
    
    I have a little application that I want to schedule a meeting from. I
    have generated the attendees list and have it tucked away in
    CAL$SCROLL_ATTENDEES (hoping to do a CAL SCHEDULE MEETING followed by a
    CALL ADD_ATTENDEES).
    
    When I do the CAL SCHEDULE MEETING, I get an error suggesting that I
    need to meet with someone. The only way I can see of meeting someone
    is to get the user to type in a field that has a
    /SCROLL=,,,MAIL$SCL_FUNCTION:TM qualifier. Unfortunately the user will
    never get to see a form during the meeting creation.
    
    Is there another way that I can meet with someone? Am I barking up the
    wrong tree? Do I feel lonely and isolated, with severe depression
    lurking around the corner?
    
    regards,
    ajb
    
    PS: I'm using V3.0.
T.RTitleUserPersonal
Name
DateLines
573.1Verify valid contents in the dataset?BUFFER::VICKERSPerfect is the enemy of goodMon Apr 27 1992 00:1222
    Have you verified that the contents of CAL$SCROLL_ATTENDEES is what you
    expect?

    I just did:

    <for CAL$SCROLL_ATTENDEES do get "Number: '" .NUMBER "', Text: " .TEXT

    and discovered that the NUMBER field seems to be some sort of binary 
    value:

    %OA-I-LASTLINE, Number: '�', Text: MARGARET      

    All three of the addresses I entered had the Number value of � which
    seems really strange.  I created this dataset via the normal TM EV C
    option and also tried to create it via the WRITE ADD logic as shown in
    the Programmer's Reference Volume 1, page 8-32.

    Hopefully, someone can give some ideas and all I can suggest at this
    point is to verify the dataset.

    Hang in there,
    don
573.2I got around that one, but...WPOPTH::BEESONDown Under in the bottom left cornerMon Apr 27 1992 03:1547
    Hi, Don,
    
    I had a similar issue which I got around by deleting all entries a la:
    
    	for CAL$SCROLL_ATTENDEES do write del NUMBER = .NUMBER
    
    Then wrote to it, like this:
    
	COMPUTE #KEY = 1 \
	FOR SCROLL
	 DO GET #USER=.TEXT:30 \\
	    .IF PROFIL.USER[#USER] NES ""
	     THEN WRITE ADD CAL$SCROLL_ATTENDEES NUMBER=#KEY, TEXT=#USER
	     ELSE FOR GROUP$:#USER
	           DO WRITE ADD CAL$SCROLL_ATTENDEES NUMBER=#KEY,
	                                   TEXT=PROFIL:VMSUSR.USER[.VMSUSR] \\
	    .IF #USER NES "" THEN COMPUTE #KEY = #KEY + 1
    
    Where the scroll dataset contains either valid user or group names.
    
    My issue isn't with CAL$SCROLL_ATTENDEES, but rather with the first
    line of the following segment:
    
    	CAL SCHEDULE MEETING \
    	CAL ADD_ATTENDEES
    
    Since I haven't initialised a mail message (CALL MAIL_INIT) and used
    the scroll dataset MAIL$SCL_FUNCTION:TM to add addressees, the
    'CAL SCHEDULE MEETING' command fails because it believes that I have
    no one to meet with.
    
    regards,
    ajb
    
    PS: fyi:
    
    The code I am writing accepts a list of users or groups and displays a
    free time graph for each user for the specified day on an index form,
    the user can then scan forward or backward through the list of
    calendars.
    
    Optionally the user can swap to a graph which consolidates the free
    time slots for each day in the following week.
    
    From either of these views the user may create a meeting. Since the
    user has already specified the attendees during the scan, I don't want
    to make them type them all in again.
573.3It's different in V3.0!SHALOT::NICODEMWho told you I&#039;m paranoid???Mon Apr 27 1992 15:07134
	The key here is the use of V3.0.  Those who have already gotten into
TM in V3.0 know that the CAL$SCROLL_ATTENDEES DSAB is no longer used for the
scheduling of calendar events, so populating CAL$SCROLL_ATTENDEES, or searching
for entries in it, is a futile effort.

	The new design is based on the fact that in V2.n, all of the names were
first placed into one DSAB (CAL$SCROLL_ATTENDEES), and then when the mail
message containing the meeting request was created, all of the names then had
to be moved to the "TO"s of the associated mail message.  So in V3.0, TM now
creates a mail message *first*, and then uses the "TO"s of that mail message
in place of the CAL$SCROLL_ATTENDEES DSAB.

	To implement this, there is a new CALENDAR subfunction -- CAL MAIL_INIT 
-- which creats the "dummy" mail message used for this purpose.  The DSAB
referred to in .0 (MAIL$SCL_FUNCTION) now addresses the "TO" records in the DAF
of that mail message.  (Notice that even simple mail creation, on the EMHEAD
form, scrolls to "MAIL$SCL_FUNCTION:TO" and "MAIL$SCL_FUNCTION:CC" -- that
simply says "Use the TO and CC attributes of the current mail message as my
scrolling data set.")

	MAIL$SCL_FUNCTION:TM is identical to MAIL$SCL_FUNCTION:TO, in that it
scrolls to the TO attributes ofthe current mail message.  The only difference
is that, in keeping with "old" EM and TM, if you scroll to MAIL$SCL_FUNCTION:TO,
distribution lists will *NOT* be expanded, while if you scroll to
MAIL$SCL_FUNCTION:TM, they *WILL*.

	So, in answer to .0, what you will need to do from your application is
to:

	1)  Perform a CAL MAIL_INIT to create the "dummy" mail message"
	2)  Write all of the attendee names as "TO" attributes of that message
(either by using an argument form that scrolls the names to MAIL$SCL_FUNCTION,
or directly writing them into the DAF -- see below)
	3)  Perform your CAL SCHEDULE MEETING

	Also, just to keep things clean, if you have any error exit (i.e.,
unsuccessful termination), remember to do a CAL MAIL_DELETE to get rid of the
"dummy" mail message, or you'll eventually find a whole boatload of useless
messages in your CREATED folder!

	The best place to see an example of exactly how this is done is to look
at the TM Create script, TMAPMEC.SCP.  In fact, one of the enhancements to TM
that we've written here in this office actually has to manipulate this DSAB
manually.  This code stems from SES, and I've reproduced a little bit of it here
to give you an idea.

	Good luck!

	F

	P.S.  There's one other "gotcha" you're going to have to watch for as
well -- and that's due to V3.0's new "drawer" structure.  Since all mail
really needs to be created in, and sent from, the MAIN drawer, you should
always make sure that the MAIN drawer is current before doing any CAL MAIL_INIT
function.  See the V3.0 scripts for the various TM functions (e.g., TMAPMEC.SCP)
to see how they save and restore the current drawer so the user doesn't lose
context.

==============================================================================

.LABEL CLEAR_ATTENDEES
! Clear the old list of attendees, recreate scrolling file for second list
! If we come from scan, don't clear this out - it holds the scanned 
! (valid) people
	.IF #TM_SCAN NES "1"
	  .THEN 
	    CAL MAIL_INIT
	  .ELSE
	    FOR CAB$ATTRIBUTES WITH .KEY EQS "TO" DO -
	      CAB ADD_ATTRIBUTE ,"CC",.VALUE
	    CAB DELETE_ATTRIBUTE ,"TO","*"
	.END_IF

.LABEL DISPLAY_FORM
!Bring up the attendee form
        GET #TM_TYPE = "M"
	FORM TMSES_SCHDMA
	.IF OA$FORM_DISPOSE EQS "0" THEN .GOTO END

! Go schedule using the info
	GET #NOVALID="VAL_DONE"

.LABEL CHECK_PEOPLE
! Check if they have any non-validated people
! This is the new way to do this for V3.0  --  FN 12/03/91
	FOR FIRST CAB$ATTRIBUTES WITH .KEY EQS "TO"
	GET #COUNT_TO = OA$SEL_COUNT
	.IF #COUNT_TO EQ 0 THEN .GOTO ALL_VALID

!Set symbol so mail isn't sent. We have to schedule it with the not valid 
! people since add attendee doesn't recognize OA$TM_SEND_MAIL
	GET OA$TM_SEND_MAIL = "3"
	OA$MSG_PURGE
	CALENDAR SCHEDULE MEETING
	GET #STATUS = OA$STATUS
	.IF OA$MSG_ID EQS "CMNOATTEND" THEN GET #FUNCTION = "SCHEDULE MEETING" -
		\GET #STATUS = 2 \OA$MSG_PURGE ELSE GET #FUNCTION = "ADD_ATTENDEE"

!Set it back so everything else works properly
	GET OA$TM_SEND_MAIL = "0"
	GET #CAL_KEY = #TM_KEY = #TEMP_CALKEY
	GET #NOVALID=""
	.IF #STATUS EQS "0" THEN .GOTO END

.LABEL ADD_VALIDATED
!Add the validated people to the list

!	Get rid of all TOs, move all CCs to TOs, and get rid of all CCs
!	(This is the new way to do this for V3.0  --  FN  12/03/91)
	.IF #COUNT_TO NE 0 THEN CAB DELETE_ATTRIBUTE ,"TO","*"
	FOR CAB$ATTRIBUTES WITH .KEY EQS "CC" DO -
	  CAB ADD_ATTRIBUTE ,"TO",.VALUE
	.IF OA$SEL_COUNT NE 0 THEN CAB DELETE_ATTRIBUTE ,"CC","*"

	GET OA$FUNCTION="CALENDAR " #FUNCTION 
	.IF #FUNCTION EQS "SCHEDULE MEETING" AND OA$STATUS NE 1 -
				THEN .GOTO NOT_SCHED
	.IF #FUNCTION EQS "ADD_ATTENDEE" AND OA$MSG_ID EQS "NOTOADDRESS" -
		THEN OA$MSG_PURGE
	.GOTO RELATE_DOC

.LABEL ALL_VALID

!	Get rid of all TOs, move all CCs to TOs, and get rid of all CCs
	.IF #COUNT_TO NE 0 THEN CAB DELETE_ATTRIBUTE ,"TO","*"
	FOR CAB$ATTRIBUTES WITH .KEY EQS "CC" DO -
	  CAB ADD_ATTRIBUTE ,"TO",.VALUE
	.IF OA$SEL_COUNT NE 0 THEN CAB DELETE_ATTRIBUTE ,"CC","*"

	CALENDAR SCHEDULE MEETING
	GET #CAL_KEY = #TM_KEY = #TEMP_CALKEY
	GET #NOVALID=""
	.IF OA$STATUS EQS "0" THEN .GOTO NOT_SCHED

573.4WPOPTH::BEESONDown Under in the bottom left cornerTue Apr 28 1992 03:0913
    Hi, Frank,
    
    Yer blood's worth bottlin'!
    
    I looked at doing something like this but it seemed that the CAL
    MAIL_INIT didn't maintain the current document context and the TO's
    were being put (or at least attempted) to the current selected
    document. I was trying this from the command line. I tried your stuff
    in a script and it, of course, worked fine. (I guess that this is
    another gotcha).
    
    Thanks and regards,
    ajb
573.5Sounds right to meSHALOT::NICODEMWho told you I&#039;m paranoid???Wed Apr 29 1992 14:2112
� I was trying this from the command line.

	I assume, by this, that you're referring to doing an interactive command
from a menu form.  If that's the case, you have to remember that in between
every command you enter, any pre- or post-processing on that form will take
place.  On many of the primary menus (such as EM, TM, or WP), some of this
processing includes resetting the current document, which would destroy the
context you're trying to create.

	The only way to really do it, as you've discovered, is from a script.

	F
573.6And the final result?SIOG::T_REDMONDThoughts of an Idle MindThu Apr 30 1992 09:568
    ajb,
    
    Now that you've solved all the problems (with the redoubtable Mr.
    Nicodem's help), perhaps you'd like to post the completed script here?
    I'm sure that all the TM fans in the conference would appreciate the
    results of your labour.
    
    Thanks, Tony