How upload file to Pentaho User Console server?

2.2k views Asked by At

I need :

  • 1) Let the user select a file from his local pc
  • 2) Upload that file to the pentaho server
  • 3) Process the file using a kettle transformation

I tried with a csv data source in Pentaho User Console (PUC) 5.0 but found no way to access it from a .ktr file uploaded to PUC repository. I also try to upload the csv file to a folder and still not able to access it from a .ktr file.

1

There are 1 answers

0
JRichardsz On

I think this requirement is valid :

Upload a csv data file and .ktr file to PUC folder. The .ktr should be able to read the uploaded csv file when it is executed from PUC

Imagine a simple user, with a csv. Will he be able to upload csv file to linux host using wincsp, filezilla or another ftp tool??

We need to give an easy upload functionality to our user, so after several researching hours (pentaho source code) without one line of Pentaho documentation, I found this test:

https://github.com/pentaho/pentaho-platform/blob/master/extensions/src/test/java/org/pentaho/platform/plugin/services/importer/PlatformImporterTest.java that showed me that a mimetype list should be exist somewhere.

So after search some words in all pentaho folder wiht grep command, I found this file:

/my_apps/pentaho-server-ce-7.1.0.0-12/pentaho-server/pentaho-solutions/system/ImportHandlerMimeTypeDefinitions.xml

With some intuition, I added this xml

<ImportHandler class="org.pentaho.platform.plugin.services.importer.RepositoryFileImportFileHandler">
  <MimeTypeDefinitions>
    <MimeTypeDefinition mimeType="text/plain" >
      <extension>csv</extension>
    </MimeTypeDefinition>
  </MimeTypeDefinitions>
</ImportHandler>

At the bottom of file:

<tns:ImportHandlerMimeTypeDefinitions xmlns:tns="http://www.pentaho.com/schema/" .....
   <ImportHandler ../>
   <ImportHandler ../>
   <!-- PUT CSV CONFIG HERE -->    
</tns:ImportHandlerMimeTypeDefinitions>

Finally, I restarted my pentaho-server-ce-7.1.0.0-12 server and I was able to upload my csv file with this steps :

enter image description here

Read this csv file from ktr is pending...

I hope this helps