You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by sc...@apache.org on 2012/01/19 23:47:40 UTC

svn commit: r1233621 - in /incubator/wookie/trunk/widgets/templates: browse/readme.txt itemDetail/readme.txt

Author: scottbw
Date: Thu Jan 19 22:47:40 2012
New Revision: 1233621

URL: http://svn.apache.org/viewvc?rev=1233621&view=rev
Log:
Updated readmes replacing references to XSL with new HTML templates - see WOOKIE-297

Modified:
    incubator/wookie/trunk/widgets/templates/browse/readme.txt
    incubator/wookie/trunk/widgets/templates/itemDetail/readme.txt

Modified: incubator/wookie/trunk/widgets/templates/browse/readme.txt
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/browse/readme.txt?rev=1233621&r1=1233620&r2=1233621&view=diff
==============================================================================
--- incubator/wookie/trunk/widgets/templates/browse/readme.txt (original)
+++ incubator/wookie/trunk/widgets/templates/browse/readme.txt Thu Jan 19 22:47:40 2012
@@ -11,11 +11,19 @@ This section describes how the template 
 
 ** Results list
 
-The initial results list is generated by retrieving and XML document or JSON file from the URL defined by
-"browse.index.url". This document is then transformed into HTML using a stylesheet defined
-in "browse.index.xsl.url" which degaults to "index2html.xsl". We recommend copying this 
-stylesheet to your widget definition and editing it to process the data returned by your
-API.
+The initial results list is generated by retrieving and XML document or JSON file from the 
+URL defined by "browse.index.url".
+
+This document is then transformed into HTML using a template; the template item_summary_template.html 
+is used for the item summaries shows in the list, and item_template.html for the item
+descriptions when an item is expanded (see below). Properties defined in the widget.properties file 
+(browse.item.elements and browse.item.attributes) are read from the JSON or XML and substituted 
+for tokens in these HTML files. For example, if browse.item.elements="title", then the content
+of the <title> element from the results will replace ${TITLE} in the HTML template. Note that
+the tokens always use uppercase.
+
+We recommend copying item_template.html and item_summary_template.html and editing them to display data 
+returned by your API. Note that the templates must use single (') instead of double (") quotes.
 
 If a search had been performed in the form provided then the results are retrieved from the 
 URL defined by "browse.search.url". Note that the variable "query" defines the search string
@@ -27,8 +35,7 @@ The results are displayed in an accordio
 
 When generating the results list you need to ensure that each item has an attribute "wid" which
 contains the ID of the item in question. This is later used for retrieving the details about that
-item. See the templates example "index2html.xsl" or the "testWidgets/browseTestWidget/index2html.xsl"
-for examples.
+item. See "item_summary_template.html" for an example of populating the wid attribute.
 
 ** Result detail
 
@@ -36,11 +43,9 @@ When an item is expanded an ajax request
 The URL used is defined by "browse.get.detail.url", you can use the variable "itemId" as the
 identifier for this item.
  
-The XML returned is then transformed using XSLT to provide the HTML content that will be inserted
-into the expanded control. The location of the XSLT file is defined by "browse.detail.xsl.url" and
-defaults to "detail2html.xsl". We recommend copying this 
-stylesheet to your widget definition and editing it to process the data returned by your
-API.
+The XML or JSON returned is then rendered as HTML and inserted into the expanded control using
+the item_template.html HTML template in the same manner as the summaries.
+
 ** Events
 
 You can register callbacks for events using the

Modified: incubator/wookie/trunk/widgets/templates/itemDetail/readme.txt
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/itemDetail/readme.txt?rev=1233621&r1=1233620&r2=1233621&view=diff
==============================================================================
--- incubator/wookie/trunk/widgets/templates/itemDetail/readme.txt (original)
+++ incubator/wookie/trunk/widgets/templates/itemDetail/readme.txt Thu Jan 19 22:47:40 2012
@@ -2,7 +2,12 @@ This template creates a widget capable o
 
 In its default configuration an item is retrieved from the location defined by the property itemDetail.get.url.
 
-This is expected to return an XML document which is processed by the stylesheet defined in itemDetail.xsl.url.
+This is expected to return an XML or JSON document which is used to create HTML using item_template.html -
+any tokens defined in the template using the format ${TOKEN} will be replaced by matching elements defined in 
+browse.item.elements or attributes in browse.item.attributes returned by the API. 
+
+Note that the token is always in uppercase, and that item_template.html must only contain single (') and
+not double (") quotes.
 
 The initial item displayed is identified by the itemDetail.default.itemId property. However, this can be changed
 by calling Widget.preferences.setItem("itemId", value).