Dino
Dino

Reputation: 821

How upload file to Pentaho User Console server?

I need :

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.

Upvotes: 0

Views: 2450

Answers (1)

JRichardsz
JRichardsz

Reputation: 16564

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

Upvotes: 2

Related Questions