/* strings used in administrative pages to send requests to the server (WAMP version) */
/* Note: svyUserServerHeaders.js contains other headers used in administrative pages */


/* dsurveyVersionAdmin:
   The dsurvey version (admin)
*/
dsurveyVersionAdmin='WAMP 15June2011 ';

/* todos done: 1 2  3 5 (4 7 76 124)  6 61 33 121 122 131  132 322    77 500 403 461 431 405 213 600   601 602    802 
//       901 9011     711 421

*/

/* getSessionDescriptorURL (todo=3): the basic URL to use to request the contents of a session-dsecriptor file (an XML file) (todo=3).
   Note that the session name will be added at the end of this.
*/
getSessionDescriptorURL='/dsurvey/client/phps/returnSessDesc.php?name=';

/* getCurrentSessionsURL: the URL that   will return a list of sessions.   (todo=5)  */
getCurrentSessionsURL='/dsurvey/client/phps/getSessList.php';


/* getInstrumentsURL: the URL that   will return a list of instruments. (todo=1)    */
getInstrumentsURL='/dsurvey/admins/phps/getInstList.php';


/* getInstrumentURL : the basic URL to use to request the contents of an instrument descriptor file (todo=2) .
   Note that a xml file name (of the instrument file) will be added at the end of this.
   Thus: for instrument anInst, url will be /dsurvey/client/phps/returnInstDesc.php?file=anInst.xml;
*/
getInstrumentURL='/dsurvey/admins/phps/returnInstDesc.php?file=';


/* getSessionExistsURL : the basic URL to use to request if a session file exists.  (todo=31)
   Note that a xml file name will be added at the end of this.
   then the requested URL will be: /dsurvey/client/phps/checkSessExists.php?name=mysession;
   The server should return a 0 if no such session file exists, a 1 if it does exist
*/
getSessionExistsURL='/dsurvey/admins/phps/checkSessExists.php?name=';

/*  postFileURL

      The basic url to use to "post" an XML file to the server to be saved as a session-descriptor file.
      Used with both postSessionFilesHeader and postFileHeader
      This is used as the URL in POST request, hence should NOT contain ?arguments.

   postSessionFilesHeader (todo=4): Used to instruct save session descriptor file, and to copy a list of
                           "instrument default" files to "session specific files".
                          These files will NOT be modified -- they will just be copied.
      The body of the POST will look like:
         postSessionFilesHeader&name=sessionName&instName=iName&file=filename&doScenarios=1&content=escaped_verbatim_xmlFile
      where
                postSessionFilesHeader= is the contents of the postSessionFilesHeader variable
                sessionName = the session name you enter
                iName = the instrument name
                doScenarios=1 : copy SC_*.XML files (from instrument to session directory)
                FileList =  a comma delimited list of filenames, that has been "escaped" (%2c used instead of comma)
                ovewrite=1 : optional -- force overwrite of session descriptor file
                escaped_verbatim_xmlFile = the contents of the session specific "instrument" xmlFile, 'escaped' for safe transmission
       Note that the instrument name is used to find the instrument's directory

  postInstrumentFileHeader (todo=76): used to save instrument specific XML parameters  (that may have been modified).

     The body of the POST will look like:
         postInstrumentFileHeader&name=instrumentName&file=iFileName&content=escaped_verbatim_xmlFile
      where "postInstrumentFileHeader" is the contents of the postInstrumentFileHeader variable
                instrumentName = the instrument's name
                iFileName = the  xml file ( observation, general parameters, or other) file to create (or overwrite)
                escaped_verbatim_xmlFile = the contents of the xmlFile, 'escaped' for safe transmission


  postFileHeader (todo=7): used to save  session specific XML parameters  (that may have been modified).
                  These will overwrite session specific files of the same name

     The body of the POST will look like:
         postFileHeader&name=sessionName&file=iFileName&content=escaped_verbatim_xmlFile
      where "postFileHeader" is the contents of the postFileHeader variable
                sessionName = the session name
                iFileName = the  xml file ( observation, general parameters, or other) file to create (or overwrite)
                escaped_verbatim_xmlFile = the contents of the xmlFile, 'escaped' for safe transmission

 postClientFileBody (todo=124): used to "post" a client-accessible file (to PINFO/sessionname)
     The following will be added to the postClientFileBody
          &session=sessname&type=atype&contents=escapedXMLfile
     where atype is one of SESSION, ROUND, or OTHER


 uploadFileName and uploadFileValue: used to upload a file to browser
      This is used as input fields in an enctype of "multipart/form-data"


 echoFileName and Value: used to echo a file back to browser, with a content-disposition: attachment; filename=...
   This is used as the header of the body of  a post to the server.
   The following "input" element is added to the form used to force this post request
        name="echoFileName" value=echoFileValue
   Note that
         a name="filename" input element will also be added -- default filename to use to save to disk (see viewSubmittedAsXML for details)
         a name="contents" input element will also be added  -- unescaped contents of file to save (see viewSubmittedAsXML for details)



  saveSelectionFile: save the dsurvey.htm file -- list of sessions to chose from
                   add contents=escaped_file
      saveSelectionFile='todo=802&';
      
  postNoteHeader: save a note to the notes database (for this session) (todo=711)
     adds:
            &session='+sessName+'
            &content='+aval  (where aval is escaped contents of the note)

*/



