class ArchetypePreferencesManager {

    public void enableArchetype(final String archetype,
                                final boolean isEnabled,
                                final boolean customIncluded) {
        archetypePreferences.load();
        if (enableArchetypePreference(archetype, isEnabled)) {
            archetypePreferences.save(getGlobalScope());
        }

        if (customIncluded) {
            getOuIdentifiers().forEach(identifier -> {
                final PreferenceScopeResolutionStrategyInfo info =
                        workbenchPreferenceScopeResolutionStrategies.getSpaceInfoFor(identifier);

                archetypePreferences.load(info);

                if (enableArchetypePreference(archetype,
                                              isEnabled)) {
                    archetypePreferences.save(info);
                }
            });
        }
    }

    public  ArchetypePreferencesManager();
    @Inject public  ArchetypePreferencesManager(final PreferenceScopeFactory scopeFactory,
                                       final WorkbenchPreferenceScopeResolutionStrategies workbenchPreferenceScopeResolutionStrategies,
                                       final ArchetypePreferences archetypePreferences,
                                       final OrganizationalUnitService ouService);

}