5.7 View Specification (view.sl)

 
object GeneratedSchedule
   components: ViewType and Term and YearNumber;
   description: (*
      Initially created by the system, and modifiable by adminitrators.
      Consists of zero or more scheduled items that are seen and modified
      in the view pane.
      The Term and Year uniquely identify the schedule.
   *);
end GeneratedSchedule;

object ViewType
   components: ListView or WorkWeekView or DayView;
   operations: ChangeView and Search and ViewItem and EditItem;
   description: (*
      One and only one of the views describe what is visible in the pane.
   *);
end ViewType;

object ListView
   components: ScheduledItem*;
   description: (*
      The initial view of a generated schedule. This is a subset of the 
      generated scheduled items; based on what is in the filter. Every
      visible scheduled item is shown on its own row.
   *);
end ListView;

object WorkWeekView
   components: MonSched and TuesSched and WedSched and ThurSched and FriSched;
   description: (*
      Subset of the generated scheduled items; based on what is in the filter.
      This view is shown by diplaying the events as if they would show on a 
      calendar, starting from Monday and ending on Friday.
   *);
end WorkWeekView;

object DayView
   components: MonSched or TuesSched or WedSched or ThurSched or FriSched;
   description: (*
      Similar to WorkWeekView, except that it only shows one day rather than 
      all five.
   *);
end DayView;

object ScheduledItem
   components: CourseRecord and Instructor and RoomRecord and TimeFrame;
   description: (*
      All components need to be present in order to be a valid
      Scheduled item. Course, Instructor, and RoomRecord defined by
      other group members. 
   *);
end ScheduledItem;

object TimeFrame
   components: StartTime and EndTime and WeekDays;
   description: (*
      A timeframe for where the Scheduled Item will be held during the weeks
      of the quarter.
   *);
end TimeFrame;

object WeekDays
   components: OnMon and OnTues and OnWed and OnThur and OnFri;
   description: (*
      A group of booleans showing what days the ScheduledItem will repeat
   *);
end WeekDays;

object StartTime
   components: Hour and Minute;
   description: (*
      The time a Scheduled item starts.
   *);
end StartTime;

object EndTime
   components: Hour and Minute;
   description: (*
      The time a Scheduled item ends.
   *);
end EndTime;

object MonSched
   components: ScheduledItem*;
   description: (*
      All the scheduled items that are on this day
   *);
end MonSched;

object TuesSched
   components: ScheduledItem*;
   description: (*
      All the scheduled items that are on this day
   *);
end TuesSched;

object WedSched
   components: ScheduledItem*;
   description: (*
      All the scheduled items that are on this day
   *);
end WedSched;

object ThurSched
   components: ScheduledItem*;
   description: (*
      All the scheduled items that are on this day
   *);
end ThurSched;

object FriSched
   components: ScheduledItem*;
   description: (*
      All the scheduled items that are on this day
   *);
end FriSched;

object OnMon = boolean;
object OnTues = boolean;
object OnWed = boolean;
object OnThur = boolean;
object OnFri = boolean;
object SearchString = string;

operation ChangeView
   inputs: ViewPane, ViewType;
   outputs: ViewPane;
   description: (*
      Changes the View Pane to contain the type of view that the user wants.
   *);
end ChangeView;

operation Search
   inputs: gs:GeneratedSchedule, ss:SearchString;
   outputs: gs':GeneratedSchedule;
   postcondition: (forall (si:ScheduledItem in gs) (ss in si.CourseRecord.Title) or (ss in si.Instructor.FirstName) or (ss in si.Instructor.LastName)
      or (ss in si.Instructor.FirstName) or (ss in si.Instructor.Email));
   description: (*
      Only shows the scheduled items that match the search string
   *);
end Search;

operation ViewItem
   inputs: gs:GeneratedSchedule, si:ScheduledItem;
   outputs: si';
   precondition: (exists (si in gs));
   postcondition: (si = si');
   description: (*
      Simply load up the scheduled item to view. No changes will be made to the Scheduled item here.
   *);
end ViewItem;

operation EditItem
   inputs: gs: GeneratedSchedule, old_si:ScheduledItem, new_si:ScheduledItem;
   outputs: gs';
   precondition: (old_si != new_si) and (old_si in gs);
   postcondition: forall (si:ScheduledItem) (si in gs') iff (((si = new_si) or (si in gs) and (si != old_si)));
   description: (*
      Edit the item and place it into the generated schedule.
   *);
   



Prev: Rooms Database | Next: [None] | Up: Formal Specification | Top: index