Knowledgebase

Article number: 301406

Feeding Back Data to a User via Sitekit CMS

feedback.aspx is an interoperability tool which connects the missing link between posting information via a webform and displaying results of XML via XSLT. feedback.aspx is a part of Sitekit CMS's API and part of the toolset which makes Sitekit CMS truly interoperable and extensible.

Purpose

feedback.aspx is designed to allow a website integrator to implement custom code which gives a ‘response’ based on a ‘request’. Specifically, it is a special page which provides a clean response in a standard format based on any request which uses a standard method. Because it is a general purpose tool, and based around popular open standards, it can be used for a wide range applications. It allows a 3rd party to set up sever-side processing of ‘requests’ via XSLT without the need for custom ASP or ASPX pages. And can be plugged seamlessly into existing Sitekit CMS modules and features.

Example usage

  • An integrator could create an online quiz which provides scoring and analysis when the user hits the ‘submit’ button.
  • An integrator could create a budget calculator form which adds, subtracts or multiples input from the user and calculates a result.
  • A 3rd party could hand over information from their system directly into Sitekit CMS for temporary display or further processes. For example a user could build a ‘profile’ in one system and use Sitekit to preview their profile via a ‘preview’ button.

Description of function

feedback.aspx performs the function of converting parameters from either HTTP POST or HTTP GET into nodes and values of a dynamically generated XML page.

The following URL
/admin/ws/feedback.aspx?age=23&forename=alex&surname=matheson
 returns the following XML

<?xml version="1.0"?>
<!--Use this function to feedback name value pairs passed to this page with either post or get methods.-->
<feedback>
 <age>23</age>
 <forename>alex</forename>
 <surname>matheson</surname>
</feedback> 

The input will be as ‘attribute=value’ pairs and the name of the output XML nodes will match the attributes specified, and the values of the XML nodes will match the values of the original request.

 The tool is designed to handle strange or illegal characters being passed in the request

  • For example an ‘&’ sign which normally is illegal as part of an XML nodes value will not cause errors in the output, but will simply split the affected name=value pair [as per the specifications of the HTTP GET method.

The tool will also handle other irregularities which might arise when converting the input format into the output.

  • For example, HTTP GET allows multiple iterations of the same attribute whereas this may potentially cause problems with XML (though normally not illegal). In order to prevent multiple iterations of the same attribute this tool will combine all as comma separated values.
    score=1&score=4&score=2 
    becomes
    <score>1,4,2</score>
    • This is normally standard when interpreting a query string.
  • Because of the potential to malform an XML document by specifying a reserved root node, or multiple root nodes, or no root node. The output will always be wrapped in a
    <feedback>
     root node.

Enviroment

Feedback.aspx can be combined with an Sitekit CMS XML consumer to generate useful HTML output based on form submissions, for example feedback.aspx could be set as the XML source page of a data island. It should be noted that any information passed into the page where a data island lives (front end) also gets passed to the XML source URI by appending it to the query string of the request. (back end)

This means that a developer could create a Sitekit CMS form, using the forms module, which the user can fill in and receive a results page showing some calculation, custom message, graph, etc based on their input.

It should be noted that any processing of the results, and display of results should be performed using XSL.

Related questions