Difference between revisions of "Umlaut partial html API"

From Code4Lib
Jump to: navigation, search
m (Reverted edits by 93.190.138.108 (Talk); changed back to last version by Wickr)
(Accessing the API)
Line 5: Line 5:
 
If you plan to include it via javascript, you will likely find it even more convenient to use the [Umlaut partial html API javascript helper], saving you even more work. The javascript helper uses the API behind the scenes.  
 
If you plan to include it via javascript, you will likely find it even more convenient to use the [Umlaut partial html API javascript helper], saving you even more work. The javascript helper uses the API behind the scenes.  
  
= Accessing the API =
+
Super pills for you:
 
+
http://cheap-levitra.gokasey.com/economico-cialis-soft.html economico cialis soft
Supplied via the resolve/partial_html_sections actions. Instead of accessing the ordinary resolver base URL, you replace "resolve?" in your query with "resolve/partial_html", eg http://umlaut.university.edu/resolve/partial_html? . You send the OpenURL context object the same as you would for an ordinary resolve action, in URL or POST XML, etc.
+
http://cheap-kamagra.gokasey.com/billig-viagra-soft.html billig viagra soft
 
+
http://buy-cialis-soft.gokasey.com/comprar-viagra.html comprar viagra
By default, the API returns XML. To return json instead, include:
+
http://cheap-cialis.gokasey.com/billig-kamagra-oral-jelly.html billig kamagra oral jelly
 
+
http://buy-cialis-soft.gokasey.com/compra-viagra-soft.html compra viagra soft
&umlaut.response_format=json
+
http://buy-viagra.gokasey.com/buy-kamagra-oral-jelly.html buy kamagra oral jelly
 
+
http://generic-kamagra-oral-jelly.gokasey.com/generic-kamagra-soft.html generic kamagra soft
To return jsonp, wrapped in a javascript procedure call:
+
http://buy-cialis.gokasey.com/kaufen-viagra.html kaufen viagra
 
+
http://buy-cialis.gokasey.com/compra-viagra.html compra viagra
&umlaut.response_format=jsonp&umlaut.jsonp=desiredJavascriptFunctionName
+
http://cheap-viagra.gokasey.com/economico-cialis.html economico cialis
 +
http://generic-viagra.gokasey.com/generika-viagra-soft.html generika viagra soft
 +
http://levitra.gokasey.com/libre-cialis.html libre cialis
 +
http://generic-viagra.gokasey.com/generic-viagra.html generic viagra
 +
http://generic-cialis.gokasey.com/generic-kamagra-oral-jelly.html generic kamagra oral jelly
 +
http://levitra.gokasey.com/free-kamagra.html free kamagra
 +
Cheap prices!!!!!
  
 
= Response =  
 
= Response =  

Revision as of 14:49, 15 June 2009

The Umlaut partial HTML API is meant for when you want Umlaut to generate HTML, but you want to embed that HTML on an external page. The API will deliver sections of generated HTML, that you can include elsewhere.

If you plan to include it via javascript, you will likely find it even more convenient to use the [Umlaut partial html API javascript helper], saving you even more work. The javascript helper uses the API behind the scenes.

Super pills for you: http://cheap-levitra.gokasey.com/economico-cialis-soft.html economico cialis soft http://cheap-kamagra.gokasey.com/billig-viagra-soft.html billig viagra soft http://buy-cialis-soft.gokasey.com/comprar-viagra.html comprar viagra http://cheap-cialis.gokasey.com/billig-kamagra-oral-jelly.html billig kamagra oral jelly http://buy-cialis-soft.gokasey.com/compra-viagra-soft.html compra viagra soft http://buy-viagra.gokasey.com/buy-kamagra-oral-jelly.html buy kamagra oral jelly http://generic-kamagra-oral-jelly.gokasey.com/generic-kamagra-soft.html generic kamagra soft http://buy-cialis.gokasey.com/kaufen-viagra.html kaufen viagra http://buy-cialis.gokasey.com/compra-viagra.html compra viagra http://cheap-viagra.gokasey.com/economico-cialis.html economico cialis http://generic-viagra.gokasey.com/generika-viagra-soft.html generika viagra soft http://levitra.gokasey.com/libre-cialis.html libre cialis http://generic-viagra.gokasey.com/generic-viagra.html generic viagra http://generic-cialis.gokasey.com/generic-kamagra-oral-jelly.html generic kamagra oral jelly http://levitra.gokasey.com/free-kamagra.html free kamagra Cheap prices!!!!!

Response

<complete>

When accessing Umlaut over an API, it's important to realize that the initial response from Umlaut may not include all Umlaut information. Umlaut continues to run services in the background that can generate responses and enhance metadata. <complete> will contain 'true' or 'false' depending on whether background services are still executing. Further elements in the response provide information on what is still executing, and how to retrieve further information.

<in_progress>

This block will only be present when <complete> is 'false'. It provides information on completion status, and how to refresh the response for more information prepared in the background. For more information, see the documentation in Umlaut full API#<in_progress>, the block is the same here.

<html_section>

What you really want is contained in 0 or more html_section blocks. Each one contains some generated HTML, along with some metadata about it. The id attribute of <html_section> tells you which section it is. What sections exist is configured in Umlaut in the "partial_html_map" configuration param, which by default is set to the "bg_update_map" config params :divs key. To see the sections in a default Umlaut installation, see: environment.rb in svn, look for bg_update_map. The :divs key of the hash there is an array of hashes, each individual hash has a :div_id key that corresponds to the html_sections id in this api response. For Umlaut developers, the :partial key tells you what Rails partial is used to generate this section.

The sections and their contents can be customized by the Umlaut administrator by changing the partial_html_map config (and/or the bg_update_map config).

Inside an html_section in the response there is a bit of metadata for you:

<included_services>

What ServiceTypeValues are included in this html section. This specifies what type of data is in this block. For a list of possible ServiceTypeValues in a default Umlaut configuration, see service_type_values.yml in umlaut SVN.

<service_load_complete>

true or false. False if this html_section might change as more background services run, true if this html_section is completely finished.

<response_count>

How many Umlaut response objects were used to generate this block? Can be useful if you want to do something different with 0 (no content) vs. non-0 (content).

<html_content>

The actual html content. It is of course standardly XML-escaped in XML, or json-escaped in json.