/**
   * Generates an XACML Policy Set.
   *
   * @throws IOException
   */
  public void generateXACMLPolicySet() throws IOException {
    log.info("Generating XACML Policy Set.");

    if (this.selectedPolicySet != null) {
      successfulGeneration =
          polUtil.generateXACMLPolicySet(this.selectedPolicySet.getPkPolicySet());
      FacesContext context = FacesContext.getCurrentInstance();
      if (successfulGeneration) {
        log.info(this.selectedPolicySet.getPolicySetId() + " successfully generated!");
        context.addMessage(
            null,
            new FacesMessage(
                this.selectedPolicySet.getPolicySetId() + " successfully generated!", ""));
      } else {
        log.info("Error occured while generating " + this.selectedPolicySet.getPolicySetId());
        context.addMessage(
            null,
            new FacesMessage(
                "Error occured while generating " + this.selectedPolicySet.getPolicySetId(), ""));
      }
    } else {
      log.info("No Policy Set Selected. Please select a policy set to generate XACML.");

      RequestContext.getCurrentInstance()
          .showMessageInDialog(
              new FacesMessage(
                  "No Policy Set Selected", "Please select a policy set to generate XACML."));
    }
  }
  /**
   * Generates all XACML Policy Set.
   *
   * @throws IOException
   */
  public void generateAllXACMLPolicySets() throws IOException {
    log.info("Generating All XACML Policy Sets.");

    FacesContext context = FacesContext.getCurrentInstance();

    successfulGeneration = polUtil.generateAllXACMLPolicySets(getPolicySetList());

    if (successfulGeneration) {
      log.info("All Policy Sets successfully generated!");
      context.addMessage(null, new FacesMessage("All Policy Sets successfully generated!", ""));
    } else {
      log.info("Error occured while generating all policy sets!");
      context.addMessage(
          null, new FacesMessage("Error occured while generating all policy sets!", ""));
    }
  }