postFileURL='/dsurvey/admins/phps/postFile.php';

// these are used with postFileURL
postSessionFilesHeader='todo=4';
postFileHeader='todo=7';
postInstrumentFileHeader='todo=76';
postClientFileBody='todo=124'

uploadFileName='todo';
uploadFileValue='77';

echoFileName='todo';
echoFileValue='500';

saveSelectionFile='todo=802&';


/* getSessionDataURL:   the basic URL to use to request the contents of one of a session's data file  (such as a general parameters file)
   a "name=sessionName&file=Params_FILE" are added (todo=6)  */
getSessionDataURL='/dsurvey/admins/phps/returnSessParams.php?';

/* getInstrumentDataURL:   the basic URL to use to request the contents of one of an instrument's data file  (such as a general parameters file)
   a "name=instrumentName&file=Params_FILE" are added  (todo=61)*/
getInstrumentDataURL='/dsurvey/admins/phps/returnInstParams.php?';


/* getSuspendedDescriptorURL : the basic URL to use to request the contents of a suspended session-dsecriptor file (an XML file).
   Note that the session name will be added at the end of this. (todo=33)
*/
getSuspendedDescriptorURL='/dsurvey/admins/phps/returnSuspendDesc.php?name=';


/* getSuspendedSessionsURL (todo=55): the URL that   will return a list of suspended sessions.    */
getSuspendedSessionsURL='/dsurvey/admins/phps/getSuspendSessList.php?';



/* setServerVarURL (todo=121): the base URL used to create a "session specific" variable. This variable will
   be queried for by clients. Ideally, it should be retained in form easily for quick delivery
   (as a plain text string.
   The following will be added to the setServerVarURL :
       session=sessname&varname=aVarname&delim=adelim&value=Avalue
   where
        sessName: the survey session
        varname: variable to be saved (or space delimited list of variables)
        aValue : value of the variable  (or delim delimiged list of values)
        delim: a delimiter (used only if multiple varnames)
   The server should return an "ok" if the variable was properly saved.
   Otherwise, an error message that begins with a "-"
*/
setServerVarURL='/dsurvey/admins/phps/saveServerVar.php?';

/* getServerVarURL (todo=122): the base URL used to request a "session specific" variable.
  Note: admins\php\readServerVar.php and client\php\readServerVarC.php are slightly different (admin supports more
       options)

   The following will be added to the getServerVarURL :
       session=sessname&varname=aVarnames&delim=adelim&default=defValue
   where
        sessName: the survey session
        varname: variable to be retrieved. Or, a space delimited (escaped) list of variables.
                 If varname='*', return a delim delimited list of all the server variables defined for this session, using a
                        varname=value delim varname=value ...
                 syntax
       delim: optional. Only used if several variables. Adelim will be used by server to seperate values
       default: optional. If no varname exits, return defValue
  Optional: id and message variables
        ...&delim=adelim&id=participantId&message=escaped_message&time=aTime
   This participant specific (based on participantID) message will be saved, for use in status display.
    In addition, the current time  (highly recommended: use getTime()) will be stored.
*/
getServerVarURL='/dsurvey/admins/phps/readServerVar.php?';


