Librarian Instructions
What is the CU*Answers Librarian Web Service?
Basically, its a centralized document library. The Librarian keeps special documents up to date that you can use on your website if you are a CU*Answers Client. When a member visits your website and requests a document, your website in turn, asks the CU*Answers Librarian for the current version of it, and returns it to your website. So to the member, it looks like it all came from you.
Already Hosting with CU*Answers?
If your website is already hosted with CU*Answers, then all you have to do is let the CU*Answers Web Services Department know which documents you want and where you want them. See, we already have a friendly relationship with the Librarian, and already have the means to check out documents to your website.
Going it Alone?
If you are not hosted with CU*Answers, or are going to go it alone, here is what you need to know. The Librarian is a REST web service. So you need to have a mechanism to create this type of request from your website. Then, the Librarian is going to return to you a XML document, so you are going to have to know how to parse that.
Ask the Librarian for the Document
The Librarian Web Service URL is http://library.cuanswers.com/librarian.php?docid=1000. Replace the 1000 with the actual Document ID you selected from the Catalog.
What you'll get back is an XML document in the form:
<CULibraryDocument> <title>Document Title </title> <payload type="HTML"> Document Content </payload> <category>Document Category </category> <datetime>2006-08-03 13:56:27.000</datetime> </CULibraryDocument>
Depending on how your browser handles XML1, you may be able to see an example here: Sample XML. (Not for the technically faint of heart.)
Parse out the payload
Using whatever XML tools you have available, parse the XML. The payload is what you are interested in. This will contain the HTML to be included in your site. The other information is for organization, parsing and future enhancements.
Styling
We've wrapped the all payload content inside a "div" with an "id" of"library_content". This gives you complete control over how to style the Library Document, and still allows it to inherit the exiting styles of your website.
1 Mozilla Firefox will show the XML Feed in the web browser. Some version of Microsoft Internet Explorer do not.