Created
January 8, 2013 03:35
-
-
Save anonymous/4480958 to your computer and use it in GitHub Desktop.
Customer IUserSettingsService adding in the MANTLE_SHOW_NAVIGATOR=true if the setting is not present. This in effect defaults the browser to open until set by the user through UI action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.pentaho.experimental; | |
import org.pentaho.platform.api.engine.IPentahoSession; | |
import org.pentaho.platform.api.usersettings.IUserSettingService; | |
import org.pentaho.platform.api.usersettings.pojo.IUserSetting; | |
import org.pentaho.platform.repository.usersettings.pojo.UserSetting; | |
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* User: nbaker | |
* Date: 1/7/13 | |
*/ | |
public class BrowserOpenDefaultingUserSettingsService implements IUserSettingService { | |
private IUserSettingService delegate; | |
public BrowserOpenDefaultingUserSettingsService(IUserSettingService delegate){ | |
this.delegate = delegate; | |
} | |
public void deleteUserSettings() { | |
this.delegate.deleteUserSettings(); | |
} | |
public List<IUserSetting> getUserSettings() { | |
List<IUserSetting> settings = this.delegate.getUserSettings(); | |
for(IUserSetting set : settings){ | |
if(set.getSettingName().equals("MANTLE_SHOW_NAVIGATOR")){ | |
return settings; | |
} | |
} | |
List<IUserSetting> combinedSettings = new ArrayList<IUserSetting>(); | |
combinedSettings.addAll(settings); | |
combinedSettings.add(new UserSetting(999999, 999999, "", "MANTLE_SHOW_NAVIGATOR", "true")); | |
return combinedSettings; | |
} | |
public IUserSetting getUserSetting(String s, String s1) { | |
return this.delegate.getUserSetting(s, s1); | |
} | |
public void setUserSetting(String s, String s1) { | |
this.delegate.setUserSetting(s, s1); | |
} | |
public List<IUserSetting> getGlobalUserSettings() { | |
return this.delegate.getGlobalUserSettings(); | |
} | |
public IUserSetting getGlobalUserSetting(String s, String s1) { | |
return this.delegate.getGlobalUserSetting(s, s1); | |
} | |
public void setGlobalUserSetting(String s, String s1) { | |
this.delegate.setGlobalUserSetting(s, s1); | |
} | |
public void init(IPentahoSession iPentahoSession) { | |
this.delegate.init(iPentahoSession); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment