Exemplo n.º 1
0
  /**
   * Saves entity field
   *
   * @return original TargetList record
   * @throws Exception
   */
  private TargetList saveEntity() throws Exception {
    TargetList originalTargetList = null;
    if (targetList.getId() == null) {
      UserUtil.permissionCheck("create_targetList");
    } else {
      UserUtil.permissionCheck("update_targetList");
      originalTargetList = baseService.getEntityById(TargetList.class, targetList.getId());
      targetList.setTargets(originalTargetList.getTargets());
      targetList.setContacts(originalTargetList.getContacts());
      targetList.setLeads(originalTargetList.getLeads());
      targetList.setUsers(originalTargetList.getUsers());
      targetList.setAccounts(originalTargetList.getAccounts());
    }

    User assignedTo = null;
    if (this.getAssignedToID() != null) {
      assignedTo = userService.getEntityById(User.class, this.getAssignedToID());
    }
    targetList.setAssigned_to(assignedTo);

    User owner = null;
    if (this.getOwnerID() != null) {
      owner = userService.getEntityById(User.class, this.getOwnerID());
    }
    targetList.setOwner(owner);

    super.updateBaseInfo(targetList);
    return originalTargetList;
  }
Exemplo n.º 2
0
 public String relateTargetListUser() throws Exception {
   targetList = baseService.getEntityById(TargetList.class, id);
   Set<User> users = targetList.getUsers();
   Iterator<User> userIterator = users.iterator();
   int totalRecords = users.size();
   ListUserAction.getListJson(userIterator, totalRecords, null, false);
   return null;
 }