/* (for WAMP server) headers used by participants */
/* note: svyServerHeaders.js contains WAMP server specific headers used by admin  */

/* dsurveyVersionClient:
   The dsurvey version (client version)
*/
dsurveyVersionClient='WAMP 15June2011 ';

// 25 march: not done   560

// 3 5 75 122 132 201 331  401  4011 461

// note: sessionParamsURL, roundParamsURL, fileParamsURL do not use php (direct download of existing PINFO/ file)

/* 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';
/* getCurrentSessionsURL_Latest (todo=5, variant): the URL that   will return a list of sessions, and note the "latest" session.    */
getCurrentSessionsURL_Latest='/dsurvey/client/phps/getSessList.php?latest=1';


/* getAllowedUsersURL (todo=75): the URL that   will return an allowed_Users xml file,
   session=sessName should be added
 */
getAllowedUsersURL='/dsurvey/client/phps/returnSessParams.php?name=allowedusers.xml&';


/* 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
   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 ...
   Optional: id and message variables
        &state=escaped_clientState&id=participantId&summary=escaped_message&time=aTime&default=defaultValue

   Note:  delim and spy are NOT supported by this "client version" of getServerVarURL
   (an error occurs if these are detected).

   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/client/phps/readServerVarC.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/client/phps/readServerStatusVarC.php?';


/*  submitJoinURL (todo=201): the base url to submit "join a survey".
  The following will be added to th submitJoinURL
        session=sessName&username=aname&content=escapedStuff
    where
        session=sessName : required. The name of the session this user is joining
        username=aname : required. Name:id=refid  of this particpant      (refid might be empty)
        content=escapedStuff : xml line containing info on this client (id, etc)
        Example of content:
           <user id="64170_6453"><name>A</name><nickname></nickname><contact></contact><refid></refid></user>
   If success, should return 'OK'. If failure, "-error_code error message"

   Note: non-duplicate user, allowed usernames, and password checks, are done on the client side (not by the server)

*/
submitJoinURL='/dsurvey/client/phps/joinSession.php?';


/* getClientIdURL (todo=331): get a unique client ID from the server
  session=sessname&name=myName  is added
*/
getClientIdURL='/dsurvey/client/phps/assignClientId.php?';


/* getSavedDataURL (todo=461) :

  Note: admin-side version of this is more powerful
        retrieve a quasi-xml file containing saved data.
        The following is appended:
                sesion=sessname&type=atype
        where atype must be HISTORY , or SIMPLEHISTORY
  Note that everyone's history is in the history file: the client software will extract "client specific" rows
*/
getSaveDataURL='/dsurvey/client/phps/getSavedHistoryData.php?' ;



//=======================================================

/*  svyPostSubmitURL :
      The basic url to use to "post" submitted data, or simple history data, to the server
      Both types of data are structured as quasi-xml, with values in a single CSV list (each value is escaped)

      svyPostSubmitUrl is used with svyPostDataHeader,svyPostSimpleHistoryHeader, and svySMTPsend --

Details:
  svyPostSubmitUrl is used with the following
      svyPostDataHeader (401)
         The header to use in the body of a "post" of submitted data
         The following is appended:
                session=sessname&message=escapedDescriptiveMessage&verify=verificationString&contents=partiallyEscapedXMLDataRow
                &submit_status=entryId
      svyPostDataSimpleHistoryHeader  (4011):
          The header to use in the body of a "post" of simnpleHistory data
          The following is appended:
                session=sessname&message=short_message&contents=partiallyEscapedXMLDataRow
      svySMTPsend
         The header is used to send a email via an SMTP server
         The following is appended
             session=sessname&asShort=1&clientID=aid&sendfrom=escapeFromAddress&sendto=escapeToaddres&subject=escapeSubject&message=escapeMessage

25march2011: yes, it is odd to use the "submit data to server" php file to ALSO send email. Blame it on history (for now)

*/


svyPostSubmitURL='/dsurvey/client/phps/submitEntry.php';

  svyPostDataHeader='todo=401&' ;

  svyPostSimpleHistoryHeader='todo=4011&' ;

  svySTMPsend='todo=560&' ;

/* --------------
   Stuff for sending/retrieving dSurvey messages 
*/

/* base url for posting a message */
postMessageURL='/dsurvey/client/phps/postMessage.php';

/* post a message to a client, or multiple clients, messageboxes
   session=sessname&clientList=clientIds&message=escapedMesssage
   (if more than one clientid, seperate with a ,
*/
messageSendPost='todo=521&';

/* retrieve contents of message box. Then empty the messagebox
  session=sessname&client=clientId
*/
messageRetrieve='/dsurvey/client/phps/postMessage.php?todo=522&';


/* ====================================== */

/* url to obtain a session specific  "client accessible" parameters files.
  !SESS! will be replaced with the session name
*/
sessionParamsURL='/dsurvey/pinfo/!SESS!/!SESS!.XML';

/* url to obtain a round specific  "client accessible" parameters files.
  !SESS! will be replaced with the session name
*/
roundParamsURL='/dsurvey/pinfo/!SESS!/_!SESS!.XML';

/* url to obtain a custom  "client accessible" parameters files.
  !SESS! will be replaced with the session name
*/
fileParamsURL='/dsurvey/pinfo/!SESS!/';



/* ====== 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';

