Michael Elhadad

Software Engineering - Fall 1999


Programming Assignment 2 -- Object Model with CORBA and SMIL

Objective

Due Date:

  1. Sun June 20, 1999.

References

  1. The W3C Consortium home page of SMIL.
  2. The SMIL DTD (grammar defining well-formed SMIL documents).
  3. A tutorial on SMIL from builder.com with lots of pointers.
  4. XML4J documentation.
  5. Working with URLs in Java (for file transfers).

Object Classes

The Object model is the same as for Assignment 1.
a Site: contains a set of Channels
a Channel: contains a set of ScheduledEvents
a ScheduledEvent: is made of a Lecture, a Scheduled Time and a Duration.
a Lecture: is composed of Assets and a composition file.
an Asset: is made of a MaterialFile and meta-data
	: belongs to one or more AssetCategories
an AssetCategory: contains Assets
	: belongs to a parent AssetCategory
Each class is characterized by the following properties:
Site: name, address, port.
Channel: name.
ScheduledEvent: Lecture, Scheduled Date and Time and Duration.
Lecture: Name, Lecturer Name, CompositionFile Name
Asset:  MaterialFile, Type (one of: Audio, Video, Picture, Text)
           and Size.
AssetCategory: Name and Parent.
In addition, we will implement handling of the MaterialFile using an XML parser (XML4J from IBM) on SMIL files.

IDL

Design the IDL for the Object Model.

Client Definition

The client must be a command-interpreter receiving the following commands:
  1. getChannels: instantiates an object for each channel existing on the server and lists the name of each one with its handle. Each channel object is now accessible through its handle.
  2. getAssetCategories: Return the root of the asset categories from the server as an object reference.
  3. getLectures "lecturer-name": Return the list of lectures stored on the server for the lecturer.
  4. addLecture "name" "lecturer-name" "smil-URL": Add a lecture for the lecturer.
Each time an instance of an object is created, it can be accessed using the syntax:
Ch1 getSchedEvents 1/1/1999 31/12/1999
That is, the handle of the object is used, followed by the method and its arguments. Each time a method returns an object or a list of objects, it prints the name or list of names with a unique handle for each of the objects. The client maintains a symbol table to associate these handles with the object instances it has created (use Java's hashtable container).

Even when the name of an object is modified, its handle remains constant.

The following methods must be implemented for each class. From the client, each time an object is passed as a parameter, it is expected that the name of an object of the appropriate type is passed: New features requested (which were not requested in assignment 1) appear in red.

  1. Channel:
    1. SchedEventList getSchedEvents(Date from, Date to) throws EBadParam;
    2. void addSchedEvent(
      Date start,
      int duration,
      String lectureName,
      String lecturerName,
      String compositionFileName) throws EOverlappingEvents;
  2. SchedEvent:
    1. Lecture getLecture();
    2. void setLecture(String LectureName,
      String lecturerName,
      String compositionFileName);
    3. Date getScheduledDate();
    4. void setScheduledDate(Date start) throws EOverlappingEvents;
    5. int getDuration(); // in minutes
    6. void setDuration(int dur) throws EOverlappingEvents;
  3. Lecture:
    1. AssetList getAssets();
    2. String getCompositionFile();
    3. void setCompositionFile(String filename);
    4. String getName();
    5. void setName(String name);
    6. String getLecturer();
    7. void setLecturer(String lectname);
    8. [NEW] To implement the getAssets() method, you must parse the SMIL composition file associated to the lecture, and return all the files to which it points. To do this, you must parse the SMIL file (using XML4J), and traverse the resulting DOM node (the parse tree), accumulating all nodes of type "Media object element" that have an explicit SRC attribute.
  4. Asset:
    1. String getMaterialFile();
    2. void setMaterialFile(String fname);
    3. int getType();
    4. void setType(int t); // 1=Audio, 2=Video, 3=Picture, 4=Text
    5. int getSize();
    6. void setSize(int s);
  5. AssetCategory: Asset Categories are implemented as a directory on the server with sub-directories for each sub-category.
    1. AssetList getAssets(); // return member assets
    2. AssetCategoryList getChildren(); // return sub-categories
    3. AssetCategory getParent(); // null for root
    4. String getName();
    5. void setName(String name);
    6. [NEW] void AddAssetCategory(String name); // add a subdirectory
    7. [NEW] void AddAsset(URL MaterialFileURI); // add a new file -- copy it

Server

The server maintains access to a list of channels, asset categories (represented by a directory), and archive lectures for each lecturer. The lectures are stored in a directory per lecturer.

File transfers are performed using the Java URL methods which are documented here.

Channel schedules must be stored in a persistent storage. Use the Java serialization methods on channels to update the persistent storage wherever a channel Java object is modified.

An initialization file must be loaded when the server starts to specify where the directories for lecturer archives and asset categories are located. The same file also specifies which channels are available and where the persistent channel schedule is to be stored.


Last modified June 6th, 1999 Michael Elhadad