コード例 #1
0
ファイル: LightManager.java プロジェクト: BerengereG/contrib
  public Boolean dataSourceExport(DataSourceUI dataSourceUI) throws ServerSideException {
    try {
      RepoxManagerDefault repoxManagerDefault =
          (RepoxManagerDefault) ConfigSingleton.getRepoxContextUtil().getRepoxManager();
      DataSourceContainer dataSourceContainer =
          repoxManagerDefault
              .getDataManager()
              .getDataSourceContainer(dataSourceUI.getDataSourceSet());

      DataSource dataSource = dataSourceContainer.getDataSource();
      dataSource.setExportDir(dataSourceUI.getExportDirectory());

      String recordsPerFile;
      if (dataSourceUI.getRecordsPerFile().equals("All")) recordsPerFile = "-1";
      else recordsPerFile = dataSourceUI.getRecordsPerFile();

      ConfigSingleton.getRepoxContextUtil()
          .getRepoxManager()
          .getDataManager()
          .startExportDataSource(
              dataSourceUI.getDataSourceSet(), recordsPerFile, dataSourceUI.getExportFormat());
    } catch (Exception e) {
      throw new ServerSideException(Util.stackTraceToString(e));
    }
    return true;
  }
コード例 #2
0
ファイル: LightManager.java プロジェクト: BerengereG/contrib
  public String addAllOAIURL(
      String url,
      String dataProviderID,
      String dsSchema,
      String dsNamespace,
      String dsMTDFormat,
      String name,
      String nameCode,
      String exportPath,
      DataSetOperationsServiceImpl dataSetOperationsService)
      throws ServerSideException {
    try {
      // Check http URLs
      String checkUrlResult = DataSetOperationsServiceImpl.checkURL(url);
      if (checkUrlResult.equals("URL_MALFORMED")) return "URL_MALFORMED";
      else if (checkUrlResult.equals("URL_NOT_EXISTS")) return "URL_NOT_EXISTS";

      LightSaveData.addAllOAIURL(
          url.trim(),
          dataProviderID,
          dsSchema,
          dsNamespace,
          dsMTDFormat,
          dataSetOperationsService.checkOAIURL(url.trim()));
    } catch (Exception e) {
      e.printStackTrace();
      throw new ServerSideException(Util.stackTraceToString(e));
    }
    return "SUCCESS";
  }
コード例 #3
0
ファイル: LightManager.java プロジェクト: BerengereG/contrib
 public String deleteDataSources(List<DataSourceUI> dataSourceUIs) throws ServerSideException {
   try {
     return LightSaveData.deleteDataSources(dataSourceUIs);
   } catch (Exception e) {
     e.printStackTrace();
     throw new ServerSideException(Util.stackTraceToString(e));
   }
 }
コード例 #4
0
ファイル: LightManager.java プロジェクト: BerengereG/contrib
 public SaveDataResponse saveDataProvider(
     boolean update, DataProviderUI dataProviderUI, int pageSize) throws ServerSideException {
   try {
     return LightSaveData.saveDataProvider(update, dataProviderUI, pageSize);
   } catch (Exception e) {
     e.printStackTrace();
     throw new ServerSideException(Util.stackTraceToString(e));
   }
 }
コード例 #5
0
ファイル: LightManager.java プロジェクト: BerengereG/contrib
 public SaveDataResponse saveDataSource(
     boolean update, String type, String originalDSset, DataSourceUI dataSourceUI, int pageSize)
     throws ServerSideException {
   try {
     return LightSaveData.saveDataSource(update, type, originalDSset, dataSourceUI, pageSize);
   } catch (Exception e) {
     e.printStackTrace();
     throw new ServerSideException(Util.stackTraceToString(e));
   }
 }
コード例 #6
0
  protected static ResponseState validateTransformation(
      String id, String xslFilePath, String oldTransId) throws ServerSideException {
    try {

      ConfigSingleton.getRepoxContextUtil()
          .getRepoxManager()
          .getMetadataTransformationManager()
          .checkTransformationValidity(id, xslFilePath + XSL_END, oldTransId);

      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));
    }
  }
コード例 #7
0
  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));
    }
  }