Exemplo n.º 1
0
  /**
   * ロールをデータベースから読み出します。 <br>
   *
   * @param rundata
   * @param context
   * @param msgList
   * @return TRUE 成功 FALSE 失敗
   */
  @Override
  protected boolean loadFormData(RunData rundata, Context context, List<String> msgList) {
    try {
      // オブジェクトモデルを取得
      EipTAclRole aclrole = AccessControlUtils.getEipTAclRole(rundata, context);
      if (aclrole == null) {
        return false;
      }

      // ロール名
      acl_role_name.setValue(aclrole.getRoleName());

      List<EipTAclUserRoleMap> aclUserRoleMaps =
          AccessControlUtils.getEipTAclUserRoleMaps(aclrole.getRoleId().intValue());
      if (aclUserRoleMaps != null && aclUserRoleMaps.size() > 0) {
        EipTAclUserRoleMap rolemap = null;
        TurbineUser tuser = null;
        int size = aclUserRoleMaps.size();
        for (int i = 0; i < size; i++) {
          rolemap = aclUserRoleMaps.get(i);
          tuser = rolemap.getTurbineUser();
          ALEipUser user = new ALEipUser();
          user.initField();
          user.setUserId(tuser.getUserId().intValue());
          user.setName(tuser.getLoginName());
          user.setAliasName(tuser.getFirstName(), tuser.getLastName());
          // 招待中ユーザでなければ追加
          if (!JetspeedResources.CONFIRM_VALUE_PENDING.equals(tuser.getConfirmValue())) {
            memberList.add(user);
          }
        }
      }

      EipTAclPortletFeature feature = aclrole.getEipTAclPortletFeature();
      feature_id.setValue(feature.getFeatureId().intValue());
      defineAclType = feature.getAclType().intValue();

      // メモ
      note.setValue(aclrole.getNote());

      // アクセス権限
      int tmpAclType = aclrole.getAclType();
      AccessControlUtils.setupAcl(ALAccessControlConstants.VALUE_ACL_LIST, tmpAclType, acllist);
      AccessControlUtils.setupAcl(ALAccessControlConstants.VALUE_ACL_DETAIL, tmpAclType, acldetail);
      AccessControlUtils.setupAcl(ALAccessControlConstants.VALUE_ACL_INSERT, tmpAclType, aclinsert);
      AccessControlUtils.setupAcl(ALAccessControlConstants.VALUE_ACL_UPDATE, tmpAclType, aclupdate);
      AccessControlUtils.setupAcl(ALAccessControlConstants.VALUE_ACL_DELETE, tmpAclType, acldelete);
      AccessControlUtils.setupAcl(ALAccessControlConstants.VALUE_ACL_EXPORT, tmpAclType, aclexport);

    } catch (Exception ex) {
      logger.error("AccessControlFormData.loadFormData", ex);
      return false;
    }
    return true;
  }
Exemplo n.º 2
0
  /**
   * TurbineUserクラスをもとに作った社内アドレスのResultDataを返します。
   *
   * @param record
   * @param strLength 表示文字数
   * @return
   */
  public static AddressBookResultData getCorpResultData(TurbineUser record, int strLength) {
    AddressBookResultData rd = new AddressBookResultData();

    rd.initField();
    rd.setAddressId(record.getUserId().intValue());
    rd.setName(
        ALCommonUtils.compressString(
            new StringBuffer()
                .append(record.getLastName())
                .append(" ")
                .append(record.getFirstName())
                .toString(),
            strLength));
    if (record.getCompanyId().intValue() > 0) {
      rd.setCompanyName(
          ALCommonUtils.compressString(
              ALEipUtils.getCompanyName(record.getCompanyId().intValue()), strLength));
    }

    rd.setPostList(
        compressString(AddressBookUtils.getPostBeanList(record.getUserId().intValue()), strLength));

    if (record.getPositionId().intValue() > 0) {
      rd.setPositionName(
          ALCommonUtils.compressString(
              ALEipUtils.getPositionName(record.getPositionId()), strLength));
    }
    rd.setEmail(ALCommonUtils.compressString(record.getEmail(), strLength));
    rd.setTelephone(record.getOutTelephone());
    rd.setCellularPhone(record.getCellularPhone());
    rd.setCellularMail(record.getCellularMail());
    rd.setInTelephone(record.getInTelephone());

    return rd;
  }
Exemplo n.º 3
0
  /**
   * @param obj
   * @return
   */
  @Override
  protected Object getResultData(TurbineUser record) {
    try {

      AccountResultData rd = new AccountResultData();
      rd.initField();
      rd.setUserId(record.getUserId().intValue());
      rd.setUserName(record.getLoginName());
      rd.setName(
          new StringBuffer()
              .append(record.getLastName())
              .append(" ")
              .append(record.getFirstName())
              .toString());
      rd.setPostNameList(ALEipUtils.getPostNameList(record.getUserId()));
      rd.setPositionName(ALEipUtils.getPositionName(record.getPositionId().intValue()));
      rd.setDisabled(record.getDisabled());
      rd.setHasPhoto("T".equals(record.getHasPhoto()) || "N".equals(record.getHasPhoto()));
      rd.setPhotoModified(record.getPhotoModified().getTime());
      rd.setEmail(record.getEmail());

      return rd;
    } catch (Exception ex) {
      logger.error("AccountUserSelectData.getResultData", ex);
      return null;
    }
  }