Package org.beangle.security.blueprint

Examples of org.beangle.security.blueprint.Menu


    put("profiles", entityDao.getAll(MenuProfile.class));
  }

  protected void editSetting(Entity<?> entity) {
    put("profiles", entityDao.getAll(MenuProfile.class));
    Menu menu = (Menu) entity;
    OqlBuilder<Resource> builder = OqlBuilder.from(Resource.class, "r");
    if (null != menu.getProfile() && null != menu.getProfile().getId()) {
      MenuProfile profile = entityDao.get(MenuProfile.class, menu.getProfile().getId());
      builder.where("exists(from r.categories as rc where rc=:category)",
          profile.getCategory());
    }
    List<Resource> resurces = entityDao.search(builder);
    Set<Resource> existResources = menu.getResources();
    if (null != resurces) {
      resurces.removeAll(existResources);
    }
    put("resources", resurces);
  }
View Full Code Here


    }
    put("resources", resurces);
  }

  protected String saveAndForward(Entity<?> entity) {
    Menu menu = (Menu) entity;
    try {
      List<Resource> resources = CollectUtils.newArrayList();
      String resourceIdSeq = get("resourceIds");
      if (null != resourceIdSeq && resourceIdSeq.length() > 0) {
        resources = entityDao.get(Resource.class,
            SeqStrUtils.transformToLong(resourceIdSeq));
      }
      menu.getResources().clear();
      menu.getResources().addAll(resources);
      entityDao.saveOrUpdate(menu);
    } catch (Exception e) {
      return forward(ERROR);
    }
    return redirect("search", "info.save.success");
View Full Code Here

  public String info() throws Exception {
    Long entityId = getEntityId(getShortName());
    if (null == entityId) {
      logger.warn("cannot get paremeter {}Id or {}.id", getShortName(), getShortName());
    }
    Menu menu = (Menu) getModel(getEntityName(), entityId);
    put(getShortName(), menu);
    if (!menu.getResources().isEmpty()) {
      OqlBuilder<Authority> groupQuery = OqlBuilder.from(Authority.class, "auth");
      groupQuery.where("auth.resource in(:resources)", menu.getResources()).select(
          "distinct auth.group");
      put("groups", entityDao.search(groupQuery));
    }
    return forward();
  }
View Full Code Here

TOP

Related Classes of org.beangle.security.blueprint.Menu

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.