Skip to content

Instantly share code, notes, and snippets.

@vpasquier
Created March 25, 2015 16:55
Show Gist options
  • Save vpasquier/cf75a816553b947599f4 to your computer and use it in GitHub Desktop.
Save vpasquier/cf75a816553b947599f4 to your computer and use it in GitHub Desktop.
if (namedParameters != null && !namedParameters.isEmpty()) {
// fall back on simple document if no type defined on page provider
if (searchDocumentModel == null) {
searchDocumentModel = new SimpleDocumentModel();
}
for (Map.Entry<String, String> entry : namedParameters.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
try {
DocumentHelper.setProperty(session, searchDocumentModel, key, value, true);
} catch (PropertyNotFoundException | IOException e) {
// assume this is a "pure" named parameter, not part of the search doc schema
continue;
}
}
searchDocumentModel.putContextData(PageProviderService.NAMED_PARAMETERS, namedParameters);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment