Beispiel #1
0
 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
Beispiel #2
0
 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
   
     
Beispiel #3
0
 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
Beispiel #4
0
 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