if (this.compareValues(value, layoutAttributeDescriptor.getDefaultValue())) {
//Value matches the default value, remove the attribute
return this.removeLayoutAttribute(request, prefScope, nodeId, name);
}
final IStylesheetUserPreferences distributedStylesheetUserPreferences = this.getDistributedStylesheetUserPreferences(request, prefScope);
if (distributedStylesheetUserPreferences != null) {
final String defaultValue = distributedStylesheetUserPreferences.getLayoutAttribute(nodeId, name);
if (this.compareValues(value, defaultValue)) {
//Value matches the DLM preferences value, remove the value
return this.removeLayoutAttribute(request, prefScope, nodeId, name);
}
}
final Scope scope = this.getWriteScope(request, prefScope, stylesheetPreferencesKey, layoutAttributeDescriptor);
switch (scope) {
case PERSISTENT: {
IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
if (stylesheetUserPreferences == null) {
stylesheetUserPreferences = this.stylesheetUserPreferencesDao.createStylesheetUserPreferences(stylesheetDescriptor, stylesheetPreferencesKey.person, stylesheetPreferencesKey.userProfile);
this.clearStylesheetUserPreferencesCache(request, stylesheetPreferencesKey);
}
final String oldValue = stylesheetUserPreferences.setLayoutAttribute(nodeId, name, value);
this.stylesheetUserPreferencesDao.storeStylesheetUserPreferences(stylesheetUserPreferences);
return oldValue;
}
default: {