Package org.cishell.framework.data

Examples of org.cishell.framework.data.Data


            this.ciContext = ciContext;
        }
       
        public Data[] execute() throws AlgorithmExecutionException {
            try {
                Data data = new BasicData(getDataset(),format);
                data.getMetadata().put(DataProperty.LABEL, label);
           
                return new Data[]{data};
            } catch (IOException e) {
                throw new AlgorithmExecutionException(e);
            }
View Full Code Here


          Arrays.asList(selectedData));
      this.inputData = new Data[inData.length];
      this.converters = new Converter[inData.length][];
      for (int ii = 0; ii < inData.length; ii++) {
        for (int jj = 0; jj < dataSet.size(); jj++) {
          Data datum = (Data) dataSet.get(jj);
          if (datum != null) {
            if (isAssignableFrom(inData[ii], datum)) {
              dataSet.remove(jj);
              this.inputData[ii] = datum;
              this.converters[ii] = null;
View Full Code Here

     * .properties file.
     */
    protected List addMetaData(List data, Data[] inputData, Dictionary properties) {
      List results = new ArrayList();
      for (int ii = 0; ii < data.size(); ii++) {
        Data result = ((Data) data.get(ii));
        Dictionary metadataHolder = result.getMetadata();
       
        String dataLabel = getResultLabel(properties, ii);
        metadataHolder.put(DataProperty.LABEL, dataLabel);
       
        String dataType = getResultType(properties, ii);
        metadataHolder.put(DataProperty.TYPE, dataType);
       
        Data dataParent = getResultParent(properties, ii, inputData);
        if (dataParent != null) {
        metadataHolder.put(DataProperty.PARENT, dataParent);
        } //it's okay to not have a parent, little Timmy.
       
        results.add(result);
View Full Code Here

    protected Data getResultParent(Dictionary props, int numResult, Data[] inputData) {
    String childKey = JythonFileProperty.RESULT_PREFIX + numResult
    + JythonFileProperty.PARENT_SUFFIX;
    Object parentName = props.get(childKey);
   
    Data parent;
    if (! (parentName == null)) {
      //TODO: more validation on parentName
      char parentDataIndexChar = getLastChar((String) parentName);
      int parentDataIndex = Character.digit(parentDataIndexChar, 10);
      if (parentDataIndex < inputData.length) {
View Full Code Here

            
             //return readme report
            
             ReadMeReport readmeReport = readmeGen.getReadMe();
             File readmeFile = readmeReport.getReportFile();
             Data readMeData = createReportData(readmeFile,
                 readmeReport.getName(), null);
             addReturn(readMeData);
            
             //return all converters report
            
             AllConvsReport allConvReport =
               allConvGen.getAllConvsReport();
             File allConvReportFile = allConvReport.getReport();
             Data allConvReportData =
               createReportData(allConvReportFile,
                   allConvReport.getName(),
                 null);
             addReturn(allConvReportData);
            
             ConvReport[] convReports =
               allConvReport.getConverterReports();
             for (int ii = 0; ii < convReports.length; ii++) {
               ConvReport convReport = convReports[ii];
               File convReportFile = convReport.getReport();
               Data convReportData =
                 createReportData(convReportFile,
                     convReport.getName(), allConvReportData);
               addReturn(convReportData);
              
               TestReport[] trs = convReport.getTestReports();
               addFilePasses(trs, convReportData);
             }
            
             //return all tests report
            
             AllTestsReport allReport = allGen.getAllTestsReport();
             File allReportFile = allReport.getAllTestsReport();
             Data allReportData = createReportData(allReportFile,
                 allReport.getName() , null);
             addReturn(allReportData);
            
             TestReport[] sTestReports =
               allReport.getSuccessfulTestReports();
             addFilePasses(sTestReports, allReportData);
            
             TestReport[] ppTestReports =
               allReport.getPartialSuccessTestReports();
             addFilePasses(ppTestReports, allReportData);
            
             TestReport[] fTestReports =
               allReport.getFailedTestReports();
             addFilePasses(fTestReports, allReportData);
            
             //return all errors report
            
             AllErrorReport allErrorReport =
               allErrGen.getAllErrorsReport();
             File allErrReportFile = allErrorReport.getReportFile();
             Data allErrReport = createReportData(allErrReportFile,
                 allErrorReport.getName(), null);
             addReturn(allErrReport);
            
            
             //return annotated graph report
            
             File graphReportFile = graphGen.getGraphReport();
             Data graphReport = createReportData(graphReportFile,
                 "Annotated Converter Graph", null,
                 "file:text/nwb", DataProperty.NETWORK_TYPE);
             addReturn(graphReport);
            
             //return original graph report
            
             File origGraphReportFile = origGraphGen.getGraphReport();
             Data origGraphReport = createReportData(
                 origGraphReportFile,
                 "Original Converter Graph", null,
                 "file:text/nwb", DataProperty.NETWORK_TYPE);
             addReturn(origGraphReport);
            
View Full Code Here

    }
   
    protected PythonInterpreter passCIShellProvidedArguments(
        PythonInterpreter interp, Data[] data) {
      for (int ii = 0; ii < data.length; ii++) {
      Data argData = data[ii];
      Object arg = argData.getData();
      String argName = JythonFileProperty.ARGUMENT_PREFIX + ii;
     
      interp = passArgument(arg, argName, interp);
     
 
View Full Code Here

         */
        private void addFilePasses(TestReport[] testReports, Data parent) {
          for (int ii = 0; ii < testReports.length; ii++) {
            TestReport tr = testReports[ii];
            File testReportFile = tr.getTestReport();
            Data testReportData = createReportData(testReportFile,
                tr.getName(), parent);
            addReturn(testReportData);
           
            FilePassReport[] sFilePassReports =
              tr.getSuccessfulFilePassReports();
            for (int kk = 0; kk < sFilePassReports.length; kk++) {
              FilePassReport fp = sFilePassReports[kk];
              File fpFile = fp.getFilePassReport();
              Data fpData = createReportData(fpFile, fp.getName(),
                  testReportData);
              addReturn(fpData);
              addAllConvertedDataReports(fp, fpData);
              }
           
            FilePassReport[] fFilePassReports =
              tr.getFailedFilePassReports()
            for (int kk = 0; kk < fFilePassReports.length; kk++) {
              FilePassReport fp = fFilePassReports[kk];
              File fpFile = fp.getFilePassReport();
              Data fpData = createReportData(fpFile, fp.getName(),
                  testReportData);
              addReturn(fpData);
              addAllConvertedDataReports(fp, fpData);
              }
          }
View Full Code Here

       
        private void addConvertedDataReports(ConvertedDataReport[] cdrs, Data fpData) {
        if (cdrs != null) {
          for (int mm = 0; mm < cdrs.length; mm++) {
            File cdrFile = cdrs[mm].getReport();
            Data cdrData = createReportData(cdrFile, cdrs[mm].getName(), fpData);
            addReturn(cdrData);
          }
        }
      }
View Full Code Here

       
      private void addAllConvertedDataReports(FilePassReport fp, Data fpData) {
        try {
        ConvertedDataReport[] testCDRs = fp.getTestConvertedDataReports();
      File testDummyParentFile = File.createTempFile("testdummyfile", "");
      Data testDummyParentData = createReportData(testDummyParentFile, "test phase", fpData);
      addReturn(testDummyParentData);
      addConvertedDataReports(testCDRs, testDummyParentData);
      ConvertedDataReport[] origCompareCDRs = fp.getOrigCompareConvertedDataReports();
      File origCompareDummyParentFile = File.createTempFile("origcomparedummyfile", "");
      Data origCompareDummyParentData = createReportData(origCompareDummyParentFile, "compare phase for original file", fpData);
      addReturn(origCompareDummyParentData);
      addConvertedDataReports(origCompareCDRs, origCompareDummyParentData);
      ConvertedDataReport[] resultCompareCDRs = fp.getResultCompareConvertedDataReports();
      File resultCompareDummyParentFile = File.createTempFile("origresultdummyfile", "");
      Data resultCompareDummyParentData = createReportData(resultCompareDummyParentFile, "compare phase for resulting file", fpData);
      addReturn(resultCompareDummyParentData);
      addConvertedDataReports(resultCompareCDRs, resultCompareDummyParentData);
        } catch (IOException e) {
          this.log.log(LogService.LOG_WARNING, "Unable to write converted data reports due to IO Error");
        }
View Full Code Here

         * @param type whether the report is a network or text file
         * @return the report encapsulated in data, ready to be returned.
         */
        private Data createReportData(Object report, String label,
            Data parent, String format, String type) {
          Data reportData = new BasicData(report, format);
      Dictionary metadata = reportData.getMetadata();
      if (label == null) {
        label = "no label";
      }
     
      if (type == null) {
View Full Code Here

TOP

Related Classes of org.cishell.framework.data.Data

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.