def parse_human_name(message): input = unicode(message.getParam("input")).encode('utf8') (wid, results) = api_calls.dispatch("parse_human_name", input) if results: out = HashMap() #.of_(String, JArray_int) for k,v in results.items(): out.put(k, v) message.setResults(out)
def get_field_value_using_bibcode(message): value = message.getParam('externalVal') if not value: return bibcode = str(value) message.threadInfo('got bibcode ' + bibcode) field = SchemaField.cast_(message.getParam('field')) field_name = field.getName() message.threadInfo('getting field value for field: %s' % field_name) ret = None if bibcode: start = time.time() (wid, results) = api_calls.dispatch('load_fulltext', bibcode, field_name) t = time.time() - start message.threadInfo("Fulltext load took: %s s. len=%s and was executed by: %s" % (t, len(results), wid)) message.setResults(results) else: message.threadInfo("hey, i didn't get a bibcode!") message.setResults("") return