OUseful Web Service
OUseful Course Search Tool
The OUseful course search tool allows you to search a mySQL database
to identify a course code and course title from the following search terms:
- a course code, or part of a course code;
- a particular level of study;
- a keyword or keyphrase that appears in the course title.
Format of OUseful Course Search Tool Queries
- HTML output: courseSearchHTML.php
- RSS output: courseSearchRSS.php
- RSS output preview: view the RSS feed via rssViewer.php, setting
the variable rssURL to the URL of the RSS feed you wish to preview
(e.g. rssViewer.php?rssURL=http://whatever.com/whatever.rss)
- RSS feed embedded in your own page using Javascript: use the page rssViewerJS.php
and set rssURL to the URL of the RSS feed you wish to embed:
<script language="JavaScript" type="text/javascript"
src="$FULLPATH$/rssViewerJS.php?rssURL=$FULLPATH$/courseSearchRSS.php?CFSearch=T"></script>
Several classes are defined in the output table to facilitate your own styling:
<table class="rssResultItemTable">
<tr class="rssResultItemTitleRow"><td class="rssResultItemTitleCell"></td></tr>
<tr class="rssResultItemLinkRow"><td class="rssResultItemLinkCell"></td></tr>
<tr class="rssResultItemDescRow"><td class="rssResultItemDescCell"></td></tr>
</table>
Searches are made by providing Key/Value pairs to the search page:
- CCSearch: search by course code (e.g. CCSearch=T396)
or partial course code (e.g. CCSearch=171);
- CFSearch: search by Faculty (e.g. for the Arts Faculty,
CFSearch=A). Note that upper/lower case distinctions are ignored.
- CKWSearch: search by keyword (e.g. CKWSearch=intelligence). In the HTML output version, this search additionally returns the first 10 hits from a Google search (using the Google web service API) on that keyword;
- CLSearch search by course level (e.g. CLSearch=2);
| Faculty |
Identifier |
| Arts and Humanities |
A |
| Social Science |
D |
| Maths and Computing |
M |
| Science |
S |
| Technology |
T |
- CLSearch: search by course level (e.g. to search for 3rd
level courses, CLSearch=3);
- CKWSearch: search by keyword (e.g. CKWSearch=history).
Note that upper/lower case distinctions are ignored.
- CSSearch: specialist searches. For example, CSSearch=residential
will identify residential courses.
For example, here is a search for Science courses on evolution (RSS) and
here is a search for Level 2 Technology residential courses (RSS).
Note that the keyword search HTML results page also embeds a Google search (implemented using the Google web service) on the same keyword in the results.
OUseful Course Search Web Service
The OUseful web service is a course search web service written using the PHP
nusoap library:
$server = new soap_server();
The service can be found at http://ouseful.open.ac.uk/codeService.php.
The WSDL file for this webservice can be found at http://ouseful.open.ac.uk/codeService.php?wsdl
At the current time, the following functions are supported:
- ccsearch: return the course code and name of the course for a particular
course code;
- cc2search: return a list of course codes and course titles for
a search on a full or partial course code, and/or a keyword appearing in the
course title;
- cbsearch: return list of course books for a particular course code;
- ccbsearch: return the name of a course and a list of course books
for a particular course code.
We have provided a sample client (http://ouseful.open.ac.uk/codeServiceProxy.php)
that will display the results of calls to the various functions supported by
the web service:
At the current time, there is little or no defensive programming associated
with the web service sample client. For example, you must pass a valid course
code to the
Definitions
| ccsearch |
| Input |
ccode: string |
$server->register('ccsearch', // method name array('ccode' => 'xsd:string'), // input parameters array('return' => 'tns:CCInfo'), // output parameters 'urn:codeservice', // namespace 'urn:codeservice#ccsearch', // soapaction 'rpc', // style 'encoded', // use 'Perform a course code search and return course code and title' // documentation );
|
| Output |
return: CCInfo |
| cc2search |
| Input |
ccSearchItems: CCSearchRQ |
$server->register('cc2search', // method name array('ccSearchItems' => 'tns:CCSearchRQ'), // input parameters array('return' => 'tns:CCList'), // output parameters 'urn:codeservice', // namespace 'urn:codeservice#cc2search', // soapaction 'rpc', // style 'encoded', // use 'Perform a full course code search and return list of courses' // documentation );
|
| Output |
return: CCList |
| cbsearch |
| Input |
ccode: string) |
$server->register('cbsearch', // method name array('ccode' => 'xsd:string'), // input parameters array('return' => 'tns:CBList'), // output parameters 'urn:codeservice', // namespace 'urn:codeservice#cbsearch', // soapaction 'rpc', // style 'encoded', // use 'Perform a course code search and return list of course books' // documentation );
|
| Output |
return: CBList |
| ccbsearch |
| Input |
ccode (string) |
$server->register('ccbsearch', // method name array('ccode' => 'xsd:string'), // input parameters array('return' => 'tns:CCBList'), // output parameters 'urn:codeservice', // namespace 'urn:codeservice#ccbsearch', // soapaction 'rpc', // style 'encoded', // use 'Perform a course code search and return list of course details and course books' // documentation );
|
| Output |
return: CCBList |
| Types |
| CCInfo |
ccode: string
ctitle: string |
$server->wsdl->addComplexType( 'CCInfo', 'complexType', 'struct', 'all', '', array( 'ccode' => array('name' => 'ccode', 'type' => 'xsd:string'), 'ctitle' => array('name' => 'ctitle', 'type' => 'xsd:string') ) );
|
| CCList |
CCInfo[ ] |
$server->wsdl->addComplexType( 'CCList', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array( array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:CCInfo[]') ), 'tns:CCInfo' );
|
| CCSearchRQ |
ccode: string
ctitleKW: string |
$server->wsdl->addComplexType( 'CCSearchRQ', 'complexType', 'struct', 'all', '', array( 'ccode' => array('name' => 'ccode', 'type' => 'xsd:string'), 'ctitleKW' => array('name' => 'ctitleKW', 'type' => 'xsd:string') ) );
|
| CBInfo |
booktitle: string
isbn: string
author: string |
$server->wsdl->addComplexType( 'CBInfo', 'complexType', 'struct', 'all', '', array( 'booktitle' => array('name' => 'booktitle', 'type' => 'xsd:string'), 'isbn' => array('name' => 'isbn', 'type' => 'xsd:string'), 'author' => array('name' => 'author', 'type' => 'xsd:string') ) );
|
| CBList |
CBInfo[ ] |
$server->wsdl->addComplexType( 'CBList', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array( array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:CBInfo[]') ), 'tns:CBInfo' );
|
| CCBList |
ccode: string
ctitle: string
coursebooks: CBList |
$server->wsdl->addComplexType( 'CCBList', 'complexType', 'struct', 'all', '', array( 'ccode' => array('name' => 'ccode', 'type' => 'xsd:string'), 'ctitle' => array('name' => 'ctitle', 'type' => 'xsd:string'), 'coursebooks' => array('name' => 'coursebooks', 'type' => 'tns:CBList') ) );
|