Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Programmatically generating XMI file for PMD

  1. #1
    Join Date
    Aug 2011

    Default Programmatically generating XMI file for PMD


    I'm currently trying to dynamically generate a report template that can be opened in Pentaho Interactive Reporting (i.e. a PRPTI file).

    This looks to follow the PRPT format to a certain extend. However, seems to need a couple of additional attributes on the layout.xml - otherwise I get NullPointerExceptions on opening the PRPTI file in PUC.

    Further, it seems to require a PmdDataFactory and doesn't seem to want to work with a SimpleSQLReportDataFactory (again, hit NPE's if I use the SimpleSQLReportDataFactory, and appears like it's looking for a Pmd data source).

    However, in order to use the PmdDataFactory, I need to point this at an XMI file. For various reasons, I don't want to run through the Metadata Editor to generate the XMI file (the DB schema could be different at different customer installations, and the Metadata Editor will not be installed there).

    So, I was wondering: is there an XMI generation API somewhere?

    I noticed from this old post:

    That there it is recommended to use the API to load the XMI, however haven't seen any references for XMI creation.

    Alternatively, if there is an API for creating the PRPTI files without needing to go down the XMI path, this would do the trick.


  2. #2
    Join Date
    Aug 2011


    Thought I might as well share the feedback I got from Pentaho & some extra digging I've done on the forum in case anyone has the same question:

    Interactive Reporting requires the use of Pentaho Metadata, yes.

    Regarding metadata APIs, I recommend taking a look at Pentaho Metadata's unit tests, which exercise the org.pentaho.metadata.model API, including seralization, etc:
    It looks to me like the easiest way to generate the XMI is to construct a org.pentaho.metadata.model.Domain object, and use the org.pentaho.metadata.util.XmiParser.generateXmi(Domain) method to generate the XMI from the Domain.

    The XMIParser seems to not only be for parsing from an XMI file into a Domain, but also does the Domain->XMI file writing.

    However I haven't tried to use these classes, just found the methods to figure out how it could be done.

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.