Example #1
0
  public static boolean isPrevDisabled(String name) {
    String getStatus = "";
    PropertyDao propDao = (PropertyDao) SpringUtils.getBean("propertyDao");
    List<Property> pList = propDao.findByName("hide_prevention_stop_signs");

    Iterator<Property> i = pList.iterator();

    while (i.hasNext()) {
      Property item = i.next();
      getStatus = item.getValue();
    }

    Pattern pattern = Pattern.compile("(\\[)(.*?)(\\])");
    Matcher matcher = pattern.matcher(getStatus);
    List<String> listMatches = new ArrayList<String>();

    while (matcher.find()) {

      listMatches.add(matcher.group(2));
    }

    int x = 0;
    for (String s : listMatches) {

      if (name.equals(s)) {
        x++;
      }
    }

    if (x > 0) {
      return true;
    } else {
      return false;
    }
  }
Example #2
0
 public boolean isHidePrevItemExist() {
   List<Property> props = propertyDao.findByName(HIDE_PREVENTION_ITEM);
   if (props.size() > 0) {
     return true;
   }
   return false;
 }
Example #3
0
  public static boolean isCreated() {
    String getStatus = "";
    PropertyDao propDao = (PropertyDao) SpringUtils.getBean("propertyDao");
    List<Property> pList = propDao.findByName("hide_prevention_stop_signs");

    Iterator<Property> i = pList.iterator();

    while (i.hasNext()) {
      Property item = i.next();
      getStatus = item.getName();
    }

    if (getStatus.equals("hide_prevention_stop_signs")) {
      return true;
    } else {
      return false;
    }
  }
Example #4
0
  public static boolean isDisabled() {
    String getStatus = "";
    PropertyDao propDao = (PropertyDao) SpringUtils.getBean("propertyDao");
    List<Property> pList = propDao.findByName("hide_prevention_stop_signs");

    Iterator<Property> i = pList.iterator();

    while (i.hasNext()) {
      Property item = i.next();
      getStatus = item.getValue();
    }

    // disable all preventions warnings if result is master
    if (getStatus.equals("master")) {
      return true;
    } else {
      return false;
    }
  }