Package org.beangle.security.blueprint.restrict

Examples of org.beangle.security.blueprint.restrict.RestrictField


  }

  private List<Object> getMyRestrictionValues(List<Restriction> restrictions, String name) {
    List<Object> values = CollectUtils.newArrayList();
    for (Restriction restriction : restrictions) {
      RestrictField param = restriction.getPattern().getObject().getField(name);
      if (null != param) {
        String value = restriction.getItem(param);
        if (null != value) {
          values.addAll(restrictionService.select(restrictionService.getValues(param),
              restriction, param));
View Full Code Here


  protected List<Object> getRestricitonValues(String name) {
    List<Restriction> restrictions = getRestrictions();
    Set<Object> values = CollectUtils.newHashSet();
    boolean gotIt = false;
    for (Restriction restiction : restrictions) {
      RestrictField param = restiction.getPattern().getObject().getField(name);
      if (null != param) {
        String value = restiction.getItem(param);
        if (null != value) {
          gotIt = true;
          values.addAll(restrictionService.select(restrictionService.getValues(param),
              restiction, param));
        }
      }
    }
    if (!gotIt) {
      List<RestrictField> params = entityDao.get(RestrictField.class, "name", name);
      if (params.isEmpty()) { throw new RuntimeException("bad pattern parameter named :"
          + name); }
      RestrictField param = (RestrictField) params.get(0);
      return restrictionService.getValues(param);
    } else {
      return CollectUtils.newArrayList(values);
    }
  }
View Full Code Here

    }
    return redirect("index", "info.remove.success");
  }

  public String editField() {
    RestrictField field = getEntity(RestrictField.class, "field");
    List<RestrictObject> objects = entityDao.getAll(RestrictObject.class);
    objects.removeAll(field.getObjects());
    put("objects", objects);
    put("field", field);
    return forward("fieldForm");
  }
View Full Code Here

    List<RestrictObject> paramGroups = CollectUtils.newArrayList();
    if (StringUtils.isNotBlank(objectIds)) {
      paramGroups = entityDao.get(RestrictObject.class,
          SeqStrUtils.transformToLong(objectIds));
    }
    RestrictField field = populateEntity(RestrictField.class, "field");
    field.getObjects().clear();
    field.getObjects().addAll(paramGroups);
    saveOrUpdate(field);
    return redirect("fields", "info.save.success");
  }
View Full Code Here

  protected Object clone() throws CloneNotSupportedException {
    return super.clone();
  }

  public String getItem(String paramName) {
    RestrictField param = getPattern().getObject().getField(paramName);
    if (null == param) {
      return null;
    } else {
      return getItem(param);
    }
View Full Code Here

      for (int i = 0; i < contents.length; i++) {
        String content = contents[i];
        Condition c = new Condition(content);
        List<String> params = c.getParamNames();
        for (final String paramName : params) {
          RestrictField param = pattern.getObject().getField(paramName);
          String value = restriction.getItem(param);
          if (StringUtils.isNotEmpty(value)) {
            if (value.equals(Restriction.ALL)) {
              content = "";
            } else {
              content = StringUtils.replace(content, ":" + param.getName(), ":"
                  + param.getName() + index);
              paramValues.add(getValue(restriction,param));
            }
          } else {
            throw new RuntimeException(paramName + " had not been initialized");
          }
View Full Code Here

TOP

Related Classes of org.beangle.security.blueprint.restrict.RestrictField

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.