Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: save data on server

  1. #1
    Join Date
    Sep 2017
    Posts
    3

    Default save data on server

    Hi, I'm using CDE Dashboard and I'd like to save data on server, when I click a button. How can I do it? With Ajax and Php?

    Davide

  2. #2
    Join Date
    Nov 2011
    Posts
    1,225

    Default

    The common way to do that is to setup a CDA kettle datasource. Then you build a kettle transformation that does whatever you like (saving data, call web services, whatever).

    In the dashboard use a query component that listens to the button. When the button is clicked the query is triggered, the transformation is run and your data is saved.
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  3. #3
    Join Date
    Sep 2017
    Posts
    3

    Default

    Thanks pamval, I try to do it!

    edit:
    I created the Ktr file with two parameters: dir and content. Dir is the server path where I want save the file. How should the path be set to save the file in a specific server directory, for example on pentaho_root/pentaho-cdf-dd/resources/file.txt?
    Last edited by Sondavide; 09-14-2017 at 02:15 PM.

  4. #4
    Join Date
    Nov 2011
    Posts
    1,225

    Default

    Depends on the step you're using, I guess. Absolute paths should work fine in any kettle step, though.
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  5. #5
    Join Date
    Sep 2017
    Posts
    3

    Default

    I used "get variable" step to get the parameters and "txt output" to create new file. But ktr file is on repository "public/mydashboard/resource", while I'd like to save the txt file on filesystem.

    Schermata 2017-09-15 14:36:46.png

    On CDE I created two parameters with the kettle parameters name. I uploaded the file on the server with "Browse file" and I created this kettle query:

    kettlequeries.jpg

    caricamentoktr.png

    Finally i created a standard query component:

    querystandard.png

    But the file is not created, i think there's an error with path in file system.

    if for example i set the path "system/file", file is saved on "Tomcat/bin/system/file.txt"
    if i set path "/pentaho/content/pentaho-cdf-dd/file", file is non saved
    Last edited by Sondavide; 09-15-2017 at 11:50 AM.

  6. #6
    Join Date
    Nov 2011
    Posts
    1,225

    Default

    /pentaho/content/pentaho-cdf-dd/file is an absolute path. Does the pentaho folder exist at the root of the file system and is the user running pentaho allowed to write there? don't you have errors in pentaho.log saying why the file was not saved?
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2017 Pentaho Corporation. All Rights Reserved.