Changeset 1848

Show
Ignore:
Timestamp:
04/21/08 10:20:25
Author:
johnsa
Message:

web clients: finish off x-property client support; move application specific xprops from x-property class to eventForm.js for each client.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webadmin/webapp/resources/resources/bedeworkEventForm.js

    r1841 r1848  
    339339  formObj["eventEndDate.month"].value = endDate.getMonth() + 1; 
    340340  formObj["eventEndDate.day"].value = endDate.getDate(); 
     341} 
     342function setBedeworkXProperties(formObj,submitter) { 
     343  // set up specific Bedework X-Properties on event form submission 
     344  // Depends on bedeworkXProperties.js 
     345  // Set application local x-properties here. 
     346 
     347  // X-BEDEWORK-IMAGE and its parameters: 
     348  if (formObj["xBwImageHolder"] && formObj["xBwImageHolder"].value != '') { 
     349    bwXProps.update(bwXPropertyImage,[[bwXParamDescription,''],[bwXParamWidth,''],[bwXParamHeight,'']],formObj["xBwImageHolder"].value,true); 
     350  } 
     351  // X-BEDEWORK-SUBMITTEDBY 
     352  bwXProps.update(bwXPropertySubmittedBy,[],submitter,true); 
     353 
     354  // commit all xproperties back to the form 
     355  bwXProps.generate(formObj); 
    341356} 
    342357function swapAllDayEvent(obj) { 
  • trunk/deployment/webadmin/webapp/resources/resources/bedeworkXProperties.js

    r1843 r1848  
    3838var bwXPropertySubmittedBy = "X-BEDEWORK-SUBMITTEDBY"; 
    3939var bwXPropertySubmitComment = "X-BEDEWORK-SUBMIT-COMMENT"; 
    40  
     40var bwXParamLocationAddress = "X-BEDEWORK-PARAM-LOCATION-ADDRESS"; 
     41var bwXParamLocationSubAddress = "X-BEDEWORK-PARAM-LOCATION-SUBADDRESS"; 
     42var bwXParamLocationURL = "X-BEDEWORK-PARAM-LOCATION-URL"; 
     43var bwXParamContactName = "X-BEDEWORK-PARAM-CONTACT-NAME"; 
     44var bwXParamContactPhone = "X-BEDEWORK-PARAM-CONTACT-PHONE"; 
     45var bwXParamContactURL = "X-BEDEWORK-PARAM-CONTACT-URL"; 
     46var bwXParamContactEmail = "X-BEDEWORK-PARAM-CONTACT-EMAIL"; 
     47var bwXParamCategories = "X-BEDEWORK-PARAM-CATEGORIES"; 
    4148 
    4249// ======================================================================== 
     
    6168    if (this.params.length) { 
    6269      for (var i = 0; i < this.params.length; i++) { 
    63         curXparams += ";" + this.params[i][0] + "=" + this.params[i][1]; 
     70        if (this.params[i][1] != "") { 
     71          curXparams += ";" + this.params[i][0] + "=\"" + this.params[i][1] + "\""; 
     72        } 
    6473      } 
    6574    } 
     
    7786 
    7887  this.update = function(name, params, value, isUnique) { 
     88    // strip out any double quotes in the parameter values: 
     89    if (params.length) { 
     90      for (var i = 0; i < params.length; i++) { 
     91        var strippedParamValue = ""; 
     92        for (var j = 0; j < params[i][1].length; j++) { 
     93          var c = params[i][1][j]; 
     94          if (c != '"') { 
     95            strippedParamValue += c; 
     96          } 
     97        } 
     98        params[i][1] = strippedParamValue; 
     99      } 
     100    } 
     101    // add or update the xproperty: 
    79102    var xprop = new BwXProperty(name, params, value); 
    80103    if (isUnique && this.contains(name)) { 
     
    117140 
    118141} 
    119  
    120 function setBedeworkXProperties(formObj,submitter) { 
    121   // set up specific Bedework X-Properties on event form submission 
    122  
    123   // X-BEDEWORK-IMAGE and its parameters: 
    124   if (formObj["xBwImageHolder"] && formObj["xBwImageHolder"].value != '') { 
    125     bwXProps.update(bwXPropertyImage,[[bwXParamDescription,''],[bwXParamWidth,''],[bwXParamHeight,'']],formObj["xBwImageHolder"].value,true); 
    126   } 
    127   // X-BEDEWORK-SUBMITTEDBY 
    128   bwXProps.update(bwXPropertySubmittedBy,[],submitter,true); 
    129  
    130   // commit all xproperties back to the form 
    131   bwXProps.generate(formObj); 
    132 } 
  • trunk/deployment/websubmit/webapp/resources/demoskins/default/default/default.xsl

    r1841 r1848  
    105105      </head> 
    106106      <body> 
    107         <xsl:if test="/bedework/page = 'editEvent' and 
    108                       normalize-space(/bedework/formElements/form/xproperties/xproperty[@name='X-BEDEWORK-SUBMIT-COMMENT']/value) != ''"> 
    109           <xsl:attribute name="onload">initRXDates();initXProperties();getComments('standardForm','<xsl:value-of select="/bedework/formElements/form/xproperties/xproperty[@name='X-BEDEWORK-SUBMIT-COMMENT']/value"/>');</xsl:attribute> 
     107        <xsl:if test="/bedework/page = 'editEvent'"> 
     108          <xsl:attribute name="onload">initRXDates();initXProperties();</xsl:attribute> 
    110109        </xsl:if> 
    111110        <div id="bedework"><!-- main wrapper div --> 
     
    906905          <p> 
    907906            <label for="commentLocationAddress">Address: </label> 
    908             <input type="text" name="commentLocationAddress" id="bwCommentLocationAddress"/> 
     907            <input type="text" name="commentLocationAddress" id="bwCommentLocationAddress"> 
     908              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-LOCATION-ADDRESS']"/></xsl:attribute> 
     909            </input> 
    909910          </p> 
    910911          <p> 
    911             <label for="commentLocationSubaddress"><em>Sub-address:</em> </label><input type="text" name="commentLocationSubaddress"/> 
     912            <label for="commentLocationSubaddress"><em>Sub-address:</em> </label> 
     913            <input type="text" name="commentLocationSubaddress" id="commentLocationSubaddress"> 
     914              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-LOCATION-SUBADDRESS']"/></xsl:attribute> 
     915            </input> 
    912916            <span class="note"> optional</span> 
    913917          </p> 
    914918          <p> 
    915             <label for="commentLocationURL"><em>URL:</em> </label><input type="text" name="commentLocationURL"/> 
     919            <label for="commentLocationURL"><em>URL:</em> </label> 
     920            <input type="text" name="commentLocationURL" id="commentLocationURL"> 
     921              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-LOCATION-URL']"/></xsl:attribute> 
     922            </input> 
    916923            <span class="note"> optional</span> 
    917924          </p> 
     
    937944          <p> 
    938945            <label for="commentContactName">Organization Name: </label> 
    939             <input type="text" name="commentContactName" id="bwCommentContactName" size="40"/> 
     946            <input type="text" name="commentContactName" id="bwCommentContactName" size="40"> 
     947              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-CONTACT-NAME']"/></xsl:attribute> 
     948            </input> 
    940949            <span class="note"> Please limit contacts to organizations, not individuals.</span> 
    941950          </p> 
    942951          <p> 
    943             <label for="commentContactPhone"><em>Phone:</em> </label><input type="text" name="commentContactPhone"/> 
     952            <label for="commentContactPhone"><em>Phone:</em> </label> 
     953            <input type="text" name="commentContactPhone"> 
     954              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-CONTACT-PHONE']"/></xsl:attribute> 
     955            </input> 
    944956            <span class="note"> optional</span> 
    945957          </p> 
    946958          <p> 
    947             <label for="commentContactURL"><em>URL:</em> </label><input type="text" name="commentContactURL"/> 
     959            <label for="commentContactURL"><em>URL:</em> </label> 
     960            <input type="text" name="commentContactURL"> 
     961              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-CONTACT-URL']"/></xsl:attribute> 
     962            </input> 
    948963            <span class="note"> optional</span> 
    949964          </p> 
    950965          <p> 
    951             <label for="commentContactEmail"><em>Email:</em> </label><input type="text" name="commentContactEmail"/> 
     966            <label for="commentContactEmail"><em>Email:</em> </label> 
     967            <input type="text" name="commentContactEmail"> 
     968              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-CONTACT-EMAIL']"/></xsl:attribute> 
     969            </input> 
    952970            <span class="note"> optional</span> 
    953971          </p> 
     
    9941012          <p> 
    9951013            <label for="commentCategories">Category suggestion: </label> 
    996             <input type="text" name="commentCategories" size="30"/> 
     1014            <input type="text" name="commentCategories" size="30"> 
     1015              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-CATEGORIES']"/></xsl:attribute> 
     1016            </input> 
    9971017          </p> 
    9981018        </div> 
     
    10101030        <div id="bwCommentNotes"> 
    10111031          Please supply any final notes or instructions regarding your event:<br/> 
    1012           <textarea name="commentNotes" cols="60" rows="4">&#160;</textarea> 
     1032          <!-- note: don't remove the #160 from the textarea or browsers will see it as a closed tag when empty --> 
     1033          <textarea name="commentNotes" cols="60" rows="4"><!-- 
     1034           --><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/values/text"/>&#160;<!-- 
     1035           --></textarea> 
    10131036        </div> 
    10141037        <div class="eventSubmitButtons"> 
  • trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkEventForm.js

    r1841 r1848  
    245245  } 
    246246  setComments(formObj); 
    247   setRecurrence(formObj); 
     247  //setRecurrence(formObj); 
    248248  setBedeworkXProperties(formObj,submitter); 
    249   setAccessHow(formObj,1); 
     249  //setAccessHow(formObj,1); 
    250250  //setAccessAcl(formObj); 
    251251} 
     
    265265function setComments(formObj) { 
    266266  // set the submission comments (location, contact, and category suggestions) 
    267   // in a parsable format that can be filtered on output. 
    268  
    269   var comment = ""; 
    270   comment += formObj["commentLocationAddress"].value + "\t"; 
    271   comment += formObj["commentLocationSubaddress"].value + "\t"; 
    272   comment += formObj["commentLocationURL"].value + "\t"; 
    273   comment += formObj["commentContactName"].value + "\t"; 
    274   comment += formObj["commentContactPhone"].value + "\t"; 
    275   comment += formObj["commentContactURL"].value + "\t"; 
    276   comment += formObj["commentContactEmail"].value + "\t"; 
    277   comment += formObj["commentCategories"].value + "\t"; 
    278   comment += formObj["commentNotes"].value; 
    279  
    280   formObj["xbwsubmitcomment"].value = comment; 
    281 
    282 function getComments(formId,comment) { 
    283   // get the submission comments (location, contact, and category suggestions) 
    284   // and load them into the form 
    285   var formObj = document.getElementById(formId); 
    286  
    287   var commentVals = comment.split("\t"); 
    288   formObj["commentLocationAddress"].value = (commentVals[0] == undefined) ? "" : commentVals[0]; 
    289   formObj["commentLocationSubaddress"].value = (commentVals[1] == undefined) ? "" : commentVals[1]; 
    290   formObj["commentLocationURL"].value = (commentVals[2] == undefined) ? "" : commentVals[2]
    291   formObj["commentContactName"].value = (commentVals[3] == undefined) ? "" : commentVals[3]; 
    292   formObj["commentContactPhone"].value = (commentVals[4] == undefined) ? "" : commentVals[4]; 
    293   formObj["commentContactURL"].value = (commentVals[5] == undefined) ? "" : commentVals[5]
    294   formObj["commentContactEmail"].value = (commentVals[6] == undefined) ? "" : commentVals[6]; 
    295   formObj["commentCategories"].value = (commentVals[7] == undefined) ? "" : commentVals[7]; 
    296   formObj["commentNotes"].value = (commentVals[8] == undefined) ? "" : commentVals[8]
     267  // as an xproperty.  Relies on bedeworkXProperties.js 
     268 
     269 
     270
     271function setBedeworkXProperties(formObj,submitter) { 
     272  // set up specific Bedework X-Properties on event form submission 
     273  // Depends on bedeworkXProperties.js 
     274  // Set application x-properties here. 
     275 
     276  // X-BEDEWORK-SUBMIT-COMMENT and its parameters 
     277  bwXProps.update(bwXPropertySubmitComment, 
     278                  [[bwXParamLocationAddress,formObj["commentLocationAddress"].value], 
     279                   [bwXParamLocationSubAddress,formObj["commentLocationSubaddress"].value], 
     280                   [bwXParamLocationURL,formObj["commentLocationURL"].value], 
     281                   [bwXParamContactName,formObj["commentContactName"].value], 
     282                   [bwXParamContactPhone,formObj["commentContactPhone"].value], 
     283                   [bwXParamContactURL,formObj["commentContactURL"].value], 
     284                   [bwXParamContactEmail,formObj["commentContactEmail"].value], 
     285                   [bwXParamCategories,formObj["commentCategories"].value]], 
     286                  formObj["commentNotes"].value,true); 
     287 
     288  // X-BEDEWORK-IMAGE and its parameters: 
     289  if (formObj["xBwImageHolder"] && formObj["xBwImageHolder"].value != '') { 
     290    bwXProps.update(bwXPropertyImage,[[bwXParamDescription,''],[bwXParamWidth,''],[bwXParamHeight,'']],formObj["xBwImageHolder"].value,true)
     291  } 
     292  // X-BEDEWORK-SUBMITTEDBY 
     293  bwXProps.update(bwXPropertySubmittedBy,[],submitter,true)
     294 
     295  // commit all xproperties back to the form 
     296  bwXProps.generate(formObj)
    297297} 
    298298// create table of form fields for review 
  • trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkXProperties.js

    r1843 r1848  
    3838var bwXPropertySubmittedBy = "X-BEDEWORK-SUBMITTEDBY"; 
    3939var bwXPropertySubmitComment = "X-BEDEWORK-SUBMIT-COMMENT"; 
    40  
     40var bwXParamLocationAddress = "X-BEDEWORK-PARAM-LOCATION-ADDRESS"; 
     41var bwXParamLocationSubAddress = "X-BEDEWORK-PARAM-LOCATION-SUBADDRESS"; 
     42var bwXParamLocationURL = "X-BEDEWORK-PARAM-LOCATION-URL"; 
     43var bwXParamContactName = "X-BEDEWORK-PARAM-CONTACT-NAME"; 
     44var bwXParamContactPhone = "X-BEDEWORK-PARAM-CONTACT-PHONE"; 
     45var bwXParamContactURL = "X-BEDEWORK-PARAM-CONTACT-URL"; 
     46var bwXParamContactEmail = "X-BEDEWORK-PARAM-CONTACT-EMAIL"; 
     47var bwXParamCategories = "X-BEDEWORK-PARAM-CATEGORIES"; 
    4148 
    4249// ======================================================================== 
     
    6168    if (this.params.length) { 
    6269      for (var i = 0; i < this.params.length; i++) { 
    63         curXparams += ";" + this.params[i][0] + "=" + this.params[i][1]; 
     70        if (this.params[i][1] != "") { 
     71          curXparams += ";" + this.params[i][0] + "=\"" + this.params[i][1] + "\""; 
     72        } 
    6473      } 
    6574    } 
     
    7786 
    7887  this.update = function(name, params, value, isUnique) { 
     88    // strip out any double quotes in the parameter values: 
     89    if (params.length) { 
     90      for (var i = 0; i < params.length; i++) { 
     91        var strippedParamValue = ""; 
     92        for (var j = 0; j < params[i][1].length; j++) { 
     93          var c = params[i][1][j]; 
     94          if (c != '"') { 
     95            strippedParamValue += c; 
     96          } 
     97        } 
     98        params[i][1] = strippedParamValue; 
     99      } 
     100    } 
     101    // add or update the xproperty: 
    79102    var xprop = new BwXProperty(name, params, value); 
    80103    if (isUnique && this.contains(name)) { 
     
    117140 
    118141} 
    119  
    120 function setBedeworkXProperties(formObj,submitter) { 
    121   // set up specific Bedework X-Properties on event form submission 
    122  
    123   // X-BEDEWORK-IMAGE and its parameters: 
    124   if (formObj["xBwImageHolder"] && formObj["xBwImageHolder"].value != '') { 
    125     bwXProps.update(bwXPropertyImage,[[bwXParamDescription,''],[bwXParamWidth,''],[bwXParamHeight,'']],formObj["xBwImageHolder"].value,true); 
    126   } 
    127   // X-BEDEWORK-SUBMITTEDBY 
    128   bwXProps.update(bwXPropertySubmittedBy,[],submitter,true); 
    129  
    130   // commit all xproperties back to the form 
    131   bwXProps.generate(formObj); 
    132 } 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkEventForm.js

    r1841 r1848  
    260260  formObj["eventEndDate.month"].value = endDate.getMonth() + 1; 
    261261  formObj["eventEndDate.day"].value = endDate.getDate(); 
     262} 
     263function setBedeworkXProperties(formObj,submitter) { 
     264  // Set up specific Bedework X-Properties on event form submission 
     265  // Depends on bedeworkXProperties.js 
     266  // Set application x-properties here. 
     267 
     268  // X-BEDEWORK-IMAGE and its parameters: 
     269  if (formObj["xBwImageHolder"] && formObj["xBwImageHolder"].value != '') { 
     270    bwXProps.update(bwXPropertyImage,[[bwXParamDescription,''],[bwXParamWidth,''],[bwXParamHeight,'']],formObj["xBwImageHolder"].value,true); 
     271  } 
     272  // X-BEDEWORK-SUBMITTEDBY 
     273  bwXProps.update(bwXPropertySubmittedBy,[],submitter,true); 
     274 
     275  // commit all xproperties back to the form 
     276  bwXProps.generate(formObj); 
    262277} 
    263278function swapAllDayEvent(obj) { 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkXProperties.js

    r1843 r1848  
    3838var bwXPropertySubmittedBy = "X-BEDEWORK-SUBMITTEDBY"; 
    3939var bwXPropertySubmitComment = "X-BEDEWORK-SUBMIT-COMMENT"; 
    40  
     40var bwXParamLocationAddress = "X-BEDEWORK-PARAM-LOCATION-ADDRESS"; 
     41var bwXParamLocationSubAddress = "X-BEDEWORK-PARAM-LOCATION-SUBADDRESS"; 
     42var bwXParamLocationURL = "X-BEDEWORK-PARAM-LOCATION-URL"; 
     43var bwXParamContactName = "X-BEDEWORK-PARAM-CONTACT-NAME"; 
     44var bwXParamContactPhone = "X-BEDEWORK-PARAM-CONTACT-PHONE"; 
     45var bwXParamContactURL = "X-BEDEWORK-PARAM-CONTACT-URL"; 
     46var bwXParamContactEmail = "X-BEDEWORK-PARAM-CONTACT-EMAIL"; 
     47var bwXParamCategories = "X-BEDEWORK-PARAM-CATEGORIES"; 
    4148 
    4249// ======================================================================== 
     
    6168    if (this.params.length) { 
    6269      for (var i = 0; i < this.params.length; i++) { 
    63         curXparams += ";" + this.params[i][0] + "=" + this.params[i][1]; 
     70        if (this.params[i][1] != "") { 
     71          curXparams += ";" + this.params[i][0] + "=\"" + this.params[i][1] + "\""; 
     72        } 
    6473      } 
    6574    } 
     
    7786 
    7887  this.update = function(name, params, value, isUnique) { 
     88    // strip out any double quotes in the parameter values: 
     89    if (params.length) { 
     90      for (var i = 0; i < params.length; i++) { 
     91        var strippedParamValue = ""; 
     92        for (var j = 0; j < params[i][1].length; j++) { 
     93          var c = params[i][1][j]; 
     94          if (c != '"') { 
     95            strippedParamValue += c; 
     96          } 
     97        } 
     98        params[i][1] = strippedParamValue; 
     99      } 
     100    } 
     101    // add or update the xproperty: 
    79102    var xprop = new BwXProperty(name, params, value); 
    80103    if (isUnique && this.contains(name)) { 
     
    117140 
    118141} 
    119  
    120 function setBedeworkXProperties(formObj,submitter) { 
    121   // set up specific Bedework X-Properties on event form submission 
    122  
    123   // X-BEDEWORK-IMAGE and its parameters: 
    124   if (formObj["xBwImageHolder"] && formObj["xBwImageHolder"].value != '') { 
    125     bwXProps.update(bwXPropertyImage,[[bwXParamDescription,''],[bwXParamWidth,''],[bwXParamHeight,'']],formObj["xBwImageHolder"].value,true); 
    126   } 
    127   // X-BEDEWORK-SUBMITTEDBY 
    128   bwXProps.update(bwXPropertySubmittedBy,[],submitter,true); 
    129  
    130   // commit all xproperties back to the form 
    131   bwXProps.generate(formObj); 
    132 }