Skip to content

Commit

Permalink
SAK-42147 Keep default properties inline with docs. (sakaiproject#7125)
Browse files Browse the repository at this point in the history
* SAK-42147 Keep default properties inline with docs.

SiteStats isn’t using the documented default values for display.users.present and presence.events.log, this change has Sitestats match the documentation and the values in the portal.

* SAK-42147 Update the default values in the test.
  • Loading branch information
buckett authored and ern committed Aug 2, 2019
1 parent 45e6926 commit b6fa6f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,20 @@ public void init(){

public void checkAndSetDefaultPropertiesIfNotSet() {
if(enableSiteVisits == null) {
enableSiteVisits = serverConfigurationService.getBoolean("display.users.present", false) || serverConfigurationService.getBoolean("presence.events.log", false);
enableSiteVisits = serverConfigurationService.getBoolean("display.users.present", true) || serverConfigurationService.getBoolean("presence.events.log", true);
}
if(visitsInfoAvailable == null) {
visitsInfoAvailable = enableSiteVisits;
}
if(enableSitePresences == null) {
// turn off, by default
enableSitePresences = false;// serverConfigurationService.getBoolean("display.users.present", false) || serverConfigurationService.getBoolean("presence.events.log", false);
enableSitePresences = false;// serverConfigurationService.getBoolean("display.users.present", true) || serverConfigurationService.getBoolean("presence.events.log", true);
}else if(enableSitePresences.booleanValue()){
// if turned on, make sure "display.users.present" is true
// this feature doesn't work properly with "presence.events.log"
if(serverConfigurationService.getBoolean("display.users.present", false)) {
enableSitePresences = serverConfigurationService.getBoolean("display.users.present", false);
}else if(serverConfigurationService.getBoolean("presence.events.log", false)) {
if(serverConfigurationService.getBoolean("display.users.present", true)) {
enableSitePresences = serverConfigurationService.getBoolean("display.users.present", true);
}else if(serverConfigurationService.getBoolean("presence.events.log", true)) {
enableSitePresences = false;
log.warn("Disabled SiteStats presence tracking: doesn't work properly with 'presence.events.log' => only plays nicely with 'display.users.present'");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ public void testEnableVisibleSiteVisits() throws Exception {
smi.setVisitsInfoAvailable(null);
smi.setEnableSitePresences(null);
smi.checkAndSetDefaultPropertiesIfNotSet();
Assert.assertEquals(false, M_sm.getEnableSiteVisits());
Assert.assertEquals(false, M_sm.getVisitsInfoAvailable());
Assert.assertEquals(true, M_sm.getEnableSiteVisits());
Assert.assertEquals(true, M_sm.getVisitsInfoAvailable());
Assert.assertEquals(false, M_sm.getEnableSitePresences()); // off, by default

// revert
Expand Down

0 comments on commit b6fa6f3

Please sign in to comment.