SearchType searchType,
BindException errors,
String searchTerm) throws InstantiationException {
Collection<Matrix> matches = null;
MatrixService matrixService = getSearchService().getMatrixService();
switch(searchType) {
case byID:
matches = (Collection<Matrix>) doSearchByIDString(request, matrixService, Matrix.class, searchTerm);
break;
case byTB1ID:
matches = new HashSet<Matrix>();
matches.add(matrixService.findByTB1StudyID(searchTerm));
break;
case byTitle:
matches = matrixService
.findSomethingBySubstring(Matrix.class, "title", searchTerm);
break;
case byType:
matches = matrixService
.findSomethingByItsDescription(Matrix.class, "matrixKind", searchTerm, false);
break;
case byNCHAR:
try {
matches = matrixService
.findSomethingByRangeExpression(CharacterMatrix.class, "nChar", searchTerm);
} catch (MalformedRangeExpression e) {
addMessage(request, "Malformed range expression: " + e.getMessage());
}
break;
case byNTAX:
try {
matches = matrixService
.findSomethingByRangeExpression(CharacterMatrix.class, "nTax", searchTerm);
} catch (MalformedRangeExpression e) {
addMessage(request, "Malformed range expression: " + e.getMessage());
}
break;