Feature CGI

Description and Priority

To ease the use of YakTrack for the casual user, the system should provide some features for web-based operation. This will be provided by a series of CGI (Common Gateway Interface) scripts which operate with the repository in conjunction with a series of user-customizable HTML templates which are modified on the fly to produce output compatible with a standard HTML browser. The cgi scripts will provide the ability to list reports, query both via a "free query" string and a simple form, submit reports, edit reports, and register new templates with the online repository. Further implementations will likely involve some security issues as well, since most repository maintainers will not desire free access to old issues, etc.

Stimulus/Response Sequences

CGI.CHANGE-HTML-TEMPLATES.UC

Description

After the user requests a web page via the CGI script, the system should identify the template required, load it, modify required nodes, and present it to the user as HTML text

Requires

Existence of a template in the cgi-templates subdirectory of the CGI script's directory
A defined class to handle mutation of the template prior to presentation

Ensures

A properly formatted string of HTML text available for presentation to the user

Frequency of Use

Very high for the CGI scripts; none if CGI scripts are not used

Normal Course

Table 4-23. Normal Course of Action

Actor ActionsSystem Actions
Requests a cgi script activationIdentifies the required template in the cgi-templates subdirectory
 Loads the required template into memory in the form of a DOM tree
 Iterates through the nodes of the tree, identifying nodes with a "yaksubid" attribute
 Based on the value of the "yaksubid" attribute, modifies the identified nodes according to program logic
 Presents the results to the user as HTML text.

CGI.SWITCHBOARD.UC

Description

The user is presented with a menu containing a selection box and a radio-button menu for selecting an action. The user selects a template and an action and is directed to the appropriate response from a CGI script.

Requires

An installed cgi script with template

Ensures

Feedback to the user in the form of HTML text

Normal Course

Table 4-24. Normal Course of Action

Actor ActionsSystem Actions
Calls up the URL of the CGI switchboard via web browserCustomizes the switchboard template to show a selection list with all available templates and a radio-button menu for the next selection
Selects a template and action, and submits the form for responseIdentifies the selection made by the user
 Modifies the appropriate template and presents it to the user as HTML text

CGI.LIST.UC -- list a report

Description

The user, having selected a template, is presented with a list of all issues filed under that template type and a blank text line where she can type in an issue identifier. Once the user is done identifying selections to list, she submits the form via http and is rewarded by a list of issues in HTML format

Requires

An installed repository

A valid selected template name

Ensures

Feedback to the user in the form of HTML text

Normal Course

Table 4-25. Normal Course of Action

Actor ActionsSystem Actions
Fills in the blank input line with an issue id and/or selects an issue or issues in the multiple selection list box, then submits the formLoads the appropriate template
 Submits the list of IDs to the CAT feature
 Obtains the results as a string of XML text
For each node in the response, creates an HTML node representing a listing of that issue, or feedback if the issue does not exist. The HTML nodes will be in table form; for each leaf of the issue tree, the system will create a row containing the leaf name in appropriate headline style (further "nested" children will have deeper headline styles), a small table listing attributes and their values, and a line containing the text of the elements; children will be presented as a "sub table" indented one cell.Adds these nodes to the template via the CGI.CHANGE-HTML-TEMPLATES.UC use case
 Returns the text to the user

CGI.FREEQUERY.UC -- query an issue type based on a query match-expression

Description

The user can query the repository as per the QUERY feature; the match-expression is given to the system via a text fillin line in an HTML form, and responses are displayed in a fashion similar to the CGI.LIST.UC use case.

Requires

An installed repository and CGI scripts, plus requirements from the QUERY.UC use case

Ensures

Response to the user as per the CGI.LIST.UC use case

Frequency of Use

Medium -- most casual users will prefer the CGI.QUERY.UC form, despite its reduced power

Normal Course

Table 4-26. Normal Course of Action

Actor ActionsSystem Actions
The user will fill in a text line in an HTML form with the text of their match expression (using the same rules as the QUERY.UC use case).Loads the appropriate response template
 Submits the text of the match expression to the QUERY feature
 Interprets the results of the QUERY as a string of XML text
 For each node in the response tree, creates an HTML node in the same format as the CGI.LIST.UC use case and appends it to the appropriate section of the template
 Presents feedback to the user as a string of HTML text

CGI.QUERY.UC -- query an issue type based on the contents of a simple form

Description

The user is presented with a simple form detailing the attributes of the first level of a template, and its immediate children. After the user has filled out this form and submitted it, the contents are converted into a QUERY feature match-expression and passed to the QUERY feature. The results are presented to the user as HTML text

Requires

An installed repository and all requirements of the QUERY feature

Ensures

Response to the user in the form of HTML text

Normal Course

Table 4-27. Normal Course of Action

Actor ActionsSystem Actions
 Loads the template for the query form
 Loads the requested template and creates a blank issue with default contents
 Modifies the template to include a form listing the root element's attributes, contents, and immediate child content nodes
Fills out the form with requested QUERY informationLoads the response template
 Converts the contents of the form into a QUERY-style match expression
 Passes the match expression to the QUERY feature
 Interprets the result as a string of XML text and returns it to the user as per the CGI.FREEQUERY.UC use case

CGI.SUBMIT.UC -- submit a new issue via CGI forms

Description

The system creates a form representing a blank issue of the requested template. The user fills out this form and submits it to the system, which creates an issue from the form and files it in the repository as per the FILE feature.

Requires

An installed repository and all requirements for the FILE feature

Ensures

Response to the user in the form of HTML text and a filed issue

Normal Course

Table 4-28. Normal Course of Action

