summaryrefslogtreecommitdiff
path: root/src/server
AgeCommit message (Collapse)Author
2013-07-29Cloud & PGF service: use Content-Type application/json for JSON outputhallgren
This is in accordance with RFC 4627. http://tools.ietf.org/html/rfc4627 Use application/javascript for JSONP output.
2013-07-25Allow cross origin requests to GF cloud & PGF serviceshallgren
By adding a header Access-Control-Allow-Origin: * to the HTTP responses, web browsers are informed that it is OK to call the services from web pages hosted on other sites. This is apparently supported in most modern browsers, so it should no longer be necessary to resort to JSONP. See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
2013-07-15gf-server.cabal: same changes as in gf.cabal for ghc-7.6 compatibilityhallgren
2013-06-13Fix UTF-8 decoding problem in gf -serverhallgren
The package network-2.4.1.1 thoughlessly introduced a backward incompatible change to the function Network.URI.unEscapeString, see https://github.com/haskell/network/commit/f2168b1f8978b4ad9c504e545755f0795ac869ce This also affects the function Network.Shed.Httpd.queryToArguments, which is used in GFServer.hs. To remain compatible with older and newer versions of the network package, we need to stay clear of queryToArguments and unEscapeString. A replacement function has been added to server/URLEncoding.hs.
2013-04-24PGF service: apply the token binding operator &+ to all linearizationshallgren
The &+ operator is now consistently eliminated from the output of commmands that produce linearizations. Before, only the commands translate and translategroup did this.
2013-03-28PGF web API: command=abstrtree not supports the nocat and nofun optionshallgren
2013-03-27PGF web API: add comand linearizeTablehallgren
The new command linearizeTable outputs linearizations as tables containing all variants and forms, labelled by parameters
2013-03-26PGF service: support all parse tree visualziation options in the web APIhallgren
The new options are * noleaves, nofun, nocat (booleans, false by default) * nodefont, leaffont, nodecolor, leafcolor, nodeedgestyle, leafedgestyle (strings, empty by default)
2013-03-13PGF web API: add 'to' parameter to the 'alignment' commandhallgren
Word alignment diagrams can now be restricted to a subset of the languages supported by the grammar.
2013-03-13PGF web API: generalize the 'to' parameter to accept a list of languageshallgren
Some commands (linearize, linearizeAll, random, generate, translate and translategroup) by default produce output in all languages supported by the grammar and the 'to' parameter could be used to restrict output to a single language. Now you can restrict the output to a list of languages. Languages should be separated by spaces. Also removed an unnecessary LANGUAGE pragma and reduced code verbosity.
2013-03-09ghc-7.6: allow directory-1.2Sergei Trofimovich
Get rid of old-time depend (and ClockTime in favour of UTCTime). time-compat helps to retain backward compatibility with directory-1.1 and lower.
2013-03-09ghc-7.6: fix src/server/PGFService.hs (use catch from base-4 Control.Exception)Sergei Trofimovich
2013-01-18Add fun/cat printnames to PGF web servicejohn.j.camilleri
This is accessible vis the `browse` command, by adding the flag `printnames` e.g.: .../Letter.pgf?command=browse&id=Recipient&format=json&printnames=1
2013-01-09Fixes for minibar offlinehallgren
Tested it in Firefox 18 (which has the new Ionmonkey JavaScript engine). Still get stack overflows.
2013-01-09PGF service: new command: downloadhallgren
This makes it possible to download PGF files from servers where the PGF service is installed. I am also considering making commmand=download the default instead of command=grammar.
2012-12-20PGFService.hs: code duplication reductionhallgren
2012-11-22PGFService.hs: fix type error caused by change to PGF.graphvizParseTreehallgren
Note that some of the graphviz functions have backwards incompatible changes that might also affect other clients of the PGF run-time library. Also added graphvizDefaults and export it together with GraphvizOptions from the PGF run-time library.
2012-11-17PGF service: command=browse&format=json returns info on all cats and funshallgren
The browse command used to have a required parameter id=... and it returned info on the given identifier only. Now, if format=json, the id=... parameter can be omitted to get info on all identifiers at the same time. The returned JSON structure in this case is {cats:{...},funs:{...}} where the inner objects contain one field per category and function, respectively, in the same format as when you request info on one category or function.
2012-09-30PGF service & minibar: put a limit on the number of parse treeshallgren
+ In the PGF web service API, the commands parse, translate and translategroup now accept a limit parameter. It limits the number of parse trees returned. If no limit is given, the behaviour is backwards compatible, i.e. no limit is applied. + In minibar, the limit is now set to 25 by default. This change is based on a suggestion by Kaarel Kaljurand.
2012-04-02gf-server.cabal: mtl is needed to build pgf-server nowhallgren
2012-04-02PGFService.hs: add web API function "abstrjson"hallgren
Abstract syntax trees are represented as strings in the web API. To make them easier to manipulate in JavaScript, the new function converts them to JSON. To support structural editing, the nodes are numbered in the same way as in the bracketed string created when linearizing an abstract syntax tree. Example: "Pred (That Fish) Fresh" is converted to {fun:"Pred",fid:3, children:[{fun:"That",fid:1, children:[{fun:"Fish",fid:0}]}, {fun:"Fresh",fid:2}]}
2012-03-18PGF run-time library: function names in BracketedString (experimental)hallgren
+ Make room for function names in the BracketedString data structure. + Fill in function names when linearizing an abstract syntax tree to a BracketedString. + Fill in wildCId when it is not obvious what the function is. + Function bracketedLinearize: for compatibility with the other linearization functions, return Leaf "" instead of error "cannot linearize". + Export flattenBracketedString from module PGF. + PGFServce: make function names available in the JSON representation of BracketedString.
2012-03-16PGFService.hs: command=browse can now produce output in JSON format.hallgren
To get JSON output, add the parameter format=json. The JSON structure contains the output from the function PGF.browse. The default is format=html for backwards compatibility.
2012-03-08PGFService.hs: add output format option to the commands abstrtree, parsetree ↵hallgren
and alignment Supported output formats: gv, png, svg.
2012-03-05gf-server.cabal: always build the fastcgi module (pgf-server), lower version ↵hallgren
requirement on the cgi package + The flag fastcgi is removed: building the fastcgi is the main purpose of this cabal file again. + pgf-http superseded by gf-server, but is still available as an option + Require cgi>=3001.7.3 instead of cgi>=3001.8.0.
2012-02-29PGFService.hs bug fix: pattern match failure in doParsehallgren
doParse was missing a branch for PGF.ParseIncomplete. Also introduced the operator .= to simply the code that builds JSON objects.
2012-02-23src/server/ContentService.hs: fix compilaton problemhallgren
2011-10-18pgf-http setup: update path to minibarhallgren
2011-10-18pgf service: include the start category in grammar infohallgren
2011-10-10More functionality in "gf -server" modehallgren
"gf -server" mode now includes PGF service and the services to support example-based grammar writing. (But gf -server is not quite ready to replace pgf-http yet...) Also bumped GF version number to 3.2.10-darcs
2011-08-25pgf-http: fix a bug that caused "+" to be treaded as " " in PGF service ↵hallgren
requests URLs. This was a bug in my workaround for a bug in the httpd-shed package. It made it impossible to use the glue token "&+" for Turkish input in the minibar, for example.
2011-08-24pgf-service: apply the OpenMath LaTeX function only when linearizing to ahallgren
concrete language whose name ends with LaTeX. This change also avoids duplicating output and, in addition to the linearize command, applies the transfer also when using the linearizeAll command.
2011-08-23pgf-service: add Jordis transfer function for OpenMath LaTeX outputhallgren
2011-08-22pgf service: external service hook: always format the output as a JSON stringhallgren
2011-08-22pgf service: added a hook for external serviceshallgren
This is really reinventing CGI, people should learn how to write CGI scripts instead... TODO: better handling of temporary files
2011-06-21gf-server: make pgf-service work the Apache mod_fastcgihallgren
pgf-service now appears to works with Apache mod_fastcgi (under Mac OS X) in addition to lighttpd. One difference appears to be that while lighttpd passes the name of the PGF file in the SCRIPT_FILENAME variable, Apache passes it in PATH_TRANSLATED. But perhaps this depends on exactly how the fastcgi service is configured. The following is what I added to the Apache configuration file to test this: <Directory /Library/WebServer/Documents/fcgi-bin> SetHandler fastcgi-script Options +ExecCGI </Directory> Action pgf-service /fcgi-bin/pgf-service AddHandler pgf-service .pgf
2011-06-21gf-server: enable -rtsopts when compiling with ghc>=7.0hallgren
2011-06-21gf-server.cabal: a separate flag for the content servicehallgren
* Use cabal install -ffastcgi to compile the fastcgi server. * Use cabal install -fcontent to compile the content service (off by default, currently broken) * Use both flag to compile both.
2011-03-07the user can now upload their own grammars in the editorkrasimir
2011-01-09The name of the fastcgi executable has changed back to pgf-servicehallgren
2010-12-28The GF editor now lets the user to upload his/her own grammarskrasimir
2010-12-23gf-server.cabal: changes to stop cabal from demanding hsql even when ↵hallgren
content-server is not going to be built
2010-12-22PGF web service: make the generated index.html for pgf-http a bit more ↵hallgren
informative
2010-12-22gf-server.cabal: update description of fastcgi flaghallgren
2010-12-22gf-server.cabal: make hsql-mysql optional like fastcgihallgren
content-service depends on hsql-mysql, which depends on a C library, so like fastcgi, only compile it if you ask for it explicitly with -ffastcgi.
2010-12-22gf-server.cabal: Change the default for the flag fastcgi to Falsehallgren
If you want the fastcgi server, use cabal install -ffastcgi. This is to avoid problems when you only want to compile pgf-http and the fastcgi library fails to install, which it usually does, since it depends on a C library which is not installed automatically with cabal.
2010-12-22PGF web service: Use Content-Type text/javascript from JSON outputhallgren
The Content-Type used to be text/json, but this caused warning messages in some web browers.
2010-12-22tweak gf-server.cabalkrasimir
2010-12-17pgf-http now uses $datadir/www instead of ./www as the document roothallgren
Along with the changes to Setup.hs it should now be enough to do cabal install pgf-http open http://localhost:41296/ to run the PGF service locally and play with some example grammars in minibar.
2010-12-17RunHTTP.hs: remove hardcoded document roothallgren
The document root is now part of the arguments passed to runHTTP.