@Test public void testGetAllEnabledAppsShouldCorrectlyHandleNegatedFeatureToggles() throws Exception { app1.setFeatureToggle("!app1Toggle"); app2.setFeatureToggle("!app2Toggle"); List<AppDescriptor> allApps = service.getAllEnabledApps(); assertEquals(1, allApps.size()); assertEquals("app2", allApps.get(0).getId()); }
@Override public List<AppDescriptor> getAllEnabledApps() { List<AppDescriptor> appDescriptors = getAllApps(); List<AppDescriptor> disabledAppDescriptors = new ArrayList<AppDescriptor>(); for (AppDescriptor appDescriptor : appDescriptors) { if (disabledByComponentState(appDescriptor) || disabledByFeatureToggle(appDescriptor) || disabledByAppFrameworkConfig(appDescriptor)) { disabledAppDescriptors.add(appDescriptor); } } appDescriptors.removeAll(disabledAppDescriptors); return appDescriptors; }
AppFrameworkServiceImpl extends BaseOpenmrsService implements AppFrameworkService { @Override public List<AppDescriptor> getAllEnabledApps() { List<AppDescriptor> appDescriptors = getAllApps(); List<AppDescriptor> disabledAppDescriptors = new ArrayList<AppDescriptor>(); for (AppDescriptor appDescriptor : appDescriptors) { if (disabledByComponentState(appDescriptor) || disabledByFeatureToggle(appDescriptor) || disabledByAppFrameworkConfig(appDescriptor)) { disabledAppDescriptors.add(appDescriptor); } } appDescriptors.removeAll(disabledAppDescriptors); return appDescriptors; } }
AppFrameworkServiceImpl extends BaseOpenmrsService implements AppFrameworkService { @Override public List<AppDescriptor> getAllEnabledApps() { List<AppDescriptor> appDescriptors = getAllApps(); List<AppDescriptor> disabledAppDescriptors = new ArrayList<AppDescriptor>(); for (AppDescriptor appDescriptor : appDescriptors) { if (disabledByComponentState(appDescriptor) || disabledByFeatureToggle(appDescriptor) || disabledByAppFrameworkConfig(appDescriptor)) { disabledAppDescriptors.add(appDescriptor); } } appDescriptors.removeAll(disabledAppDescriptors); return appDescriptors; } AppFrameworkServiceImpl(AllAppTemplates allAppTemplates, AllAppDescriptors allAppDescriptors,
	    AllFreeStandingExtensions allFreeStandingExtensions, AllComponentsState allComponentsState,
	    LocationService locationService, FeatureToggleProperties featureToggles, AppFrameworkConfig appFrameworkConfig,
	    AllUserApps allUserApps); }
AppFrameworkServiceImpl extends BaseOpenmrsService implements AppFrameworkService { @Override public List<AppDescriptor> getAllEnabledApps() { List<AppDescriptor> appDescriptors = getAllApps(); List<AppDescriptor> disabledAppDescriptors = new ArrayList<AppDescriptor>(); for (AppDescriptor appDescriptor : appDescriptors) { if (disabledByComponentState(appDescriptor) || disabledByFeatureToggle(appDescriptor) || disabledByAppFrameworkConfig(appDescriptor)) { disabledAppDescriptors.add(appDescriptor); } } appDescriptors.removeAll(disabledAppDescriptors); return appDescriptors; } AppFrameworkServiceImpl(AllAppTemplates allAppTemplates, AllAppDescriptors allAppDescriptors,
	    AllFreeStandingExtensions allFreeStandingExtensions, AllComponentsState allComponentsState,
	    LocationService locationService, FeatureToggleProperties featureToggles, AppFrameworkConfig appFrameworkConfig,
	    AllUserApps allUserApps); @Override List<AppDescriptor> getAllApps(); @Override List<Extension> getExtensionsById(String extensionPointId, String id); @Override // TODO shouldn't this be getAllFreeStandingExtensions? List<Extension> getAllExtensions(String extensionPointId); @Override List<AppDescriptor> getAllEnabledApps(); @Override List<Extension> getAllEnabledExtensions(); @Override List<Extension> getAllEnabledExtensions(String extensionPointId); @Override void enableApp(String appId); @Override void disableApp(String appId); @Override void enableExtension(String extensionId); @Override void disableExtension(String extensionId); @Override List<Extension> getExtensionsForCurrentUser(); @Override List<Extension> getExtensionsForCurrentUser(String extensionPointId); @Override List<Extension> getExtensionsForCurrentUser(String extensionPointId, AppContextModel contextModel); @Override boolean checkRequireExpression(Requireable candidate, AppContextModel contextModel); @Override List<AppDescriptor> getAppsForCurrentUser(); @Override @Transactional(readOnly = true) List<Location> getLoginLocations(); @Override List<AppTemplate> getAllAppTemplates(); @Override AppTemplate getAppTemplate(String id); @Override AppDescriptor getApp(String id); @Override UserApp getUserApp(String appId); @Override List<UserApp> getUserApps(); @Override UserApp saveUserApp(UserApp userApp); @Override void purgeUserApp(UserApp userApp); }
AppFrameworkServiceImpl extends BaseOpenmrsService implements AppFrameworkService { @Override public List<AppDescriptor> getAllEnabledApps() { List<AppDescriptor> appDescriptors = getAllApps(); List<AppDescriptor> disabledAppDescriptors = new ArrayList<AppDescriptor>(); for (AppDescriptor appDescriptor : appDescriptors) { if (disabledByComponentState(appDescriptor) || disabledByFeatureToggle(appDescriptor) || disabledByAppFrameworkConfig(appDescriptor)) { disabledAppDescriptors.add(appDescriptor); } } appDescriptors.removeAll(disabledAppDescriptors); return appDescriptors; } AppFrameworkServiceImpl(AllAppTemplates allAppTemplates, AllAppDescriptors allAppDescriptors,
	    AllFreeStandingExtensions allFreeStandingExtensions, AllComponentsState allComponentsState,
	    LocationService locationService, FeatureToggleProperties featureToggles, AppFrameworkConfig appFrameworkConfig,
	    AllUserApps allUserApps); @Override List<AppDescriptor> getAllApps(); @Override List<Extension> getExtensionsById(String extensionPointId, String id); @Override // TODO shouldn't this be getAllFreeStandingExtensions? List<Extension> getAllExtensions(String extensionPointId); @Override List<AppDescriptor> getAllEnabledApps(); @Override List<Extension> getAllEnabledExtensions(); @Override List<Extension> getAllEnabledExtensions(String extensionPointId); @Override void enableApp(String appId); @Override void disableApp(String appId); @Override void enableExtension(String extensionId); @Override void disableExtension(String extensionId); @Override List<Extension> getExtensionsForCurrentUser(); @Override List<Extension> getExtensionsForCurrentUser(String extensionPointId); @Override List<Extension> getExtensionsForCurrentUser(String extensionPointId, AppContextModel contextModel); @Override boolean checkRequireExpression(Requireable candidate, AppContextModel contextModel); @Override List<AppDescriptor> getAppsForCurrentUser(); @Override @Transactional(readOnly = true) List<Location> getLoginLocations(); @Override List<AppTemplate> getAllAppTemplates(); @Override AppTemplate getAppTemplate(String id); @Override AppDescriptor getApp(String id); @Override UserApp getUserApp(String appId); @Override List<UserApp> getUserApps(); @Override UserApp saveUserApp(UserApp userApp); @Override void purgeUserApp(UserApp userApp);  }