def jsapp_html(self):
     return jsapp_html(
             DATASOURCE_URL='',
             SCENARIO_URL='',
             DATA_REVISION='',
             CUBE_DIMENSIONS=[],
             JSAPP_URL=self.JSAPP_URL)
def jsapp_html_for_visualization(visualization):
    source = get_source(visualization)

    if not source:
        return "No data source available"

    root_url = visualization.portal_url.getPortalObject().absolute_url()
    JSAPP_URL = root_url + '/++resource++scoreboard-jsapp'
    cube = source.get_cube()
    return jsapp.jsapp_html(DATASOURCE_URL=source.absolute_url(),
                            SCENARIO_URL=visualization.absolute_url(),
                            DATA_REVISION=cube.get_revision(),
                            CUBE_DIMENSIONS=cube.get_dimensions(flat=True),
                            JSAPP_URL=JSAPP_URL)
 def jsapp_html(self):
     return jsapp_html(URL=self.context.absolute_url())