Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Customize Carte Kettle Status page

  1. #1
    Join Date
    May 2013
    Posts
    28

    Default Customize Carte Kettle Status page

    I have a front-end website where the end user click a link (the start job link in Carte, like http://192.168.0.3:8081/kettle/start...1-5c560d45aa21) to launch a job that does an extraction from a db and save output on a file in a web server folder.

    Now, I would like to beautify the process.

    At the moment the kettle status page opens
    http://192.168.0.3:8081/kettle/status/ and there the user (refreshing the page) wait until the job ends.
    Then close the kettle status page (that I opened in another tab) and get the resulting file.

    Is there a way:

    1. not open the kettle status page (or close it immediately);
    2. retrieve information about the job execution (basically status_desc)

    or

    1. customize the status page making it integrated in the website template (I will put in this case a refresh every tot seconds to avoid the user refreshing manually)

    I searched web and forum and the only thing I was able to understand is to use xml http://wiki.pentaho.com/display/EAI/Carte+Web+Services
    but:

    - I don't know how to read it with PHP (I don't want you explain it to me, I will learn it by myself)
    - more important, I don't know how to close the page automatically.. I cannot find the html file!


  2. #2
    Join Date
    Dec 2009
    Posts
    609

    Default

    Hi,

    sending a simple GET request to such URL using jQuery for example also would trigger the Job I assume.
    So you could create such button in your web-page directly.
    By doing this, no window would open.
    And querying the status will be possible by using the "transStatus/?xml=y" operation.

    HTH,

    Tom

  3. #3
    Join Date
    May 2013
    Posts
    28

    Default

    You illuminated me!!

    As you described it should works..

    And I should be able to do it.. also if I must learn about xml with php (should be very simple)..

    I will try in the next days and I will let people know, maybe with the script I used!

    Thany you so much

  4. #4
    Join Date
    Dec 2009
    Posts
    609

    Default

    Hi again

    glad I could help.
    http://php.net/manual/de/simplexml.examples-basic.php seems to be rather easy.
    Otherwise I could recommend to dive into jQuery's powers to process XML.
    This will also be a definitive option

    Cheers,

    Tom

  5. #5
    Join Date
    Oct 2006
    Posts
    219

    Default

    Hey guys / gals. I was working on something that could be useful. A Carte Manager. I wrote a prototype in angular JS and Bootstrap. But there are a couple of issues

    1) Cross Site Scripting. Since carte runs on another port, AJAX requests with JS apps will most likely cause you to get Origin Policy warning in your browser. I looked into CORS and JSONP but didn't have much luck with this. Instead, i've just recently used and tested a JSP based proxy. You can read about it here. http://me-myself-and-it.blogspot.de/...g-come-on.html

    Another issue (not a big one) is that the carte web services return XML. In this case, i used an XML parser. xml2json. You don't have to do this.

    If you do decide to use the proxy, it will return text/plain. This means that the ajax request for XML won't be read properly. You can try changing the proxy to serve up text/xml but there is whitespace in the XML string returned. This causes the error on line 2 at column 6: XML declaration allowed only at the start of the document error. A way i got around this was to trim the XML returned from the proxy before processing it.

    Something like (this was written in angular JS)

    // ajax request that returns an XML string
    $http.get('http://localhost:8080/pentaho/proxy?url=http://localhost:8888/kettle/status/?xml=y',{
    }).success(function(data, status, headers, config){

    // trim function
    function trim1 (str) {
    return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
    }

    // parse the XML string to XML.. trim the XML also
    parser=new DOMParser();
    xmlDoc=parser.parseFromString(trim1(data),"text/xml");

    // convert the XML to JSON
    $scope.csData = $.xml2json(xmlDoc);

    My question to you is this... Im working on another version of this CARTE UI. Instead of a standalone version, it will be a Pentaho BI Server Plugin. Is this something that would be of interest to you guys?

    Harris
    www.ivy-is.co.uk - Ivy Information Systems

    Come join the non official Pentaho IRC chat room on irc.freenode.net in the ##pentaho channel

  6. #6
    Join Date
    Dec 2009
    Posts
    609

    Default

    Hi,

    have a look at the blog again... I added support for Content-Type, so now that one should not be a problem anymore.

    Cheers

  7. #7
    Join Date
    Dec 2013
    Posts
    1

    Default

    Hi darpao,
    Can you share you scripts for the carte?

    I have the same problem with automation of deploy process to the several PDI services.
    I have 2 production server 1 developer and 3 stages.

    The sum of our jobs running in this servers are ~ 80.

    It is difficult to manage this jobs. So I try searching some useful UI, but nothing find.
    So, I wonder about writing own management console for add/romuve/execute jobs/transformation for my needs.
    But If you scripts satisfy me I will use it.

    Mike.

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 - 2019 Hitachi Vantara Corporation. All Rights Reserved.