def getdropdown(dropdown): form = {'institution': institution} if dropdown == 'tricoderusers': return constants.tricoderUsers() elif dropdown == 'handlers': return constants.getHandlers(form) elif dropdown == 'reasons': return constants.getReasons(form) elif dropdown == 'printers': return constants.getPrinters(form) elif dropdown == 'fieldset': return constants.getFieldset(form) elif dropdown == 'hierarchies': return constants.getHierarchies(form) elif dropdown == 'altnumtypes': return constants.getAltNumTypes(form) elif dropdown == 'objtype': return constants.getObjType(form) elif dropdown == 'collman': return constants.getCollMan(form) elif dropdown == 'agencies': return constants.getAgencies(form) elif dropdown == 'activities': return constants.getActivities(form) elif dropdown == 'periods': return constants.getPeriods(form) return '', ''
def xxx(request, context, config): hierarchies = getHierarchies() context['hierarchies'] = hierarchies if "hierarchy" in request.GET: hierarchy = request.GET["hierarchy"] context['selected_hierarchy'] = hierarchy config_file_name = 'HierarchyViewer' res = dbqueries.gethierarchy(hierarchy, config) hostname = config.get('connect', 'hostname') institution = config.get('info', 'institution') port = config.get('link', 'port') protocol = config.get('link', 'protocol') link = protocol + '://' + hostname + port + '/collectionspace/ui/' + institution if hierarchy == 'taxonomy': link += '/html/taxon.html?csid=%s' elif hierarchy == 'places': link += '/html/place.html?csid=%s' else: link += '/html/concept.html?csid=%s&vocab=' + hierarchy for row in res: pretty_name = row[0].replace('"', "'") if len(pretty_name) > 0 and pretty_name[0] == '@': pretty_name = '<' + pretty_name[1:] + '> ' pretty_name = pretty_name + '", url: "' + link % (row[2]) data = re.sub(r'\n { label: "(.*?)"},', r'''\n { label: "no parent >> \1"},''', res) context['data'] = data return context
def xxx(request,context,config): hierarchies = getHierarchies() context['hierarchies'] = hierarchies if "hierarchy" in request.GET: hierarchy = request.GET["hierarchy"] context['selected_hierarchy'] = hierarchy config_file_name = 'HierarchyViewer' res = dbconnector.gethierarchy(hierarchy, config) hostname = config.get('connect', 'hostname') institution = config.get('info', 'institution') port = config.get('link', 'port') protocol = config.get('link', 'protocol') link = protocol + '://' + hostname + port + '/collectionspace/ui/' + institution if hierarchy == 'taxonomy': link += '/html/taxon.html?csid=%s' elif hierarchy == 'places': link += '/html/place.html?csid=%s' else: link += '/html/concept.html?csid=%s&vocab=' + hierarchy for row in res: pretty_name = row[0].replace('"', "'") if len(pretty_name) > 0 and pretty_name[0] == '@': pretty_name = '<' + pretty_name[1:] + '> ' pretty_name = pretty_name + '", url: "' + link % (row[2]) data = re.sub(r'\n { label: "(.*?)"},', r'''\n { label: "no parent >> \1"},''', res) context['data'] = data return context