Description
The servlet interacts with jugglers of type approve to allow a "trusted" user to approve or reject products before sending them to the juggler's sinks. The servlet also allows the ids and description of products to be edited by using an edit form.
Configuration Variables
Product
The product that the servlet creates to put onto the approve juggler must be of the same format as the juggler's product in order for the juggler to function properly. The format consists of a VectorProduct with the first element containing a VectorProduct of approved products and the rest of the elements containing waiting products. The servlet does not keep the products it creates. Once it puts a product onto the juggler it doesn't use it again.
Using the Servlet
For the following lines, server-root refers to the web address of the web server running with PAM. The following GET requests describe the way in which the servlet can be used.server-root/Approve.query
This gives a listing of all active jugglers of type Approve with a link (see below for format) for each one.server-root/Approve.query?channel=channelname
This gives an html page listing all of the waiting products on the juggler. For each product, there is a link to go to a page to edit the id and description of the product. Also, for every product, there are two radio buttons marked "Approve" and "Reject" both initially unchecked, giving the user the option to approve or reject the product. For a product with an Enumeration as its content, all of the products in the enumeration are listed in the same format described above, but indented for clarity, unless the the content is a web site in which case the index page is given. The submit button at the bottom of the page sends a POST request to the servlet indicating which products to approve and reject.server-root/Approve.query?channel=channelname&index=productindex
This address should be not entered directly into a browser, but rather a link from the above page shoud be followed for each product to be edited. This page contains an html form for editing the id and description of the product with the given index. The index refers to its place in the VectorProduct. The product's id and description are given in a editable text area. A change can be made by editing the fields and clicking the submit button.
How it works
Approving and Rejecting:When the user selects which products to approve and reject, the servlet gets a list these approvals and rejections from the POST. The radio buttons each have a name corresponding to the index into the main VectorProduct of a particular product.The format of the index can be described as a regular expression: #(-#)*. For example, 1-2 means that the second element (index=1) of the juggler's product is an EnumeratedProduct. And 1-2 refers to the third (index=2) product of the second product.
The servlet gets a list key-value pairs in the form of index=value, where index is a radio button name (See above paragraph) and value is either "approve" or "reject". With these pairs and with the structure of the juggler's product, the servlet builds a new approved product containing all of the products that were approved, taking them from the juggler's product. The servlet also creates a waiting product containing the products on the juggler that were neither approved nor rejected. The products that were rejected are ignored. With these, the servlet builds a VectorProduct with the first element being the approved product. It then adds every element of the waiting product to the VectorProduct, thus preserving the juggler's product format. The juggler's product is then set to this new product, and the original is lost thus discarding the rejected products.
Editing:
The servlet gets the index of the product , an id, and a description. It then builds a new product with the new id and description, but keeping the content of the original product with the given index the same. The servlet builds a VectorProduct with the exact same structure as the juggler's product , but replacing the orginal product having the given index with the new product. The juggler's product is then set to the new VectorProduct.
Last Updated 11 Feb 1998