[apparatus-templi] Re: CGI Scripts

  • From: Jonathan Nelson <ciasaboark@xxxxxxxxx>
  • To: apparatus-templi@xxxxxxxxxxxxx
  • Date: Sun, 26 Jan 2014 14:11:08 -0500

I didn’t see anything in the cgicc page about connected to a java backed. 
Parsing a log file every time the cgi script is run will have some limitations:
-it will be hard to know how far back to process (drivers will update as they 
see fit, and might not log anything)
-adding support for streaming binary data will be very complicated
-the cgi script will hold duplicate (and possibly outdated) information that is 
already held in the drivers

You might be better off using a library that allows direct access to java 
(something like http://php-java-bridge.sourceforge.net/pjb/how_it_works.php). 
This way the cgi program can issue a direct call to 
Coordinator.getRunningDrivers() to get a list of drivers running, and a direct 
call to each drivers getWidgetXml() to get the XML data. This way no parsing is 
needed, and the drivers do not need to log anything beyond 
debugging/warning/error messages. The coordinator will always have up-to-date 
information on what drivers are running, and the drivers themselves will always 
have the most recent information on the remote modules they control.

Keep in mind that java already includes a built in simple http server 
(http://docs.oracle.com/javase/7/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpServer.html).
 It would be pretty simple to parse GET requests and return the results of the 
methods above. User verification could tie in with the mysql database.  

--  
Jonathan Nelson


On Sunday, January 26, 2014 at 2:58 AM, Christopher Hagler wrote:

> I found a very good library for making CGI scripts that I am going to use. It 
> was written by GNU, so it can be trusted more than the other ones. I decided 
> to go with the c++ because it makes writing it easier. The next time we meet, 
> I would like to discuss what exactly the CGI Script is going to do. I would 
> be really easy to have the CGI script read a log file of the currently 
> running modules and return it as html or xml to a widget, web browser, or 
> whatever else. Here is the library: 
> http://www.gnu.org/software/cgicc/doc/index.html




Other related posts: