public class NewsletterUserPreferenceProvider extends AbstractLogEnabled implements UserPreferenceProvider, Serviceable
| Modifier and Type | Field and Description | 
|---|---|
protected CategoryProviderExtensionPoint | 
_categoryEP
The category provider extension point. 
 | 
protected static I18nizableText | 
_NEWSLETTER_PREF_GROUP
The newsletter pref group. 
 | 
protected static String | 
_NEWSLETTER_PREF_STORAGE_COMPONENT
The newsletter preferences storage component role. 
 | 
CONTEXT_VAR_WORKSPACE| Constructor and Description | 
|---|
NewsletterUserPreferenceProvider()  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
fillUserPreferences(Set<UserPreference> prefs,
                   List<Category> categories,
                   CategoryProvider categoryProvider,
                   org.apache.commons.lang.mutable.MutableInt index)
Create a  
UserPreference per newsletter category, recursively. | 
protected UserPreference | 
getCategoryUserPref(Category category,
                   int index)
Get a boolean  
UserPreference representing a category. | 
Collection<UserPreference> | 
getPreferences(Map<String,String> contextVars)
Get this provider's preferences. 
 | 
void | 
service(ServiceManager serviceManager)  | 
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerprotected static final I18nizableText _NEWSLETTER_PREF_GROUP
protected static final String _NEWSLETTER_PREF_STORAGE_COMPONENT
protected CategoryProviderExtensionPoint _categoryEP
public NewsletterUserPreferenceProvider()
public void service(ServiceManager serviceManager) throws ServiceException
service in interface ServiceableServiceExceptionpublic Collection<UserPreference> getPreferences(Map<String,String> contextVars)
UserPreferenceProvidergetPreferences in interface UserPreferenceProvidercontextVars - a Map of context variables.protected void fillUserPreferences(Set<UserPreference> prefs, List<Category> categories, CategoryProvider categoryProvider, org.apache.commons.lang.mutable.MutableInt index)
UserPreference per newsletter category, recursively.prefs - the user preferences Set to fill.categories - the categories to work on.categoryProvider - the category provider.index - the current user preference index, to increase while processing categories.protected UserPreference getCategoryUserPref(Category category, int index)
UserPreference representing a category.category - the category.index - the category index in the extension point.UserPreference representing the category.