def getMintLabelByLookup(self, urlName, key, resKey, valKey): mapIds = HashMap() value = String(self.metadata.get(key)).replace(":", "\:") if value is None: return None labels = ArrayList() mapIds.put("searchTerms", value) labelsMint = MintLookupHelper.get(self.systemConfig, urlName, mapIds) self.log.debug(labelsMint.toString()) resultsArr = labelsMint.getArray(resKey) if resultsArr is None: return None for result in resultsArr: labelJson = JsonSimple(result) labels.add(labelJson.getString("", valKey)) return labels
def getMintLabels(self, urlName, key, suffix): mapIds = HashMap() valList = self.getList(key) ids = "" for eKey in valList.keySet(): entry = valList.get(eKey) if len(ids) > 0: ids = "%s,"%ids ids = "%s%s" % (ids,entry.get(suffix)) if ids == "": return None else: labels = ArrayList() mapIds.put("id", ids) labelsMint = MintLookupHelper.get(self.systemConfig, urlName, mapIds) self.log.debug(labelsMint.getJsonArray().toString()) for label in labelsMint.getJsonArray(): labelJson = JsonSimple(label) labels.add(labelJson.getString("", "label")) return labels
def getMintLabels(self, urlName, key, suffix): mapIds = HashMap() valList = self.getList(key) ids = "" for eKey in valList.keySet(): entry = valList.get(eKey) if len(ids) > 0: ids = "%s," % ids ids = "%s%s" % (ids, entry.get(suffix)) if ids == "": return None else: labels = ArrayList() mapIds.put("id", ids) labelsMint = MintLookupHelper.get(self.systemConfig, urlName, mapIds) self.log.debug(labelsMint.getJsonArray().toString()) for label in labelsMint.getJsonArray(): labelJson = JsonSimple(label) labels.add(labelJson.getString("", "label")) return labels