BROWSER USER INTERFACE REQUIREMENTS: Prepared by Ilkay Altintas && Efrat Jeager -- Last update: 11/22/2004

A. USE CASES

A.1. The BrowserUI actor will be used for two purposes:
  - To display a given input
  - To interact with the user

A.2. The interaction with the user should be done via a form based CGI interface. 
  - Any input that doesn't have a form should be displayed.

A.3. Given an HTML form, the actor should:
 A.3.a. Parse the HTML content
 A.3.b. If there is a form in the doc,  replace the submission information with the Kepler web server
 A.3.c. Display the form
 A.3.d. Wait for the user's response to continue
 A.3.e. Accept and submit the submission
 A.3.f. Get back the results in XML format as <NAME/>, <VALUE/> pairs

A.4. The list of know formats that don't have forms and should be supported are:
 -- XML
 -- XSL
 -- GIF
 -- SVG
 -- JPEG
 -- JPG
 -- PDF
 -- TXT
    When you see one of these files, just pop up the browser and display it.

A.5. To launch the browser, Ptolemy's browser launcher (ptolemy.actor.gui.BrowserLauncher) should be used.
 -- The browser launcher will launch the default browser in the system.
 -- The actor should have a file parameter for the users who want to open a browser other than the default one.

A.6. If there is a relative path in the TEXT/HTML content, and if we need to save this content to a local file to replace the form submission details, then the path needs to be replaced with the full path depending on the case that it is a local file or a remote URL. If it is a local file, the previous file path needs to be added in front of the relative paths; if it is a remote URL, the server information needs to be added in front of relative paths.

A.7. In the case of a form; if the file or url is a known extension to the BrowserUI actor, the actor should save it with that extension. If the extension of the file is not known or blank, it should save it with '.html' as extension.

A.8. The html file that is generated in case of a content copy, should be deleted when there is an exception or when the actor wraps up.

B. INPUT REQUIREMENTS

B.1. The input of the BrowserUI actor can be:
 - URL: string
 - File path: string
 - TEXT/HTML: string

B.2. The input will be divided into two ports for simplicity.
 B.2.a. Port#1: This inout port acts as a port/parameter made to work in coordination with the fileOrURL parameter. (See D.3) 
     NAME: fileorURL : string
     PORT TYPE: Single port
 B.2.b. Port#2: This input port is for text/HTML content. 
     NAME: displayContent: string
     PORT TYPE: Single port (not sure! maybe we need to make this multiport for more than one images if we wanna display them in the same browser window.)

B.3. The two ports of the actor will be used one at a time. 

B.4. The actor will have an optional input for triggering (to schedule) if both input are not used. This case happens when the fileOrURL is given as an input parameter which is known on advance. (See D.3 and D.4)
     NAME: trigger : boolean
     PORT TYPE: single port

C. OUTPUT REQUIREMENTS

C.1. The actor should output the The XML output for the "<NAME>,<VALUE>" pairs: XMLToken
 
C.2. Capability for adding new output ports should be implemented.
   -- The configuration for the output ports will be done via a text style parameter.
       DEFAULT: "Please delete this text and enter the name and type of all the ports you wanna add, in the form:
           "name type", one per line."
       NAME: PortConfiguration
       FORMAT of configuration: name type, one per line

C.3. The output ports should be hidden if the actor is used just for display purposes.

D. CONFIGURATION REQUIREMENTS

D.1. Several types should only open a window.
 - This will solved by putting a check box in the configuration. 
    DEFAULT: False
    NAME: "Use for Display"

D.2. If use for display is selected, the output ports should be hidden.

D.3. The actor should have a FILE parameter to accept the url of the url or path of the file or form. 

D.4. A port to add a trigger a trigger port should be added for scheduling purposes.
    NAME: hasTrigger
    TYPE: Radio button
    DEFAULT: Unselected

D.5. If the input has a TEXT/HTML content, this content should be saved to a temporary local file.
 -- The actor should have a parameter to ask the user the extension of the file that needs to be saved.
     DEFAULT: empty
     NAME: fileFormat
     TYPE: StringParameter
     VALUES: html, htm, ...
 -- If the user doesn't enter an extension, the browser launcher will prompt the interface for opening the unknown extension.
 -- The file should be deleted after the actor wraps up.

D.6. The actor will have a configuration parameter to create new output ports according to the users input.
 -- This configuration parameter will be parsed to get the names and types of the 

-------------------------------------------------------------------------------------

DESIGN FOR THE ACTOR AND API:

1. A void function for opening and ...
