for (ResultColumnInfo resultColumn : searchTypeInfo.getSearchResultTypeInfo().getResultColumns()) { SearchResultCellInfo resultCell = new SearchResultCellInfo(); resultCell.setKey(resultColumn.getKey());
SearchResultCellInfo cell = idToCellMap.get(loId); if(cell == null){ cell = new SearchResultCellInfo("lo.resultColumn.categoryName",""); idToCellMap.put(loId, cell);
private SearchResultRowInfo mapResultRow( String subSearchKey, SearchResultRowInfo row, CrossSearchTypeInfo crossSearchType) { SearchResultRowInfo resultRow = new SearchResultRowInfo(); for(JoinResultMappingInfo resultMapping: crossSearchType.getJoinResultMappings()){ if(subSearchKey.equals(resultMapping.getSubSearchKey())){ for(SearchResultCellInfo cell: row.getCells()){ if(resultMapping.getSubSearchResultParam().equals(cell.getKey())){ SearchResultCellInfo mappedCell = new SearchResultCellInfo(); mappedCell.setKey(resultMapping.getResultParam()); mappedCell.setValue(cell.getValue()); resultRow.getCells().add(mappedCell); break;//FIXME breaks are bad... but there is no map in the cells } } } } return resultRow; } /**
/** * Maps results from multiple searches into a single result row * * @param permutation * @param crossSearchType * @return a mapped SearchResultRowInfo */ private SearchResultRowInfo mapResultRow( Map<String, SearchResultRowInfo> permutation, CrossSearchTypeInfo crossSearchType) { //FIXME this is pretty inefficient to loop through everything... a map structure for the cells might be better SearchResultRowInfo resultRow = new SearchResultRowInfo(); for(JoinResultMappingInfo resultMapping: crossSearchType.getJoinResultMappings()){ for(SearchResultCellInfo cell: permutation.get(resultMapping.getSubSearchKey()).getCells()){ if(resultMapping.getSubSearchResultParam().equals(cell.getKey())){ SearchResultCellInfo mappedCell = new SearchResultCellInfo(); mappedCell.setKey(resultMapping.getResultParam()); mappedCell.setValue(cell.getValue()); resultRow.getCells().add(mappedCell); break;//FIXME breaks are bad... but there is no map in the cells } } } return resultRow; }
resultRow.setCells(new ArrayList<SearchResultCellInfo>()); SearchResultCellInfo cell = new SearchResultCellInfo(); cell.setKey(ENTITY_ID_RESULT); cell.setValue(person.getEntityId()); resultRow.getCells().add(cell); cell = new SearchResultCellInfo(); cell.setKey(PERSON_ID_RESULT); cell.setValue(person.getPrincipalId()); resultRow.getCells().add(cell); cell = new SearchResultCellInfo(); cell.setKey(PRINCIPAL_NAME_RESULT); cell.setValue(person.getPrincipalName()); resultRow.getCells().add(cell); cell = new SearchResultCellInfo(); cell.setKey(GIVEN_NAME_RESULT); cell.setValue(person.getName()); resultRow.getCells().add(cell); cell = new SearchResultCellInfo(); cell.setKey(DISPLAY_NAME_RESULT); cell.setValue(person.getName() + " (" + person.getPrincipalName() + ")");
SearchResultCellInfo orgIdsCell = new SearchResultCellInfo("lu.resultColumn.luOptionalOversightCommitteeIds", null); resultRow.getCells().add(orgIdsCell); SearchResultCellInfo orgNamesCell = new SearchResultCellInfo( "lu.resultColumn.luOptionalOversightCommitteeNames", null); resultRow.getCells().add(orgNamesCell);