Package org.pentaho.platform.repository.usersettings.pojo

Examples of org.pentaho.platform.repository.usersettings.pojo.UserSetting


    Serializable tenantHomeId = repository.getFile( tentantHomePath ).getId();
    Map<String, Serializable> tenantMetadata = repository.getFileMetadata( tenantHomeId );

    for ( String key : tenantMetadata.keySet() ) {
      if ( key.startsWith( SETTING_PREFIX ) ) {
        UserSetting setting = new UserSetting();
        setting.setSettingName( key.substring( SETTING_PREFIX.length() ) );
        setting.setSettingValue( tenantMetadata.get( key ).toString() );
        userSettings.add( setting );
      }
    }

    String homePath = ClientRepositoryPaths.getUserHomeFolderPath( PentahoSessionHolder.getSession().getName() );
    Serializable userHomeId = repository.getFile( homePath ).getId();
    Map<String, Serializable> userMetadata = repository.getFileMetadata( userHomeId );

    for ( String key : userMetadata.keySet() ) {
      if ( key.startsWith( SETTING_PREFIX ) ) {
        UserSetting setting = new UserSetting();
        setting.setSettingName( key.substring( SETTING_PREFIX.length() ) );
        setting.setSettingValue( userMetadata.get( key ).toString() );
        // see if a global setting exists which will be overridden
        if ( userSettings.contains( setting ) ) {
          userSettings.remove( setting );
        }
        userSettings.add( setting );
View Full Code Here


        Serializable userHomeId = repository.getFile( homePath ).getId();
        Map<String, Serializable> userMetadata = repository.getFileMetadata( userHomeId );

        for ( String key : userMetadata.keySet() ) {
          if ( key.startsWith( SETTING_PREFIX ) ) {
            UserSetting setting = new UserSetting();
            setting.setSettingName( key.substring( SETTING_PREFIX.length() ) );
            setting.setSettingValue( userMetadata.get( key ).toString() );
            if ( setting.getSettingName().equals( settingName ) ) {
              return setting;
            }
          }
        }

        String tentantHomePath = ClientRepositoryPaths.getEtcFolderPath();
        Serializable tenantHomeId = repository.getFile( tentantHomePath ).getId();
        Map<String, Serializable> tenantMetadata = repository.getFileMetadata( tenantHomeId );

        for ( String key : tenantMetadata.keySet() ) {
          if ( key.startsWith( SETTING_PREFIX ) ) {
            UserSetting setting = new UserSetting();
            setting.setSettingName( key.substring( SETTING_PREFIX.length() ) );
            setting.setSettingValue( tenantMetadata.get( key ).toString() );
            if ( setting.getSettingName().equals( settingName ) ) {
              return setting;
            }
          }
        }
      } catch ( Throwable ignored ) {
        // if anything goes wrong with authentication (anonymous user) or permissions
        // just return the default value, if we continue to log these errors (like on before Login)
        // we'll see *many* errors in the logs which are not helpful
      }
    }
    UserSetting defaultSetting = new UserSetting();
    defaultSetting.setSettingName( settingName );
    defaultSetting.setSettingValue( defaultValue );
    return defaultSetting;
  }
View Full Code Here

    String tentantHomePath = ClientRepositoryPaths.getEtcFolderPath();
    Serializable tenantHomeId = repository.getFile( tentantHomePath ).getId();
    Map<String, Serializable> tenantMetadata = repository.getFileMetadata( tenantHomeId );

    if ( tenantMetadata.containsKey( SETTING_PREFIX + settingName ) ) {
      UserSetting setting = new UserSetting();
      setting.setSettingName( settingName );
      setting.setSettingValue( tenantMetadata.get( SETTING_PREFIX + settingName ).toString() );
      return setting;
    }

    UserSetting defaultSetting = new UserSetting();
    defaultSetting.setSettingName( settingName );
    defaultSetting.setSettingValue( defaultValue );
    return defaultSetting;
  }
View Full Code Here

    Serializable tenantHomeId = repository.getFile( tentantHomePath ).getId();
    Map<String, Serializable> tenantMetadata = repository.getFileMetadata( tenantHomeId );

    for ( String key : tenantMetadata.keySet() ) {
      if ( key.startsWith( SETTING_PREFIX ) ) {
        UserSetting setting = new UserSetting();
        setting.setSettingName( key.substring( SETTING_PREFIX.length() ) );
        setting.setSettingValue( tenantMetadata.get( key ).toString() );
        userSettings.add( setting );
      }
    }
    return userSettings;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.repository.usersettings.pojo.UserSetting

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.