/*
* Makes possible the web user interface. Allows users to control the program
* using a web browser.
*/
package webserver;
import definitions.Messages;
import main.core;
import org.simpleframework.transport.connect.Connection;
import org.simpleframework.util.thread.Scheduler;
import script.Plugin;
import script.log;
import www.WebRequest;
import www.WebServer;
/**
*
* @author Nuno Brito, 9th of January 2013 in Darmstadt, Germany.
*/
public class Web extends Plugin{
// title for this plugin
private final String id = "Web Interface";
Scheduler queue;
Connection connection;
public String webOutput = "";
@Override
public void startup(){
// add our node to the tree right after the "Tools" node is added
log.hooks.addAction(Messages.AddingTools, thisFile, "addNode");
startServer();
}
/**
* Add our toolbox node to the treeview.
*/
public void addNode(){
addTreeNode(id, "network-clouds.png", "showServerStatus");
}
/**
* Displays the menu for creating new SPDX documents
* @param request the request for this method
*/
public void showServerStatus(WebRequest request){
request.setPage("serverSettings.html");
}
/** Start our instance */
public void startServer(){
WebServer server = new WebServer();
server.startServer();
core.temp.put("server", server);
}
}