Exemplo n.º 1
0
  @SuppressWarnings("unchecked")
  private void setSelectedCustomFieldsFromFile() {
    if (fileUploadField.getFileUpload() != null) {
      ArkFunction arkFunction =
          iArkCommonService.getArkFunctionByName(
              au.org.theark.core.Constants.FUNCTION_KEY_VALUE_PHENO_COLLECTION);
      Long studyId =
          (Long)
              SecurityUtils.getSubject()
                  .getSession()
                  .getAttribute(au.org.theark.core.Constants.STUDY_CONTEXT_ID);
      Study study = iArkCommonService.getStudy(studyId);
      ArrayList<CustomField> selectedCustomFields =
          (ArrayList<CustomField>)
              iArkCommonService.matchCustomFieldsFromInputFile(
                  fileUploadField.getFileUpload(), study, arkFunction);
      cpModel.getObject().setSelectedCustomFields(selectedCustomFields);
    }

    initCustomFieldPalette();
    arkCrudContainerVO.getDetailPanelFormContainer().addOrReplace(customFieldPalette);
  }