Difference between revisions of "Integration/ContentConnector"

From TempusServa wiki
Jump to navigation Jump to search
old>Admin
old>Admin
Line 19: Line 19:
# Go to "Integration" > "Content connector"
# Go to "Integration" > "Content connector"
# Add new element
# Add new element
## Give the connector a unique name
## Give the connector a unique name (CONNECTOR_NAME>)
## Choose solution and set command type (as seen in the "command" parameter in the URL)
## Choose solution and set command type (as seen in the "command" parameter in the URL)
## Paste alle parameters from the URL above
## Paste alle parameters from the URL above
Line 25: Line 25:
# Test the new connector
# Test the new connector


Example URL
Example URL's
 
  http://myserver.dk/TS/'''cmsinterface?q='''<CONNECTOR_NAME>
  http://myserver.dk/TS/'''cmsinterface?q=customerList&v=3'''


== CMS system setup (consumer) ==
== CMS system setup (consumer) ==

Revision as of 20:14, 21 January 2014

CMS content provider

Tempus Serva setup (provider)

Frontend

  1. Make the request that suits youre needs
    • Filters and parameters
    • Sorting / grouping
    • Fields to display
    • Fields to display
    • Page size
  2. Save the view
  3. Click on the view and copy the parameters

Backend

  1. Go to "Integration" > "Content connector"
  2. Add new element
    1. Give the connector a unique name (CONNECTOR_NAME>)
    2. Choose solution and set command type (as seen in the "command" parameter in the URL)
    3. Paste alle parameters from the URL above
      • Optionally add other settings like Language and Stylesheet
  3. Test the new connector

Example URL's

  http://myserver.dk/TS/cmsinterface?q=<CONNECTOR_NAME>
  http://myserver.dk/TS/cmsinterface?q=customerList&v=3

CMS system setup (consumer)

Option: Client rendering

The following procedure

  1. Make sure JQuery is available (normal JS can do the job)
  2. Insert content placeholder and Javascript code
  <script>
    jQuery.ajax(
    { 
      url: 'http://www.lsvgroup.com/TempusServaProxy.php?q=examdates', 
      success: function(data) { jQuery('#tsContent').html(data); } 
     });
  </script>

Note: The URL above should possibly be exchanged by the URL to a proxy script (see below).

Option: Server side include

Insert code that fetches the content

  echo file_get_contents("http://www.lsvgroup.com/TempusServaProxy.php?q=examdates")


Overcoming XSS protection

I cases where the TempusServa server and the CMS system is on different domains (ex. acme.shared.com and cms.acme.com), browsers will prevent pages from accessing content from other servers.

Three options exist

  1. Set up server to allow XSS (not recommended)
  2. Use server side includes (ok, but not supported everywhere)
  3. Set up a mini proxyserver

A mini proxyserver written i PHP is very simple (aspx/jsp will have similar features).

  <?php 
   echo file_get_contents("http://myserver.dk/TS/cmsinterface?q=".$_GET["q"]."&v=".$_GET["v"]);

Afterwards you just make the calls through the proxy using exact same parameters.