Esempio n. 1
0
  @Transient
  public String getValueTextRoles() {

    List<PickerItem> result = ValueTextBuilder.buildFromEntities(roles);
    String jsonResult = null;

    try {
      jsonResult = objectStringConverterImpl.convertToString(List.class, result);
    } catch (Exception e) {
      loggerImpl.logError(e, "security.error.convert.role.to.json");
    }

    return jsonResult;
  }
Esempio n. 2
0
  public void setValueTextRoles(String valueTextRoles) {

    try {
      List<PickerItem> listOfPickerItem =
          objectStringConverterImpl.convertToListOfObjects(
              new TypeReference<List<PickerItem>>() {}, valueTextRoles);
      roles.clear();

      for (PickerItem pickerItem : listOfPickerItem) {
        roles.add(roleRepoImpl.find(Long.valueOf(pickerItem.getPickerCode().toString())));
      }
    } catch (Exception e) {
      loggerImpl.logError(e, "security.error.convert.json.to.role");
    }
  }