@Override public Map<String, Object> listProperties(CompoundName path,Map<String,String> context, com.yahoo.processing.request.Properties substitution) { return super.listProperties(path, context == null ? requestMap : context, substitution); }
@Override public Map<String, Object> listProperties(CompoundName property,Map<String,String> context, com.yahoo.processing.request.Properties substitution) { return super.listProperties(unalias(property),context,substitution); }
@Override public Map<String, Object> listProperties(CompoundName path, Map<String, String> context, com.yahoo.processing.request.Properties substitution) { Map<String, Object> map = super.listProperties(path, context, substitution); for (Map.Entry<CompoundName, Object> entry : properties.entrySet()) { if ( ! entry.getKey().hasPrefix(path)) continue; CompoundName propertyName = entry.getKey().rest(path.size()); if (propertyName.isEmpty()) continue; map.put(propertyName.toString(), entry.getValue()); } return map; }
@Override public Map<String, Object> listProperties(CompoundName prefix, Map<String,String> context, com.yahoo.processing.request.Properties substitution) { Map<String, Object> properties = super.listProperties(prefix, context, substitution); for (CompoundName queryProperty : Query.nativeProperties) { if (queryProperty.hasPrefix(prefix)) { Object value = this.get(queryProperty, context, substitution); if (value != null) properties.put(queryProperty.toString(), value); } } return properties; }
private String dump(String profileName,String dir,String parameters) { // Import profiles if (dir.isEmpty()) dir = "."; File dirInAppPackage = new File(dir, "search/query-profiles"); if (dirInAppPackage.exists()) dir = dirInAppPackage.getPath(); QueryProfileXMLReader reader = new QueryProfileXMLReader(); QueryProfileRegistry registry = reader.read(dir); registry.freeze(); // Dump (through query to get wiring & parameter parsing done easily) Query query = new Query("?" + parameters, registry.compile().findQueryProfile(profileName)); Map<String,Object> properties = query.properties().listProperties(); // Create result StringBuilder b = new StringBuilder(); for (Map.Entry<String,Object> property : properties.entrySet()) { b.append(property.getKey()); b.append("="); b.append(property.getValue().toString()); b.append("\n"); } return b.toString(); }
@Override public Map<String, Object> listProperties(CompoundName path,Map<String,String> context, com.yahoo.processing.request.Properties substitution) { Map<String, Object> map = super.listProperties(path,context,substitution); if(path.isEmpty()) { map.putAll(parent.listProperties(getPathPrefix(),context,substitution)); } else { map.putAll(parent.listProperties(getPathPrefix() + "." + path,context,substitution)); } return map; }
properties.putAll(super.listProperties(path, context, substitution));
String fullName = prefix + field.getName(); if (field.getType() == FieldType.genericQueryProfileType) { // Generic map for (Map.Entry<String, Object> entry : originalProperties.listProperties(fullName, context).entrySet()) { try { properties().set(fullName + "." + entry.getKey(), entry.getValue(), context);