<> <> <> <> DIRECTORY BasicTime USING [GMT], IO USING [STREAM], Rope USING [ROPE]; DFOperations: CEDAR DEFINITIONS = BEGIN OPEN BasicTime, IO, Rope; <> <<>> <> BringOver: PROC [dfFile: ROPE, filter: BringOverFilter _ [], action: BringOverAction _ enter, interact: InteractionProc _ NIL, clientData: REF ANY _ NIL, log: STREAM _ NIL] RETURNS [errors, warnings, filesActedUpon: INT]; <> <> <> <> <> BringOverFilter: TYPE = RECORD [ filterA: BringOverFilterA _ $all, filterB: BringOverFilterB _ $all, filterC: BringOverFilterC _ $all, list: LIST OF ROPE _ NIL ]; <> BringOverFilterA: TYPE = {source, derived, all}; <> BringOverFilterB: TYPE = {public, private, all}; <> BringOverFilterC: TYPE = {defining, imported, all}; <> BringOverAction: TYPE = {enter, check, checkAndEnter, fetch}; <<'enter' means that an attachment will be made in the directory without contacting the file server. 'check' contacts the file server and verifies that the specified remote file actually exists (an error occurs if it doesn't). 'checkAndEnter' combines the previous two, performing the 'enter' portion only if the 'check' portion succeeds. 'fetch' is equivalent to 'checkAndEnter' except that the file is copied rather than attached.>> SModel: PROC [ dfFile: ROPE, action: SModelAction _ [], interact: InteractionProc _ NIL, clientData: REF ANY _ NIL, log: STREAM _ NIL] RETURNS [errors, warnings, filesActedUpon: INT]; <", the file will be stored only if the local file is newer than the remote one.) The details of this comparison are controlled by 'action.remoteCheck'; see below. If any files are stored, SModel writes a new local version of 'dfFile' with appropriately updated dates. 'dfFile' is permitted to contain a self-reference, which SModel will handle properly; however, defining occurrences for 'dfFile' that occur elsewhere will be incorrect. Note that an "Include" item in the DF file will cause a recursive invocation of SModel for the included DF file.>> <> SModelAction: TYPE = RECORD [remoteCheck: BOOL _ TRUE, storeChanged: BOOL _ TRUE]; <> <> Verify: PROC [ dfFile: ROPE, interact: InteractionProc _ NIL, clientData: REF ANY _ NIL, log: STREAM _ NIL] RETURNS [errors, warnings, filesActedUpon: INT]; <> <> <<>> <> InteractionProc: TYPE = PROC [interaction: REF ANY, clientData: REF ANY] RETURNS [abort: BOOL _ FALSE, abortMessageForLog: ROPE _ NIL, response: REF ANY _ NIL]; <> <> InfoInteraction: TYPE = RECORD [class: InfoClass, message: ROPE]; <<'message' conveys a message of possible interest to the user; 'class' indicates its importance. No 'response' is expected.>> InfoClass: TYPE = {info, warning, error, abort}; DFInfoInteraction: TYPE = RECORD [action: DFInfoClass, dfFile: ROPE, message: ROPE _ NIL]; <> DFInfoClass: TYPE = {start, end, abort}; <<'start' means processing of the DF is beginning; 'end' means it is ending; 'abort' means that processing has terminated prematurely. 'abort' will only be reported for the outermost DF file (i.e., the one passed to the operation procedure). In cases where an operation is aborted, there is no guarantee that 'start's and 'end's will always be paired.>> AbortInteraction: TYPE = RECORD [fromABORTED: BOOL]; <> FileInteraction: TYPE = RECORD [ <> localFile: ROPE, remoteFile: ROPE, dateFormat: FileDateFormat, date: GMT, action: FileAction ]; FileAction: TYPE = {fetch, store, check}; FileDateFormat: TYPE = {explicit, greaterThan, notEqual}; ChoiceInteraction: TYPE = RECORD [ <<'message' is a question for the user. 'choices' is a set of valid responses to the question. 'explanations' is a set of prose explanations (corresponding one-for-one with 'choices'), which are intended to assist the user in understanding the semantics of the choices. The InteractionProc is expected to converse with the user and return the index in the `choices' sequence of the one selected by the user. If no InteractionProc is supplied or if the InteractionProc omits a response, the DF operation behaves as if `default' were chosen. If 'response' is not defaulted (i.e., is non-NIL), it must be a REF ChoiceResponse. Note: if 'blunder' is TRUE, the client may wish to ensure that the human user has a chance to make the choice explicitly, since something fairly serious is (about to go) wrong. >> message: ROPE, blunder: BOOL _ FALSE, choices: REF Choices, explanations: REF Explanations, default: NAT ]; Choices: TYPE = RECORD [SEQUENCE length: NAT OF ROPE]; Explanations: TYPE = RECORD [SEQUENCE length: NAT OF ROPE]; ChoiceResponse: TYPE = RECORD [choice: NAT]; YesNoInteraction: TYPE = RECORD [ <> message: ROPE, blunder: BOOL _ FALSE, default: BOOL ]; YesNoResponse: TYPE = RECORD [BOOL]; <<>> END.