protected static ResponseState saveTransformationMDR(
      TransformationUI transformationUI, String oldTransId) throws ServerSideException {
    try {
      String xslFilePath =
          FilenameUtils.removeExtension(transformationUI.getXslFilePath().toLowerCase()) + XSL_END;
      // System.out.println("SERVER - XSL path: " + xslFilePath);

      MetadataTransformation mtdTransformation =
          new MetadataTransformation(
              transformationUI.getIdentifier(),
              transformationUI.getDescription(),
              transformationUI.getSrcFormat(),
              transformationUI.getDestFormat(),
              xslFilePath,
              transformationUI.isEditable(),
              transformationUI.getIsXslVersion2(),
              transformationUI.getDestSchema(),
              transformationUI.getDestMetadataNamespace());
      mtdTransformation.setSourceSchema(transformationUI.getSourceSchema());
      mtdTransformation.setMDRCompliant(transformationUI.isMDRCompliant());

      ConfigSingleton.getRepoxContextUtil()
          .getRepoxManager()
          .getMetadataTransformationManager()
          .saveMetadataTransformation(mtdTransformation, oldTransId);
      // System.out.println("SERVER - Transformation saved on the MDR");
      return ResponseState.SUCCESS;
    } catch (SameStylesheetTransformationException e) {
      return ResponseState.MAPPING_SAME_XSL;
    } catch (AlreadyExistsException e) {
      return ResponseState.ALREADY_EXISTS;
    } catch (Exception e) {
      e.printStackTrace();
      throw new ServerSideException(Util.stackTraceToString(e));
    }
  }