Question

I'm building a component for Talend Open Studio for network analysis and I plan to using gephy toolkit, but input data must come from a dataflow (to keep simple let's say a java collection) while gephy-toolkit let you import only from files (lot of different kinds, actually) or even rdbms, but not from java collections.

how can i build a new simple custom importer (if it can be build at first place. It seems possible, at least for GUI gephi cfr. http://wiki.gephi.org/index.php/HowTo_write_an_import)?

Was it helpful?

Solution

I found the solution by myself: I need to create a Spigot Importer.

  • the factory

    @ServiceProvider(service = ImporterBuilder.class)
    public final class TalendCollectionImporterBuilder implements ImporterBuilder {
    
    public String getName() {
           return "Talend Flow Connection Importer";
        }
    
        public SpigotImporter buildImporter() {
           return new TalendCollectionImporter();
        }
    
    }
    
  • the importer (stub)

    public class TalendCollectionImporter implements SpigotImporter {
    
            private ContainerLoader container;
            private Report report;
            private ProgressTicket progressTicket;
            private boolean cancel = false;
    
            public boolean execute(ContainerLoader loader) {
                this.container = loader;
                this.report = new Report();
    
                // import stuff
    
                return !cancel;
            }
    
            public ContainerLoader getContainer() {
                return container;
            }
    
            public Report getReport() {
                return report;
            }
    
            public boolean cancel() {
                cancel = true;
                return true;
            }
    
    }
    
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top