if ((request.getParameterValues("blurbMe") != null)
&& (request.getSession().getAttribute("user") != null)) {
String[] newFieldsToBlurbFrom = request
.getParameterValues("blurbMe");
ContentType contentType = ContentType.valueOf(Integer
.parseInt(request.getParameter("ctype")));
try {
int projectId = (new ProjectManager()).getProjectID(command
.getProject());
for (int m = 0; m < newFieldsToBlurbFrom.length; m++) {
// strip out the starting "s:" from the advanced search
// pages
newFieldsToBlurbFrom[m] = newFieldsToBlurbFrom[m]
.substring(2);
// then fill in the rest of the info that the page expects
newFieldsToBlurbFrom[m] = newFieldsToBlurbFrom[m]
+ " ("
+ (new MetadataManager())
.getDisplayNameByElementAndQualifier(
projectId, contentType.getValue(),
newFieldsToBlurbFrom[m]) + ")";
}
} catch (NoSuchProjectException e) {
Logger.warn("Couldn't get project ID for handle '"
+ command.getProject() + "'");
}
(new UserManager()).setUserPreference((User) request.getSession()
.getAttribute("user"), command.getProject() + "-"
+ contentType.toString().toLowerCase() + "BlurbFields",
StringUtils.join(newFieldsToBlurbFrom, "|"));
}
}