/* this belongs to the WebRaveler package */ package webraveler.vurl; import java.util.*; import webraveler.http.HTTPRequest; import webraveler.http.HTTPResponse; import webraveler.ravel.Raveler; import webraveler.ravel.RavelerException; import webraveler.ravel.RavelerUser; /** * Provides facilities for changing the configuration of a plugin for the given user * * @author The Web Raveler Development Squad * @version 1.0 */ public class PluginConfig implements VURL { String pluginName; Vector attributes; String changePrefURL; /** * Construct a PluginConfig given the plugin name, the settings desired for configuration, * and the virtual url that changes these settings * * @param pluginName a String containing the name of the plugin * @param attributes a Vector containing the attributes in the users preferences * for the plugin desired to be configured * @param changePrefURL a String containing the virtual that changes these settings */ public PluginConfig (String pluginName, Vector attributes, String changePrefURL) { this.changePrefURL = changePrefURL; this.pluginName = pluginName; this.attributes = attributes; } // PluginConfig() /** * Displays a form with textboxes for changing the given preferences of the user's settings for the plugin */ public HTTPResponse resolveVURL(String username, String query, HTTPRequest request,Raveler ravel) { String responseString = new String(""); responseString += "" + Raveler.ravelerCSS; responseString += ""+pluginName+" Configuration"; responseString += "

"+pluginName+" Configuration

"; /* Get the RavelerUser associated with the given username */ RavelerUser user = new RavelerUser(); try { user = ravel.getUser(username); /* Display a form for changing plugin preferences */ responseString += "
"; responseString += ""; for (Enumeration e = attributes.elements(); e.hasMoreElements();) { String attrib = (String) e.nextElement(); responseString += ""; responseString += ""; responseString += ""; } responseString += "
 "+attrib+"
 
"; responseString += ""; responseString += ""; responseString += "
  
"; } catch (RavelerException re) { responseString += "

"+re.getMessage()+"

"; } //catch responseString += ""; return new HTTPResponse("HTTP/1.0",200,"OK",responseString.getBytes(),new Hashtable()); } // resolveVURL } // class PluginConfig