/* setServerStatusVarURL (todo=131): the base URL used to create a "session specific" status variable.
  This variable will be queried for by clients, such as when a participant is joining
  Ideally, it should be retained in form easily for quick delivery  (as a plain text string)
   The following will be added to the setServerVarURL :
       session=sessname&varname=aVarname&value=Avalue
   where
        sessName: the survey session
        varname: variable to be saved
        aValue :  value of the variable
   The server should return an "ok" if the variable was properly saved.
   Otherwise, an error message that begins with a "-"
   Note: this is a somewhat simpler version of setServerVarUrl
*/
setServerStatusVarURL='/dsurvey/admins/phps/saveServerStatusVar.php?';

/* getServerStatusVarURL (todo=132): the base URL used to request a "session specific" status variable.
  Note: the client and admin side version of this are essentially identical.
   The following will be added to the getServerStatusVarURL :
       session=sessname&varname=aVarnames&default=defValue
   where
        sessName: the survey session
        varname: variable to be retrieved.
        default: optional. If no such varname, return defValue

*/
getServerStatusVarURL='/dsurvey/admins/phps/readServerStatusVar.php?';


/* getUserStatusURL (todo=322): get a string containing the status of the current participants.
    id, atime, message=amessage
 each on a seperate line
 session=sessionName will be appended
*/
getUserStatusURL='/dsurvey/admins/phps/readParticipantStatus.php?';


/*  getUserListURL (todo=202): the base url to request a list of users (in an xml file )
  The following will be added to getUserListURL
        session=sessName

 The returned file syntax should be something like  (the session and created nodes are purely descriptive, 1 <user>
 note for every participant, name nickname and contact are always subnodes.)

 <?xml version="1.0" encoding="UTF-8" ?>
 <users>
    <session value="sessname" />
    <created>date and time </created>
     <user id="53301924269913"><name>A2</name><contact></contact><nickname></nickname><refid></refid></user>
     <user id="3871111421218145"><name>A3</name><contact></contact><nickname></nickname><refid></refid></user>
     <user id="7424969263627784"><name>A4</name><contact></contact><nickname></nickname><refid></refid></user>
 </users>
Note. Actual stuff in the <user>... is supplied by clients when they join session. For example:
   name: 1-word name, provided when a user joins
   contact: contact info, provided when a user joins. This is optional-- if not provided, a '' is used
   nickname: a nickname, provided when a user joins. This is optional-- if not provided, a '' is used
*/
getUserListURL='/dsurvey/admins/phps/getuserList.php?';



/* getSubmittedDataURL (todo=403): return an XML file containing all submitted data.
   session=sessName will be appended to the end of this
*/
getSubmittedDataURL='/dsurvey/admins/phps/getSubmitted.php?';

/* DEPRECATED: updateSubmittedDataURL: tell server to append "current round" submitted data to "all round" submitted data, and to clear
  "current round" submitted
 session=sessName will be appended to the end of this
 */
//updateSubmittedDataURL='/dsurvey/dsurvey?todo=4031&';


/* getSavedDataURL (todo=461):
  Note: client-side version of this only gets  SIMPLEHISTORY
        retrieve a quasi-xml file containing saved data.
        The following is appended:
                sesion=sessname&type=atype&cname=customName
        where atype must be GENERAL, USERS, or RESULTS , HISTORY , or SIMPLEHISTORY, or CUSTOM
*/

getSaveDataURL='/dsurvey/admins/phps/getSavedAnyData.php?' ;


/*  svyPost3URL :
      The basic url (points to a .php file) to use to "post" submitted data, as an XML data row, to the server
      This is used with svyPostDataHeader --
           svyPost3URL is the request line (the .php file), svyPost3Header is the start of the body of the post
*/
svyPost3URL='/dsurvey/admins/phps/saveAnyData.php' ;

/*  svyPost3Header :
      The header to use in the body of a a "post" of general, users, or  results data
      The following is appended:
                session=sessname&round=roundNum&type=atype&contents=EscapedXMLDataRows
      or, if atype=CUSTOM
                session=sessname&round=roundNum&type=atype&cname=filename&contents=EscapedXMLDataRows

 */
svyPost3Header='todo=431&' ;



