The GEOSS Discovery And Access Broker APIs
Authors: Fabrizio Papeschi, Mattia Santoro, Stefano Nativi
API version: 1.4.3-beta

ConceptTree

Module: UI

This control is based on the YUI TreeView Control version 2.9.0 (scripts are included in the minified version of the API) and provides a hierarchical representation of the DAB concept method.

  • Required CSS:

                        <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/fonts/fonts-min.css" />
                        <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/treeview/assets/skins/sam/treeview.css" />

When a tree node is expanded, the method extend is called on the correspondent Concept (available in the data property).

As depicted in the image above (the test page is available here) each Concept is rendered using its uri; rendering customization (e.g. icons visualization besides the uri) can be done with the options.onCreateNode and options.onLoadComplete functions (see also onCreateNode and onLoadComplete methods)

Constructor

ConceptTree

(
  • dabNode
  • id
  • [options]
)

Parameters:

Methods

conceptKeyword

(
  • keyword
)

Get and optionally set the keyword by which to generate the related concepts; the concepts will be rendered as tree nodes when the root tree node is expanded

Parameters:

Returns:

the keyword currently used to generate the related concept

onCreateNode

(
  • [callback]
)

Get and optionally set the callback function called when a new tree node is created; this function can be used to customize the new tree node aspect and/or functionalities. The default implementation is as follows:

function(element, parentTreeNode, isRoot){
                                            var oData = null;
                                            if(isRoot){
                                            // element is the DAB node
                                            oData = element.report().title;
                                            }else{
                                            // element is a Concept
                                            oData = element.uri();
                                            }
                                            return oData;
                                            }
                                            

Parameters:

Returns:

the current onCreateNode function

onLoadComplete

(
  • [callback]
)

Get and optionally set the function called when all the expanded node children have been rendered

Parameters:

Returns:

the current onLoadComplete function

relationExtension

(
  • treeNode
  • An
)

Get and optionally set the relations by which to extend the treeNode related concept. An example of use of this method can be found here where this method is used to set a single relation selected by the user (see also the image above).
See also Concept extend method

Parameters:

Returns:

the relation currently used to extend the treeNode related concept

Properties

tree

YAHOO.widget.TreeView

The tree which renders the DAB concept method hierarchical structure

treeRoot

YAHOO.widget.HTMLNode

The root of the tree with the DAB node in the data property