public ExplainInformationDTO explain() {
ExplainInformationDTO result = new ExplainInformationDTO();
Configuration directory = (Configuration) appl_ctx.getBean("JZKitConfig");
try {
// Populate explain information
// if we used ValidIndices we would use this code
/*
CollectionDescriptionDBO cd = directory.lookupCollectionDescription("Default");
if (cd!= null ) {
Map<String, AttrValue> mappings = cd.getSearchServiceDescription().getServiceSpecificTranslations();
Map<String,String> reverse_mappings = new HashMap<String, String>();
for (String key: mappings.keySet()) {
reverse_mappings.put(mappings.get(key).toString(), key);
}
AttributeSetDBO attrs = cd.getSearchServiceDescription().getValidAttrs().get("AccessPoint");
List<GNExplainInfoDTO> list = new ArrayList<GNExplainInfoDTO>();
for (AttrValue val: attrs.getAttrs() ) {
GNExplainInfoDTO exl = new GNExplainInfoDTO();
exl.addMapping(val.getValue(), val.getNamespaceIdentifier());
String reverse_key = val.getNamespaceIdentifier()+":"+val.getValue();
if (reverse_mappings.containsKey(reverse_key)) {
String[] temp = reverse_mappings.get(reverse_key).split("\\.");
if (temp.length==3) exl.addMapping(temp[1]+"."+temp[2], temp[0]);
if (temp.length==2) exl.addMapping(temp[1], temp[0]);
}
list.add(exl);
}
result.setDatabaseInfo(list);
}
*/
// but we use Crosswalks (the info on what we actually accept is in the geo profile, but we suppose
// that the crosswalks will eventually lead to a valid attribute)
// this should really be done differently but unfortunately there is
// no way to know if a mapping is for an attribute (can be a relation, too)
// we take as indicator the fact that are is a "1"
Pattern p = Pattern.compile(".*\\.1\\.([0-9]+)$" );
@SuppressWarnings("unchecked")
Iterator<CrosswalkDBO> it = directory.enumerateCrosswalks();
List<GNExplainInfoDTO> list = new ArrayList<GNExplainInfoDTO>();
while (it.hasNext()) {