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

edu.internet2.middleware.grouper.grouperUi.beans.ui.ExternalSystemContainer Maven / Gradle / Ivy

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

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

import edu.internet2.middleware.grouper.app.externalSystem.GrouperExternalSystem;
import edu.internet2.middleware.grouper.privs.PrivilegeHelper;
import edu.internet2.middleware.grouper.ui.GrouperUiFilter;
import edu.internet2.middleware.subject.Subject;

/**
 * 
 */
public class ExternalSystemContainer {
  
  /**
   * grouper external system user is currently viewing/editing/adding
   */
  private GuiGrouperExternalSystem guiGrouperExternalSystem;
  
  /**
   * all external systems
   */
  private List guiGrouperExternalSystems = new ArrayList();
  
  
  /**
   * html for external system
   */
  private String html;
  
  
  public List getGuiGrouperExternalSystems() {
    return guiGrouperExternalSystems;
  }

  
  public void setGuiGrouperExternalSystems(
      List guiGrouperExternalSystems) {
    this.guiGrouperExternalSystems = guiGrouperExternalSystems;
  }
  
  
  public GuiGrouperExternalSystem getGuiGrouperExternalSystem() {
    return guiGrouperExternalSystem;
  }


  
  public void setGuiGrouperExternalSystem(
      GuiGrouperExternalSystem guiGrouperExternalSystem) {
    this.guiGrouperExternalSystem = guiGrouperExternalSystem;
  }
  
  
  public String getHtml() {
    return html;
  }
  
  public void setHtml(String html) {
    this.html = html;
  }


  /**
   * @return true if can view external systems
   */
  public boolean isCanViewExternalSystems() {
    
    Subject loggedInSubject = GrouperUiFilter.retrieveSubjectLoggedIn();
    if (PrivilegeHelper.isWheelOrRoot(loggedInSubject)) {
      return true;
    }
    return false;
  }
  
  public List getAllExternalSystems() {
    return GrouperExternalSystem.retrieveAllGrouperExternalSystems();
  }

  public List getAllExternalSystemTypes() {
    return GrouperExternalSystem.retrieveAllModuleConfigurationTypes();
  }

  public List getAllExternalSystemTypesAdd() {
    List retrieveAllModuleConfigurationTypes = new ArrayList(GrouperExternalSystem.retrieveAllModuleConfigurationTypes());
    Iterator iterator = retrieveAllModuleConfigurationTypes.iterator();
    while (iterator.hasNext()) {
      GrouperExternalSystem grouperExternalSystem = iterator.next();
      if (!grouperExternalSystem.isCanAdd()) {
        iterator.remove();
      }
    }
    return retrieveAllModuleConfigurationTypes;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy