All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.internet2.middleware.grouper.grouperUi.beans.config.GuiConfigFile Maven / Gradle / Ivy

There is a newer version: 5.13.5
Show newest version
package edu.internet2.middleware.grouper.grouperUi.beans.config;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import edu.internet2.middleware.grouper.cfg.GrouperConfig;
import edu.internet2.middleware.grouper.cfg.dbConfig.ConfigFileName;
import edu.internet2.middleware.grouper.util.GrouperUtil;
import edu.internet2.middleware.grouperClient.config.ConfigPropertiesCascadeBase;

/**
 * gui config file bean
 * @author mchyzer
 *
 */
public class GuiConfigFile {

  private ConfigPropertiesCascadeBase configPropertiesCascadeBase;
  
  public ConfigPropertiesCascadeBase getConfigPropertiesCascadeBase() {
    return configPropertiesCascadeBase;
  }
  
  public void setConfigPropertiesCascadeBase(
      ConfigPropertiesCascadeBase configPropertiesCascadeBase) {
    this.configPropertiesCascadeBase = configPropertiesCascadeBase;
  }

  /**
   * find gui property 
   * @return gui config property
   */
  public GuiConfigProperty findGuiConfigProperty(String propertyName, boolean exceptionIfNotFound) {
    for (GuiConfigSection guiConfigSection : GrouperUtil.nonNull(this.guiConfigSections)) {
      for (GuiConfigProperty guiConfigProperty : GrouperUtil.nonNull(guiConfigSection.getGuiConfigProperties())) {
        if (StringUtils.equals(GrouperUtil.stripSuffix(guiConfigProperty.getConfigItemMetadata().getKeyOrSampleKey(), ".elConfig"), 
            GrouperUtil.stripSuffix(propertyName, ".elConfig"))  ) {
          return guiConfigProperty;
        }
      }
    }
    if (exceptionIfNotFound) {
      throw new RuntimeException("Cant find property: '" + propertyName + "'");
    }
    return null;
  }
  
  /**
   * 
   */
  public GuiConfigFile() {
    
  }

  /**
   * config file name
   */
  private ConfigFileName configFileName;

  /**
   * config file name
   * @return the config file name
   */
  public ConfigFileName getConfigFileName() {
    return configFileName;
  }

  /**
   * config file name
   * @param configFileName1
   */
  public void setConfigFileName(ConfigFileName configFileName1) {
    this.configFileName = configFileName1;
  }

  /**
   * gui config sections
   */
  private List guiConfigSections = new ArrayList();

  /**
   * 
   * @return gui config sections
   */
  public List getGuiConfigSections() {
    return this.guiConfigSections;
  }

  /**
   * gui cofnig sections
   * @param guiConfigSections1
   */
  public void setGuiConfigSections(List guiConfigSections1) {
    this.guiConfigSections = guiConfigSections1;
  }
  
  
  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy