Created
March 25, 2015 16:55
-
-
Save vpasquier/cf75a816553b947599f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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