File: TuplesEditor.mesa
Contents: interface to a "tuples" subwindow for use by nut implementations
Created by: Donahue July 8, 1982 10:44 am
Last edited by:
Donahue, April 8, 1983 12:20 pm
Cattell, October 7, 1983 5:16 pm
Last Edited by: Butler, August 13, 1984 5:28:14 pm PDT
DIRECTORY
DB: TYPE USING[Entity, Attribute],
ViewerClasses: TYPE USING[Viewer];
TuplesEditor: CEDAR DEFINITIONS =
BEGIN
Viewer: TYPE = ViewerClasses.Viewer;
defaultOld: BOOL; -- FALSE => attributes in NewOrOld mode, TRUE => OldOnly
DisplayTuples: PROC[e: DB.Entity, attrList: LIST OF DB.Attribute, parent: Viewer] RETURNS [Viewer];
Make a viewer nested in parent containing all of the tuples in which the entity
participates (i.e., tuples with an attribute referencing the entity). The nested viewer
will also contain blank tuples for relations in which an entity of e's type could
participate. Returns the nested viewer.
SaveTuples: PROC[viewer: Viewer, newEntity: DB.Entity ← NIL] RETURNS [errors: BOOL];
Given a Viewer that has been edited by the TuplesEditor add all of its contents to the database.
Returns TRUE if any errors were reported to the user as a result of bad entries.
QueryTuples: PROC[viewer: Viewer] RETURNS [LIST OF DB.Entity];
Given a Viewer set up by DisplayTuples, finds all the entities in the given domain
that satisfy the query filled into the table by the user.
MergeTuples: PROC[viewer: Viewer, newEntity: DB.Entity ← NIL] RETURNS [errors: BOOL];
Given a Viewer that has been edited by the TuplesEditor, add all of its contents to
newEntity in the database.
Returns TRUE if any errors were reported to the user as a result of bad entries.
ResetTuples: PROC[viewer: Viewer];
Resets the viewer property that keep track of changed tuples
NOTE: for both query and editor windows: the top-level viewer containing the viewer on which EditTuples or QueryTuples is called may have a $Typescript property whose value is a stream to send error messages to. If no such stream is provided, error messages will go to the Message window.
END.