#!C:\Program Files\Python27\python.exe # -*- coding: UTF-8 -*- import os, sys, ssl # set path to lib and import sys.path.insert(0, os.path.abspath("../rw_common")) from lib import getRecordSet, ssi_to_tempfile from templating import PageMacro # Get schemalist from DB; page through and retrieve service list schemas = getRecordSet("""SELECT * FROM registry.used_schemas ORDER BY num_datasources DESC""") schemalist = [] for id, ns, num_ds in schemas: rs = getRecordSet("""SELECT name, access_point, count(concept_fk) as num_concepts FROM registry.datasource join registry.datasourceconcept on datasource_fk=datasource_id join registry.concept on concept_fk=concept_id WHERE schema_fk = %i AND active_flag = true GROUP BY datasource_id, name, access_point ORDER BY num_concepts DESC, name""" % id) l = ''.join(['