@Override
public <P extends Populator<String, String>> P populateOutputProperties(HttpServletRequest request,
PreferencesScope prefScope, P properties) {
final StylesheetPreferencesKey stylesheetPreferencesKey = this.getStylesheetPreferencesKey(request, prefScope);
final IStylesheetDescriptor stylesheetDescriptor = stylesheetPreferencesKey.stylesheetDescriptor;
//Get the scoped sources once
final IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
final Map<String, String> sessionOutputProperties;
final HttpSession session = request.getSession(false);
if (session == null) {
sessionOutputProperties = null;
}
else {
sessionOutputProperties = PortalWebUtils.getMapSessionAttribute(session, OUTPUT_PROPERTIES_KEY + stylesheetPreferencesKey.toString(), false);
}
final Map<String, String> requestOutputProperties = PortalWebUtils.getMapRequestAttribute(request, OUTPUT_PROPERTIES_KEY + stylesheetPreferencesKey.toString(), false);
//Try getting each output property to populate the Properties
for (final IOutputPropertyDescriptor outputPropertyDescriptor : stylesheetDescriptor.getOutputPropertyDescriptors()) {
final String name = outputPropertyDescriptor.getName();
final String value;
final Scope scope = outputPropertyDescriptor.getScope();
switch (scope) {