Hitachi Vantara Pentaho Community Forums
Results 1 to 11 of 11

Thread: How to impl Report Template Versioning Capability in Report Designer and PUC

  1. #1
    Join Date
    Feb 2012
    Posts
    13

    Question How to impl Report Template Versioning Capability in Report Designer and PUC

    Dear Folk,
    I would like to hear the standard approach to support versioning of report templates.
    When I create a report in Report Designer or in User Console, I would like to check into SVN and the CI would pick the updated template from SVN and publish it to BI Server (instead of directly publishing the template from RD/PUC into BI Server).
    I understand we need to tweak Report Designer and PUC. I am looking for a standard implementation approach for this feature.

    Regards,
    Gokula

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    No need to tweak anything. Personally, I "publish" by saving the file directly into the solution directory and then triggering a solution-repository refresh manually.

    PRD's publish is just a copy operation - there is no magic.

    Therefore: If you use SVN to sync your directories, then all you need to do is:

    (1) save to your local working copy
    (2) commit
    (3) on the server: Update your server's working copy
    (4) refresh the solution repository.


    There is no service reachable from outside to refresh the repository via an URL call, so you have to write yourself an XAction to do that job. Then call the XAction.
    Use this piece of JavaScript to make the refresh (you must be admin to make that call).

    Code:
    var session = Packages.org.pentaho.platform.engine.core.system.PentahoSessionHolder.getSession();
    Packages.org.pentaho.platform.engine.core.system.PentahoSystem.getSolutionRepository(session).reloadSolutionRepository(session, 3);
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Feb 2012
    Posts
    13

    Default

    Hi Taqua,
    Thank you for your response.
    Step-1. Check in
    Can we add a Menu Item in Report Designer say "Commit to SVN" and when clicking on the "Commit to SVN" will use the SVNKit to commit to the SVN Server.
    Step-22. Check out in Server
    CI build use Ant to checkout the Report Template.

    If I want to implement Step-1, please describe what are the steps I need to follow (except calling SVNKit API's).

    thank you in advance,
    Gokula
    Thanks & Regards,
    Gokula

  4. #4
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Step1: Yes, you start with: Download the source from SVN, implement a action, register it via the Xul file found in the sources.
    SVN Url: http://source.pentaho.org/pentaho-re...port-designer/

    Have a look at the existing actions in PRD - actions are javax.swing.Action instances, so only standard java knowledge required here.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  5. #5
    Join Date
    Feb 2012
    Posts
    13

    Default

    Dear Taqua,
    Step-1
    Wrote an Sample Action Class under org.pentaho.reporting.designer.extensions.pentaho.repository.actions
    Step-2
    Added the below configuration in ui-overlay.xul under org.pentaho.reporting.designer.extensions.pentaho.repository
    <hbox id="main-toolbar">
    <button id="toolbar.svncommit" insertafter="toolbar.publish"
    pen:action="org....SampleAction"/>
    </hbox>

    Step-3
    Build and deployed the jar under designer lib.

    I am not able to see the menu item, something is missing.
    Can I get the complete steps to write such action or if you can share me the link (if it is available in the wiki).

    Thank you in advance,
    Thanks & Regards,
    Gokula

  6. #6
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    You added a button to the toolbar. You might want to add the same action as "menuitem" under the "menupopup" element in the same file.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  7. #7
    Join Date
    Feb 2012
    Posts
    13

    Question How to impl Report Template Versioning Capability in Report Designer

    I want to added MenuItem "Commit to SVN" (below the Publish) and map the menuitem to "Commit to SVN" trigger SVNAction.class

    User will click on File--> Commit To SVN and the SVNAction.class with upload the report template into SVN Server.

    To achieve this I need to added link in the menu, implement the action and map the action to the menu. I need the steps that I need to follow.
    Last edited by gokula; 04-23-2012 at 07:43 AM.
    Thanks & Regards,
    Gokula

  8. #8
    Join Date
    Feb 2012
    Posts
    13

    Default

    Hi,
    Could anyone provide relevant links/docs if any.
    Thanks & Regards,
    Gokula

  9. #9
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Have you actually looked at the xul-file you edited? Have you seen the menu-item tags?
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  10. #10
    Join Date
    Feb 2012
    Posts
    13

    Default

    Yes, I see the <menu-item/> tag. I am very new to pentaho so it would be great if you could guide me with complete details (or link) how to go about it.
    Thanks & Regards,
    Gokula

  11. #11
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    I assume you are looking at
    Code:
    /org/pentaho/reporting/designer/extensions/pentaho/repository/ui-overlay.xul
    The file in all its glory is:
    Code:
    <?xml version="1.0"?>
    <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
    <overlay
        xmlns:pen="http://www.pentaho.org/2008/xul"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    
      <menupopup id="file-popup">
        <menuitem id="file.publish.solution" insertafter="file.save-as"
                  pen:action="org.pentaho.reporting.designer.extensions.pentaho.repository.actions.PublishToServerAction"/>
        <menuitem id="file.open.solution" insertafter="file.open"
                  pen:action="org.pentaho.reporting.designer.extensions.pentaho.repository.actions.LoadReportFromRepositoryAction"/>
      </menupopup>
    
      <hbox id="main-toolbar">
        <button id="toolbar.publish" insertafter="toolbar.save"
                pen:action="org.pentaho.reporting.designer.extensions.pentaho.repository.actions.PublishToServerAction"/>
    
      </hbox>
    
    </overlay>
    When you see the "pen:action" references, you will immediately recognize them as classnames. If you then look at these classes in your IDE, you will see that they are Action implementations. So implement your own action and then create a new entry next to the already existing "menuitem" entries and make its "pen:action" attribute be your class name of the new action.

    On how to implement actions: (a) Look at the existing source of the load and save actions - they are probably extremely close to what you want to do already - and (b) if you do not know how to implement actions in the first place: Grab a Java-Swing book or read http://download.oracle.com/javase/tu...sc/action.html
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

Tags for this Thread

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.