Bedework Specific X-Properties

X-Properties are a means of extending ical to define custom fields.

All Bedework X-Properties take the following form:
X-BEDEWORK-PROPERTYNAME;param1;param2;param3:value
Bedework X-Property names are declared at the top of bedeworkXProperties.js. If you would like an X-Property to be considered for inclusion in Bedework, we suggest beginning the name with "X-BEDEWORK-".

Local properties can be named appropriately, e.g. X-MYUNIVERSITY-PROPNAME.

Bedework X-Properties

X-Property Name Property Value Parameters Description
X-BEDEWORK-IMAGE URL of image resource X-BEDEWORK-PARAM-WIDTH
X-BEDEWORK-PARAM-HEIGHT
X-BEDEWORK-PARAM-DESCRIPTION
URL of image to be included with event description in web views
X-BEDEWORK-SUBMITTEDBY UserID of event submitter none Assembles the userId of the event submitter, the group name, and the group userId

Adding Custom X-Properties

Add custom X-Property handling to the setBedeworkXProperties() function of bedeworkEventForm.js. This function takes the event form object as a parameter; you can convert a custom form field to an x-property using the update() method of the x-property javascript object (declared in bedeworkXProperties.js in admin, submission, and user clients):

bwXProps.update(name,params,value,isUnique);

The update method takes the following parameters:

  • name - name of the x-property, e.g. X-MYUNIVERSITY-GPSCOORDS
  • params - series of key value pairs expressed in a 2-D array
  • value - value of the x-property
  • isUnique - true or false; if true, Bedework will only allow one x-property with this name.

Example:

function setBedeworkXProperties(formObj,submitter) {
  // set up specific Bedework X-Properties on event form submission
  // Depends on bedeworkXProperties.js
  // Set application local x-properties here.
 	
  // X-BEDEWORK-IMAGE and its parameters:
  if (formObj["xBwImageHolder"] && formObj["xBwImageHolder"].value != '') {
    bwXProps.update(bwXPropertyImage,
                  [[bwXParamDescription,'An Orca!'],
                   [bwXParamWidth,'400'],
                   [bwXParamHeight,'300']],
                   formObj["xBwImageHolder"].value,true);
  }
  // X-BEDEWORK-SUBMITTEDBY
  bwXProps.update(bwXPropertySubmittedBy,[],submitter,true);
	
  // commit all xproperties back to the form
  bwXProps.generate(formObj);
}

Note: in this example, the image parameters are hard coded. The value of formObj["xBwImageHolder"] will be a url reference to an image.

X-Property Output

X-Properties are output within the event XML like so:

<event>
:
:
  <xproperties>

     <X-BEDEWORK-SUBMITTEDBY>
        <values>
           <text>caladmin for Communications (agrp_admGrp2)</text>
        </values>
     </X-BEDEWORK-SUBMITTEDBY>

     <X-BEDEWORK-IMAGE>
        <parameters>
          <X-BEDEWORK-PARAM-DESCRIPTION>An Orca!</X-BEDEWORK-PARAM-DESCRIPTION>
          <X-BEDEWORK-PARAM-WIDTH>400</X-BEDEWORK-PARAM-WIDTH>
          <X-BEDEWORK-PARAM-HEIGHT>300</X-BEDEWORK-PARAM-HEIGHT>
        </parameters>
        <values>
          <text>http://photography.naturestocklibrary.com/orca-stock-photo.jpg</text>
        </values>
     </X-BEDEWORK-IMAGE>
     
  </xproperties>
:
:
</event>    

note: if no parameters are present, they will not be output