Actor ActionsSystem Actions
 Loads the requested form template
 Loads the template from the repository
 Creates a blank issue from the template
 Steps through the template, creating a nested form for the user. Enumerated attributes are given "select" tags; text attributes are given one-line text fillins; text contents of elements are given "textarea" fillins.
Fills out the form and submits itLoads the response template
 Creates a new issue based on the user's information in the form
 Files the new issue as per the FILE feature
 Returns the feedback from the FILE command in the form of HTML text

CGI.EDIT.UC -- edit an existing issue via CGI forms

Description

The user selects an issue from the repository as per the LIST feature (but without allowing multiple selections). The system then loads that issue and creates a form from its contents. The user fills in that form and submits it, and the issue is submitted from there as per the CGI.SUBMIT.UC use case

Requires

An installed repository and all requirements from the SUBMIT feature

Ensures

Feedback to the user in the form of HTML text, and a changed issue in the repository

Normal Course

Table 4-29. Normal Course of Action

Actor ActionsSystem Actions
 Prepares a menu of available issues as per the CGI.LIST.UC use case but without allowing multiple selection
Selects an issue from the menu and submits his selectionLoads the appropriate response template
 Creates a form as per the CGI.SUBMIT.UC use case, inserting the values from the given issue in place of blank or default values
Fills out the form with new or changed informationFiles the new issue as per the CGI.SUBMIT use case

CGI.REGISTER-TEMPLATE.UC -- register a new issue type via CGI forms

Description

The system presents the user with a text area in which the user may type in the text of a new issue template. Once this is submitted, the system scans it for validity and then files it as per the REGISTER-TEMPLATE feature. The response from this feature is presented to the user in the form of HTML text.

Requires

An installed repository and all requirements of the REGISTER-TEMPLATE feature

Ensures

Feedback to the user in the form of HTML text, and a registered template if the user's input has been valid

Priority

Medium

Normal Course

Table 4-30. Normal Course of Action

Actor ActionsSystem Actions
 Presents the user with a text area fillin and sample template text
Fills in the text with his desired new template informationLoads the appropriate response template
 Submits the user's text to the REGISTER-TEMPLATE feature
 Returns the response to the user in the form of HTML text

Functional Requirements

CGI.CHANGE-HTML-TEMPLATES.FR1. The system should be able to load an HTML file into memory as a DOM tree

CGI.CHANGE-HTML-TEMPLATES.FR2. The system should be able to iterate through the nodes of an HTML DOM tree and identify nodes with a "yaksubid" attribute

CGI.CHANGE-HTML-TEMPLATES.FR3. The system should modify identified nodes based on the value of their "yaksubid" attribute

CGI.CHANGE-HTML-TEMPLATES.FR4. The system should present the changed text to the user as a string of HTML text

CGI.SWITCHBOARD.FR1. The system should customize a template to show a selection list of the available templates

CGI.SWITCHBOARD.FR2. The system should identify the command requested by the user and forward the user's response to the appropriate CGI feature

CGI.LIST.FR1. The system should present a form to the user so that they can fill in and/or select the ids of issues they would like to list.

CGI.LIST.FR2. The system should obtain from the user's response a list of issue IDs for listing

CGI.LIST.FR3. The system should convert each of the issues into a string of HTML nodes and insert them into the feedback

CGI.LIST.FR4. The system should identify issues which do not exist or could not be listed and present that information to the user

CGI.FREEQUERY.FR1. The system should present the user with a form in which they can supply a free query string in the form of the QUERY feature

CGI.FREEQUERY.FR3. The system should extract the match expression from the user's response

CGI.FREEQUERY.FR4. The system should submit this match expression to the system's QUERY feature

CGI.FREEQUERY.FR5. The system should interpret the result of the QUERY as a string of XML text

CGI.FREEQUERY.FR6. The system should present the response to the user in the form of HTML nodes and tables

CGI.QUERY.FR1. The system should create a blank issue from the requested template

CGI.QUERY.FR2. The system should create an HTML form from that blank issue, listing only the root elements attributes, contents, and immediate child node contents

CGI.QUERY.FR3. The system should convert the user's response into a QUERY-style match expression

CGI.QUERY.FR4. The system should submit this match expression to the QUERY feature and gather responses as per the CGI.FREEQUERY functional requirements

CGI.SUBMIT.FR1. The system should create a blank issue from the requested template

CGI.SUBMIT.FR2. The system should step through the blank template and create a form for the user

CGI.SUBMIT.FR3. For each enumerated attribute, the system should create a selection list

CGI.SUBMIT.FR4. For each text attribute, the system should create a text fillin

CGI.SUBMIT.FR5. For each editable text element, the system should create a text area

CGI.SUBMIT.FR6. Once the user has filled in the form, the system shall interpret its contents as an issue DOM tree

CGI.SUBMIT.FR7. The system should file this DOM tree as per the FILE feature

CGI.SUBMIT.FR8. The system should present the results of the FILE operation as HTML text to the user

CGI.EDIT.FR1. The system should present the user with a form for selecting the issue to edit as per the CGI.LIST.UC use case

CGI.EDIT.FR2. The system should load the requested issue from disk.

CGI.EDIT.FR3. If the issue cannot be loaded, the system should report that information to the user

CGI.EDIT.FR4. If the issue can be loaded, the system should create an HTML form based on the issue, inserting default responses corresponding to the issue's contents

CGI.EDIT.FR5. Once the user responds, the system should convert the form back into an issue and file it as per the CGI.SUBMIT.UC use case

CGI.REGISTER-TEMPLATE.FR1. The system should present the user with a text area in which the user may create a new template

CGI.REGISTER-TEMPLATE.FR2. The system should submit the user's text to the REGISTER-TEMPLATE feature

CGI.REGISTER-TEMPLATE.FR3. The system should return the response to the user in the form of HTML text