Package org.cishell.framework.data

Examples of org.cishell.framework.data.Data


    return writer.toString();

  }

  private Data[] getFilePathData(Data[] fileData) {
    Data Data = (Data) fileData[0];
    String format = Data.getFormat();
    File actualFile = (File) Data.getData();
    try {
      String filePath = actualFile.getCanonicalPath();
      Data result = new BasicData(filePath, format);
      return new Data[] { result };
    } catch (IOException e) {
      this.logger.log(LogService.LOG_ERROR, "Could not get file path " +
          "from file " + actualFile, e);
      return null;
View Full Code Here


  private void setMetadata(Data[] data, Converter converter) {
    if ((data == null) || (data.length < 1)) {
      return;
    }
   
    Data datum = data[0];
    Dictionary<String, Object> metadata = datum.getMetadata();

    if (metadata.get(DataProperty.LABEL) == null) {
      metadata.put(DataProperty.LABEL, "result of " + converter.getShortName());
    } else {
      alterMetadata(data);
View Full Code Here


  private class SaveListener implements Listener {
    public void handleEvent(Event event) {
      if (AbstractDataManagerView.this.saveFactory != null) {
        Data data[] = AbstractDataManagerView.this.manager.getSelectedData();
        Algorithm algorithm = AbstractDataManagerView.this.saveFactory.createAlgorithm(
          data, new Hashtable<String, Object>(), Activator.getCIShellContext());

        try {
          algorithm.execute();
View Full Code Here

      return fileName;
    }
 
 
  private void alterMetadata(Data[] originalFileData) {
    Data data = originalFileData[0];
    Dictionary<String, Object> metadata = data.getMetadata();
    String label = (String) metadata.get(DataProperty.LABEL);

    if (label != null) {
      metadata.put(DataProperty.LABEL, getFileName(label));
    } else {
View Full Code Here

  }

  private class ViewListener implements Listener {
    public void handleEvent(Event event) {
      if (AbstractDataManagerView.this.viewFactory != null) {
        Data data[] = AbstractDataManagerView.this.manager.getSelectedData();
        Algorithm algorithm = AbstractDataManagerView.this.viewFactory.createAlgorithm(
          data, new Hashtable<String, Object>(), Activator.getCIShellContext());

        try {
          algorithm.execute();
View Full Code Here

      while ((i < items.length) && (result == null)) {
        DataGUIItem data = ((DataGUIItem) items[i].getData());

        // TODO: Not sure why this happens...
        if (data != null) {
          Data item = data.getModel();

          if (item == model)
            result = items[i];
          else {
            // check the children recursively
View Full Code Here

                FileWriter fw = new FileWriter(file);
               
                fw.write(i.toString());
                fw.close();
               
                Data dm = new BasicData(file, "file:text/plain");
                dm.getMetadata().put(DataProperty.LABEL, "File of "+label);
               
                return new Data[]{dm};
            } catch (IOException e) {
                throw new AlgorithmExecutionException(e);
            }
View Full Code Here

        DataConversionService converter = getConverter();
        String id = "-1";
       
        DataModelRegistry dmRegistry = (DataModelRegistry) dmReg.getService();
       
        Data dm = dmRegistry.getDataModel(dataModelID);
        if (dm != null) {
            try {
        dm = converter.convert(dm, outFormat);
      } catch (ConversionException e) {
        dm = null;
View Full Code Here

    /**
     * @see org.cishell.remoting.service.conversion.RemoteDataConversionService#getConversions(java.lang.String, java.lang.String)
     */
    public Vector getConversions(String dataModelID, String outFormat) {
        DataModelRegistry dmRegistry = (DataModelRegistry) dmReg.getService();
        Data dm = dmRegistry.getDataModel(dataModelID);
       
        Set conversions = new HashSet();
        if (dm != null) {
            Converter[] converters = getConverter().findConverters(dm, outFormat);
           
View Full Code Here

       
        if (properties == null) {
            properties = new Hashtable();
        }
       
        Data dm = new BasicData(properties, dataFile, format);
       
        return registerDataModel(dm);
    }
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.