<<>> <> <> <> <> <> 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 ¬ [], interact: InteractionProc ¬ NIL, clientData: REF ¬ NIL, log: STREAM ¬ NIL, workingDir: ROPE ¬ 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 = RECORD [ enter: BOOL ¬ TRUE, < enter the file as a local file>> check: BOOL ¬ FALSE, < check the server to verify remote existence of the file>> fetch: BOOL ¬ FALSE, < fetch the file contents (otherwise just attach)>> confirmEarlier: BOOL ¬ TRUE < attaching files with earlier create dates requires confirmation>> ]; SModel: PROC [dfFile: ROPE, action: SModelAction ¬ [], interact: InteractionProc ¬ NIL, clientData: REF ¬ NIL, log: STREAM ¬ NIL, workingDir: ROPE ¬ 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 ¬ NIL, log: STREAM ¬ NIL, workingDir: ROPE ¬ NIL] RETURNS [errors, warnings, filesActedUpon: INT]; <> <> <<>> <> InteractionProc: TYPE = PROC [interaction: REF, clientData: REF] RETURNS [abort: BOOL ¬ FALSE, abortMessageForLog: ROPE ¬ NIL, response: REF ¬ 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.