From 9dd842fd58fac21c6940d3aba0f447e8f90e47ca Mon Sep 17 00:00:00 2001 From: allen Date: Wed, 20 Sep 2000 11:07:44 +0000 Subject: Added viewport git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPDExtra/trunk@8 61ea717e-8e0c-4c3c-b38e-e9c67f54f1f1 --- src/IO.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/src/IO.c b/src/IO.c index fc96902..163353e 100644 --- a/src/IO.c +++ b/src/IO.c @@ -53,6 +53,7 @@ static int IOFileListener(cGH *GH, const char *filename, const IOUtil_AdvertisedFileDesc_t *description); static int AdvertisedFilePage(cGH *cctkGH, httpRequest *request, void *data); +static int ViewportFilePage(cGH *cctkGH, httpRequest *request, void *data); static int SendFilePage(cGH *cctkGH, httpRequest *request, void *data); @@ -81,10 +82,14 @@ int HTTP_util_RegisterIOPages(void) &listener); HTTP_RegisterPage("/Output/index.html", AdvertisedFilePage, NULL); + HTTP_RegisterPage("/Output/viewport.html", ViewportFilePage, NULL); HTTP_ContentLink("/Output/index.html", "Files", "Downloadable files", HTTP_QUICKLINK); + HTTP_ContentLink("/Output/viewport.html", "Viewport", + "Viewport for certain output files", + HTTP_QUICKLINK); HTTP_RegisterPage("/Output", SendFilePage, NULL); @@ -217,6 +222,9 @@ static int AdvertisedFilePage(cGH *cctkGH, httpRequest *request, void *data) "from the simulation. Depending on the software available on your" " local machine, you can change the browser properties to lauch" " files directly to visualization clients.

\n " + "

Some of these output files can be directly viewed on " + "a browser on the simulation " + "viewport

" "

Many IO methods have steerable parameters which " "allow you to e.g. add fields and customise behaviour." "Depending on your authorisation, you can access the" @@ -333,3 +341,91 @@ static int SendFilePage(cGH *cctkGH, httpRequest *request, void *data) } + /*@@ + @routine AdvertisedFilePage + @date Sun Sep 17 18:26:01 2000 + @author Tom Goodale + @desc + Page to deal with advertised files. + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ +static int ViewportFilePage(cGH *cctkGH, httpRequest *request, void *data) +{ + int retval; + char message[4098]; + struct httpuFileList *list; + + /* Status message */ + strcpy(message,"HTTP/1.0 200 OK\r\n"); + + HTTP_Write(request, message, strlen(message)); + + /* Content-Type */ + strcpy(message,"Content-Type: text/html\r\n\r\n"); + + HTTP_Write(request, message, strlen(message)); + + /* Start the page */ + strcpy(message, "Cactus Downloadable Files\n"); + + HTTP_Write(request, message, strlen(message)); + + /* HTTP_Write out the header part. */ + + HTTP_ContentHeader(0,4098,message); + + HTTP_Write(request, message, strlen(message)); + + strcpy(message, "

Viewport

"); + + HTTP_Write(request, message, strlen(message)); + + strcpy(message, + "

This page displays certain types of the output files " + "from the download page" + " as images (currently only jpegs [mime type image/jpeg]).

" + "

Many IO methods have steerable parameters which " + "allow you to e.g. add fields and customise behaviour." + "Depending on your authorisation, you can access the" + " parameter steering page

" + "
" + "" + "\n"); + + HTTP_Write(request, message, strlen(message)); + + for (list = filelist; list; list = list->next) + { + if (CCTK_Equals(list->data.mimetype,"image/jpeg")) + { + sprintf(message, + "" + "" + "\n", + list->data.varname,list->linkname, list->filename, + list->data.description,list->linkname); + HTTP_Write(request, message, strlen(message)); + } + } + + strcpy(message,"
Variable
File Name
DescriptionImage
%s
" + "%s
%s
"); + HTTP_Write(request, message, strlen(message)); + + /* Write out the footer part. */ + + /* HTTP_Write out the footer part. */ + + HTTP_ContentFooter(0,4098,message); + + retval = HTTP_Write(request, message, strlen(message)); + + return retval; +} + -- cgit v1.2.3