1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/61a423fddc6b/ Changeset: 61a423fddc6b User: carlfeberhard Date: 2014-03-14 21:03:48 Summary: Visualization Framework: add an 'embeddable' flag to visualization config files indicating whether the visualization can reliably be rendered outside a page or iframe and within another page; pass the embeddable flag to the links rendered from the registry; (more information and example at https://bitbucket.org/carlfeberhard/galaxy-embedded-visualization-template/o...) Affected #: 2 files diff -r b8f9e583b04024a8e181f5c0ef149b5aad51dba7 -r 61a423fddc6b82f9bc626318fddbf5c31a967c90 config/plugins/visualizations/visualization.dtd --- a/config/plugins/visualizations/visualization.dtd +++ b/config/plugins/visualizations/visualization.dtd @@ -3,10 +3,14 @@ <!-- visualization name: the title/display name of the visualization (e.g. 'Trackster', 'Fastq Stats', etc.) REQUIRED disabled: if included (value does not matter), this attribute will prevent the visualization being loaded + embeddable: if included (value does not matter), indicates that this visualization can be rendered as a DOM + fragment and won't render to a full page when passed the variable 'embedded' in the query string. + DEFAULT false. --><!ATTLIST visualization name CDATA #REQUIRED disabled CDATA #IMPLIED + embeddable CDATA #IMPLIED
<!ELEMENT description (#PCDATA)>
diff -r b8f9e583b04024a8e181f5c0ef149b5aad51dba7 -r 61a423fddc6b82f9bc626318fddbf5c31a967c90 lib/galaxy/visualization/registry.py --- a/lib/galaxy/visualization/registry.py +++ b/lib/galaxy/visualization/registry.py @@ -211,11 +211,13 @@ url = self.get_visualization_url( trans, target_object, visualization_name, param_data ) display_name = visualization.config.get( 'name', None ) render_target = visualization.config.get( 'render_target', 'galaxy_main' ) + embeddable = visualization.config.get( 'embeddable', False ) # remap some of these vars for direct use in ui.js, PopupMenu (e.g. text->html) return { - 'href' : url, - 'html' : display_name, - 'target': render_target + 'href' : url, + 'html' : display_name, + 'target' : render_target, + 'embeddable': embeddable } return None @@ -394,6 +396,14 @@ if not returned[ 'name' ]: raise ParsingException( 'visualization needs a name attribute' ) + # record the embeddable flag - defaults to false + # this is a design by contract promise that the visualization can be rendered inside another page + # often by rendering only a DOM fragment. Since this is an advanced feature that requires a bit more + # work from the creator's side - it defaults to False + returned[ 'embeddable' ] = False + if 'embeddable' in xml_tree.attrib: + returned[ 'embeddable' ] = xml_tree.attrib.get( 'embeddable', False ) == 'true' + # a (for now) text description of what the visualization does description = xml_tree.find( 'description' ) returned[ 'description' ] = description.text.strip() if description is not None else None Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.