/* getSubmitMessages (todo=405): return a crlf delimited string containing the list of submit-messages
   session=sessName will be appended to the end of this
*/
//getSubmittedMessagesURL='/dsurvey/dsurvey?todo=405&';
getSubmittedMessagesURL='/dsurvey/admins/phps/getSubmitted.php?todo=405&'


/* killSessionURL (todo=600): delete session specific files and directories.
        session=sessName&step=n&fake=k
    will be added,
        step=n  : with n=1,2,3, or 4 (descriptor, parameter and submitted data files, temporary data files, client-accessible files)
        fake=k:  k=1 means "don't actually delete, just report what would be deleted. k=0 means "do it!"
*/
killSessionURL='/dsurvey/admins/phps/killSession.php?';

/* postParticipantFile (todo=213): post a quasi-XML file containing list of participants
   The following "input" element is added to the form used to force this post request
        session=sessName&contents=escaped_xml_file
   Note: in the post request, uses postFileUrl
*/
postParticipantFile='/dsurvey/admins/phps/postParticipantFile.php?';



/* suspendSessionURL: suspend a session (601)
   session=sessName will be added
*/

suspendSessionURL='/dsurvey/admins/phps/suspendSession.php?';

/* unSuspendSessionURL: unsuspend a session (602)
   session=sessName will be added
*/
unSuspendSessionURL='/dsurvey/admins/phps/unSuspendSession.php?';


/* getScenarioList (901)
   Request a list of scenario files
   The following is appended:
                session=sessname&
    or
                instrument=instname
*/
getScenarioListURL='/dsurvey/admins/phps/getScenarioList.php?';


/* getScenarioListsList       (9011)
   Request a list of scenarioList files
   The following is appended:
                session=sessname&
    or
                instrument=instname
*/
getScenarioListsListURL='/dsurvey/admins/phps/getScenarioListsList.php?';


/* backupSessionURL (421): the base url to backup a sessions data files.
        a) session descriptor file
        a) submitted data
        b) list of participants
        c) history of submissions
        d) all session specific xml files (including reference data, user and general parameters, and control panel)
   &session=sessName is added to the end
*/
backupSessionURL='/dsurvey/admins/phps/backupSession.php?';

//getBackupSessionURL (4213): return comma delimtied list of currently available backup sessions (sessionName date)
//where sessionname may $project_name style
getBackupSessionsURL='/dsurvey/admins/phps/getBackupList.php?';

//  not done ..... :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: xxxxxxxxxxxxxxxxxxxxxx


/* rebuild contents of a message box
  session=sessname&client=clientId&message=escape(multiLinesofMessages)
  Note: uses messagexx variables sent in svyUserHeaders.js
*/
messageRebuild='todo=523&';


/* == smtp stuff */
/* svySetSMTP
   The header to use to set/retrieve SMTP parameters
   svySetSMTPtodo is used to append a "todo=svySetSMTPtodo" after svySetSMTP

   Thus, the url starts with: svySetSMTP+'?todo='+svySetSMTPtodo+'&'

   The following is appended (to set values):
       smtpGateway=ipAddress&smtpName=username&smtpPwd=passwrd&defaultFrom=emailAddress
   or (to retrieve values)
       read=1
*/
svySetSMTP='/dsurvey/admins/phps/doSmtpVals.php';
svySetSMTPtodo='561';

/*svySMTPsend
  Used to start the body of a post that sends an email
  Various stuff is appended to this: session,sendFrom,sendTo,subject,message
*/
svySMTPsend='/dsurvey/admins/phps/svySendEmail.php';


/* ====== headers to static files ==== */

/* homePageURL : header to the "home page" for a instrument/session
    All occurences of !INST! will be replaced by the instrument name
*/
homePageURL='/dsurvey/instruments/!INST!/!INST!.html';

/* instrumentBaseURL: the base url for this instruments directory
    All occurences of !INST! will be replaced by the instrument name.
*/
instrumentBaseURL='/dsurvey/instruments/!INST!/' ;

/* specFileRL : header to the "specification file" for a instrument/session
    All occurences of !INST! will be replaced by the instrument name.
    Relative urls will be append to the instrumentBaseURL
*/
specFileURL='specs/spec.xml';





