Hitachi Vantara Pentaho Community Forums
Results 1 to 28 of 28

Thread: CDF portal integration

  1. #1
    Join Date
    Feb 2007
    Posts
    230

    Default CDF portal integration

    Hi,

    Can anyone give me some hints on using CDF in the portal based Pentaho application?

    I have informations that this can be well integrated but I don't know where to start.

    thanks very much

    regards, dejan

  2. #2
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    As I told before, I never tried, but in theory should be very similar, since each portlet works, in it's content, like an isolated page.

    Did you try it?
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3
    Join Date
    Feb 2007
    Posts
    230

    Default

    Thanks Pedro, sorry for bothering you again, it was not my intention :-)

    No, I didn't try since I am not experienced enough to know how to "put" it in the portlet and which portlet to use. This is the only reason. It seems I'll have to learn more on portlets...

    regards, dejan

  4. #4
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    well, on that case I can't help because I need to learn more on portlets too
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  5. #5

    Default

    I'd recommend you to look for an iframe portlet which makes it possible to include safely a standalone non-portlet page such as the dashboard.jsp, you should be able to find such a portlet for JBoss and it surely exists for Liferay.

    I must disagree with Pedro that "each portlet works, in it's content, like an isolated page.". Portlets can only create html fragments that can be placed somewhere inside <body>... </body>. I suppose that the dashboard.jsp also contains <head> and perhaps includes some css and js files in the head. (In a portlet you can handcode JavaScript that adds those css and js links to the portal page's <head>, that's the only way how you can influence the head - though the new JSR286 provides some better support for this.)
    ----------------
    Jakub Holý, BI & IT Specialist
    IBA CZ, s.r.o., Czech Republic

  6. #6
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Quote Originally Posted by malyvelky View Post
    I must disagree with Pedro that "each portlet works, in it's content, like an isolated page.". Portlets can only create html fragments that can be placed somewhere inside <body>... </body>.

    You're not disagreeing with me because I have no clue of what I'm talking about

    On a more serious note, that can be done by editing template-dashboards.html. Just delete the outmost tags.

    On some future version I plan to add support for various content wrappers, eg: template-mantle.html, template-portlet.html, template-iphone.html.... but for now there's only one
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  7. #7
    Join Date
    Feb 2007
    Posts
    230

    Default

    Thanks for the info.

    I am currently using PortletBridge Portlet to display some static html pages on my portal. I don't remember any more why we decided to use PortletBridge instead of Iframe but there was a reason I know :-)

    So, maybe I could try CDF with PortletBridge if possible

    regards, dejan

  8. #8
    Join Date
    Feb 2007
    Posts
    230

    Default

    Hi,

    I have tried using PortletBridge first but with no success. Probably some more "serious" things have to be done because the links are not correct etc.

    Then I tried with IFramePorlet and it was successful but I have one pretty important problem:

    IFrame has a fixed height (that you can set manually) so it is not "dynamic". This was the main reason of not using it. I don't know if there is any chance to make it extend its height as the content extends. This would be great!

    regards, dejan

  9. #9
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Try this:
    http://hem.fyristorg.com/g-force/test/resize_iframe.htm

    Or make sure your dashboard doesn't expand more than the available space you have
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  10. #10
    Join Date
    Feb 2007
    Posts
    230

    Default

    Thank Pedro,

    I have tried this as an example (without portlet) and maybe it could work in IE but not in Firefox unfortunately.

    The script is not run at all on Firefox (I don't know why, maybe some stupid mistake of mine :-)

    I have also tried the solution from

    http://www.codeproject.com/KB/script...me_Height.aspx

    but I get “Permission denied to get property HTMLDocument.body” error in Java console :-(

    regards, dejan

  11. #11
    Join Date
    Feb 2007
    Posts
    230

    Default

    Hi,

    I have made something successful I think. I have used the code from codeproject, modified IFramePortlet and now CDF examples work correctly.

    Well, "Pentaho sample" link returns errors in IE, but not only in portal environment. "Pentaho Home Dashboard" and "Sample (bc)" work fine. Is it some known problem?

    regards, dejan

  12. #12
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    You are on unknown ground, mate. Maybe if you can show the error we can help.

    Btw, great to know it's working! It would be great if in the end you could make some kind of "tutorial" post explaining your experiences, and I can even make some changes to CDF if it will make portlet integration easier
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  13. #13
    Join Date
    Feb 2007
    Posts
    230

    Default

    The error is shown if you click on the bottom of the page, on a yellow triangle with the exclamation mark and "Error on page" text.

    I can see two errors, something like:

    Line: 247
    Char: 2
    Error: 'components' is undefined
    Code: 0
    URL: http://localhost:8080/Dashboards?das...pentaho_sample

    and (previous)

    Line: 207
    Char: 1
    Error: Expected identifier, string or number
    Code: 0
    URL: http://localhost:8080/Dashboards?das...pentaho_sample

    And of course, the text "Select a region" and the whole pie chart is not shown!

    Regarding the IFrame, I will post something like a "tutorial", no problems, you'll tell me where and how. Only I suggest to do it when everything will work OK (including IE)

    regards, dejan

  14. #14
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    There was a problem in a sample - an extra ',' in the components definition, probably it's something as simple as that. I expect you to find the same problem when accessing the dashboards in "standalone" mode
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  15. #15
    Join Date
    Feb 2007
    Posts
    230

    Default

    OK I removed the extra "," and now it works fine.

    Regarding the tutorial, I can explain everything I have done pretty easily.
    Currently I am a bit disappointed about the performance. It seems like this solution is slightly slower than the "original" (non-portal based). But maybe I am just exaggerating :-)

    Anyway, where should I post this solution? Here on forum or somewhere else?

    regards, dejan

  16. #16
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    I guess on the forum is ok, I can merge it in the main CDF page after that.

    When you talk about performance, do you mean portlet vs non-portlet or cdf vs other things inside the portlet?
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  17. #17
    Join Date
    Feb 2007
    Posts
    230

    Default

    It just seems like CDF samples are loading slower in IFramePortlet than in classic way. I suppose this is normal but there shouldn't be a notable difference...

    Anyway, I would have to prove this, maybe by doing some "time" logging or something, I don't know. For now, let it be...

    I will write a post on this forum at the beginning of next week

    regards, dejan

  18. #18
    Join Date
    Feb 2007
    Posts
    230

    Default CDF Portal integration using IFramePortlet - HowTo

    Here are the steps I have done in order to support CDF in portal environment using IFramePorlet (IFrame Portlet allows for a user-defined IFrame URL).

    1. I started with downloading IFramePortlet from here:

    http://anonsvn.jboss.org/repos/portl...amePortlet.zip

    2. After unpacking, I have done some modifications to IFramePortlet

    a) iframe.jsp -

    - added javascripts for dynamic adjustment of the frame height. The scripts and the HowTo is located here:

    http://www.codeproject.com/KB/script...me_Height.aspx

    The part of code added is:

    <script type="text/javascript">

    function getElement(aID)
    {
    return (document.getElementById) ?
    document.getElementById(aID) : document.all[aID];
    }

    function getIFrameDocument(aID){
    var rv = null;
    var frame=getElement(aID);
    // if contentDocument exists, W3C compliant (e.g. Mozilla)

    if (frame.contentDocument)
    rv = frame.contentDocument;
    else // bad IE

    rv = document.frames[aID].document;
    return rv;
    }

    function adjustMyFrameHeight()
    {
    var frame = getElement("myFrame");
    var frameDoc = getIFrameDocument("myFrame");
    frame.height = frameDoc.body.offsetHeight;
    }
    </script>


    - I have modified the "<iframe>" part by adding id and onloada function. Like this:

    <iframe id="myFrame" src="<%= request.getAttribute("iframeurl") %>" width="<%= request.getAttribute("iframewidth") %>" onload="adjustMyFrameHeight()" frameborder="0">
    Your browser does not support iframes
    </iframe>

    - I have also removed the part that enables opening the iframe in a new window, I don't need it

    b) iFramePortlet.java

    - I have modified the defaultURL and set:

    private static final String defaultURL = "http://localhost:8080/pentaho/Dashboards"; (you can replace localhost with another URL if needed)

    - I have also done some modifications to enable setting height in percentage, but it is not needed for this solution to work

    c) portlet.xml - I have modified this file to disable Porlet EDIT mode because I don't need it to be editable. I have just removed the line:

    <portlet-mode>EDIT</portlet-mode>

    I think that's all. I built IFramePorlet.war using "ant deploy24" and put it in jboss/server/default/deploy folder.

    After starting the server, there is IFramePortletInstance, IFrame page and IFramePortletWindow added.

    If I missed something, please feel free to ask :-)

    regards, dejan

  19. #19
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Thanks a lot, Dejan.

    I added a wiki page with your tutorial at http://wiki.pentaho.com/display/COM/CDF+Portlets

    Please tell me if I made some mistake copying it


    Pedro
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  20. #20
    Join Date
    Feb 2007
    Posts
    230

    Default

    It is ok as I can see

    Can you please tell me if I can use the newest CDF (Trunk or 2.1-RC1) with Pentaho 1.7? I would like to try the new possibilities but stay in 1.7 :-)

    regards, dejan

  21. #21
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    2.1-RC1 is the same as 2.0.1 but for latest pentaho version.

    The trunk version works only for 1.7, but itś undocumented, use it at your own risk
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  22. #22
    Join Date
    Feb 2007
    Posts
    230

    Default

    I am interested in testing the version where no xsl-s are needed, with navigator, contentList, components, etc. So all according to Trunk version demonstration :-)

    If this works with 1.7 then great, I can test it...

    Another thing - I saw you made some changes to JFreeChart engine...do you maybe know if I can use a newer JFreeChart version in Pentaho 1.7? I am interested in some features not supported by version 1.0.4 that is integrated in 1.7 (for example TickMarkUnits, major and minor tick marks, etc.)

    regards, dejan

  23. #23
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Ok, then if that's what you want, trunk is what you need No docs are available but I'll help in anyway I can.

    For jfreechart, yes, you can just replace the new jar;

    However, you may need to change the sources to access the new features - that's what I've done for the transparency
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  24. #24
    Join Date
    Feb 2007
    Posts
    230

    Default

    I have finally found some free time to continue with this and successfully built pentaho-1.7 PCI from source using CBF.

    Now, how to do the same with cdf? I am using JBoss and as I can see, all your changes in trunk are in patches/target-preconfiguredinstall-tomcat right? Are you using the same build.xml used by pentaho cbf?

    Currently I have something like this:

    -root
    --pentaho (pentaho source)
    --pentaho-preconfiguredinstall
    --pentaho-solutions
    --project-myproject
    --target-preconfiguredinstall (this is the PCI I am using)
    --target-build (made by cbf)
    --target-solutions (not used)
    --cdf-trunk
    ----config
    ----patches
    ------project-cdf
    ------target-build
    ------target-preconfiguredinstall
    ------target-preconfiguredinstall-tomcat
    ----solution

    How to deploy cdf into my (bolded) target-preconfiguredinstall? Do I have to set server.name to tomcat or jboss?

    thanks very much

    dejan

  25. #25
    Join Date
    Feb 2007
    Posts
    230

    Default

    Waiting for some better solution, I've done following:

    - removed pentaho.war and pentaho-style.war (links to target-preconfiguredinstall-tomcat) from target-preconfiguredinstall because it won't copy them to my target-preconfiguredinstall that already has them as folders?)

    - copied everything from target-preconfiguredinstall-tomcat\webapps\pentaho to target-preconfiguredinstall\server\default\deploy\pentaho.war (similar for pentaho-style)

    - from patches\project-cdf\solution folder: copied template-dashboard.html and default-dashboard-template.html to my own solution folder (project-xxx\solution)
    - also: copied dashboards and cdf folder (the folder with components subfolder..do I have to do this...it is not under patches folder) from cdf solution folder to my own solution folder
    - run ant with my own properties file, compiled everything successfully
    - run the platform - no erroris
    - went to http://127.0.0.1:8080/pentaho/Dashboards

    BUT unfortunately I only get "busy" image (with text "Processing...") and nothing else. There is no error anywhere so I don't know what is happening....??

    Possibly some stupid mistake?

    regards, dejan

  26. #26
    Join Date
    Feb 2007
    Posts
    230

    Default

    After some debugging I have found I have a problem with Dashboards.blockUIwithDrag(); function. If I uncomment it (and $.unblockUI(); too) in Dashboards.initEngine it starts working....for now

    regards, dejan

  27. #27
    Join Date
    Sep 2008
    Posts
    3

    Default

    Hi dejan,

    You have to copy templates to project-xxx\solution\system\custom.

    "from patches\project-cdf\solution folder: copied template-dashboard.html and default-dashboard-template.html to my own solution folder (project-xxx\solution)"

    You should specify the solution.
    Ex: http://127.0.0.1:8080/pentaho/Dashboards?solution=yyy.
    If you want to run a specific dashboard you need also the path:
    http://127.0.0.1:8080/pentaho/Dashbo...n=yyy?path=zzz

    "- went to http://127.0.0.1:8080/pentaho/Dashboards"

    Here goes an example of default-dashboard-template.html:

    <div id="folderTitle_object" class="pageTitle" >&nbsp;</div>
    <div id="folderContent_object" class="solutionItems" >&nbsp;</div>

    <script language="javascript" type="text/javascript">

    folderContent =
    {
    name: "folderContent",
    type: "contentList",
    listeners:[],
    parameters: [],
    htmlObject: "folderContent_object",
    executeAtStart: true,
    mode: "1"
    }

    folderTitle =
    {
    name: "folderTitle",
    type: "pageTitle",
    listeners:[],
    parameters: [],
    htmlObject: "folderTitle_object",
    executeAtStart: true,
    mode: "1"
    }

    var templateComponents = [folderContent, folderTitle];
    Dashboards.init(templateComponents);
    </script>

  28. #28
    Join Date
    Feb 2007
    Posts
    230

    Default

    Thanks for the answer,

    I did all of this, but as I mentioned in my last post, I had problems with using Dashboards.blockUIwithDrag(); function. I had to comment this and everything started to work...

    regards, dejan

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.