Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 93996

Summary: [General designer usability] Need to support Report Templates Extension
Product: z_Archived Reporter: Mike Boyersmith <mjboyers>
Component: BIRTAssignee: Dazheng Gao <gump_gao>
Status: VERIFIED FIXED QA Contact: Maggie Shen <lshen>
Severity: enhancement    
Priority: P3 CC: bluesoldier, clin, danberg, ldamus, mdelder, nmakin, wenfeng.fwd, zqian
Version: unspecifiedKeywords: plan
Target Milestone: 2.5.0   
Hardware: PC   
OS: Windows XP   
Whiteboard: Non-Auto
Attachments:
Description Flags
New > Report Wizard
none
Report Wizard Flow
none
template extension - example
none
updated sample none

Description Mike Boyersmith CLA 2005-05-06 16:07:53 EDT
Report Template selection is currently hard coded in the class
WizardTemplateChoicePage. Ideally Birt needs to support the ability for
customers to add thier own templates into the ERD. Extensibility is a good thing
here. I see two extension possibilities right off that would be nice to have: 

1) An extension point that allows a company to add to a tree view that         
categorizes templates something like 

company X feature 
    temp1 
    temp2 
    temp3 
Company Y feature 
    tempa 
    tempb 
    tempc 
company z 
    sub category a 
        temp1 
        temp2 
        temp3 
    sub category b 
        temp 1 
        temp 2 
        temp 3 

- OR - 

2) Add extension support for adding kinds of templates to the wizard and allow
the extension implementer to provide additional pages for that new kind of
template on the template kind selection and Next button press. 

so 

wizard page 1 might be 

Select Kind of Report Templates you wish to work with 

Basic 
Company X 
Company Y 

if I select Company X and hit <next> 

I get the Company X list of templates to select from.
Comment 1 Wenfeng Li CLA 2005-10-26 03:41:38 EDT
in BIRT 2.0, user will be able to create new templates and put them in a 
folder to be used as the based for report creation.  We are not using plugins 
to achieve this capability, however, please review BPS for template.
Comment 2 Mike Boyersmith CLA 2006-02-01 13:09:42 EST
I was able to get this to work using the preference but this isn't a good solution for us. What we need is the ability to reuse this dialog by providing our own list of templates to be shown on the templates page. For instance:

Product 1, might want to use this dialog and provide a domain specific list of templates in this dialog. Later on, Product 2 might want to use this dialog and provide its domain specific list of templates in this dialog. As you can see the current design doesn't support this abstraction and seperation

Also the Templates Page of the wizard only supports .rpttemplate it would be nice to also be able to have it load .rptdesign files as well, as starter choices for a new report. 
Comment 3 Wenfeng Li CLA 2006-05-26 04:35:59 EDT
set this as an enhancement request.
Comment 4 Narinder Makin CLA 2008-03-13 11:05:35 EDT
Could I get an estimated time on when this will be supported or if there is a workaround to register a report template through the plugin - extension or code?
Comment 5 Zhiqiang Qian CLA 2008-03-13 22:28:39 EDT
The template list is processed in class WizardTemplateChoicePage. You can either change this class or replace the whole NewReportWizard extension with yours.
Comment 6 Michael D. Elder CLA 2008-04-01 23:05:56 EDT
Hi Zhigiang,

The suggestion doesn't quite meet the needs of this defect. 

In particular, the New > Report wizard is the standard report creation hook, and defining a separate wizard just for our report would potentially confuse users. I have included a picture of the menu and wizard flow I'm referencing.
Comment 7 Michael D. Elder CLA 2008-04-01 23:06:23 EDT
Created attachment 94469 [details]
New > Report Wizard
Comment 8 Michael D. Elder CLA 2008-04-01 23:06:48 EDT
Created attachment 94471 [details]
Report Wizard Flow
Comment 9 Wenfeng Li CLA 2008-04-02 17:19:01 EDT
(In reply to comment #8)
> Created an attachment (id=94471) [details]
> Report Wizard Flow

Is the enh request to pick up a complete different set of templates based on different products?  

We can have WizardTemplateChoicePage class read a setting of where to search for the templates.   How do you plan to set such settings?  via an extenion point to the WizardTemplateChoicePage's plugin?  What would the API of such a extension point?  Is it going to be as simple as getTemplateFolder() or getTemplateList()?
Comment 10 Narinder Makin CLA 2008-04-02 18:43:59 EDT
It will be nice to have some categorization in the templates that are contributed with UI able to show the categorized reports. However, the basic request is to be allowed to register new template locations that are defined in the contributing plug-ins such that they are shown along with the other templates in the wizard.

The registration extension point could be simple as below:

<extension
         point="com.ibm.ccl.erf.birt.reporttemplates">
      <reportTemplate            url="platform:/plugin/com.myplugin.birt/designs/myTemplate1.rptdesign">
      </reportTemplate>
      <reportTemplate            url="platform:/plugin/com.myplugin.birt/designs/myTemplate2.rpttemplate">
      </reportTemplate>
   </extension>

Notice that we should be able to read both - a rptdesin and rpttemplate.

With Categorization it may look like below:
<extension
         point="com.ibm.ccl.erf.birt.reports">
      <category
            displayName="MyCategory"
            icon="myreportcategory.gif"
            id="com.myplugin.birt.mycategory">
      </category>
      <reportTemplate      
       category="com.myplugin.birt.mycategory"
       url="platform:/plugin/com.myplugin.birt/designs/myTemplate1.rptdesign">
      </reportTemplate>
      <reportTemplate      
       category="com.myplugin.birt.mycategory"
       url="platform:/plugin/com.myplugin.birt/designs/myTemplate2.rpttemplate">
      </reportTemplate>
   </extension>
Comment 11 Narinder Makin CLA 2008-04-02 18:49:57 EDT
Another extension point design could be simply to register the template folders (augment existing or just supply this), if that is something that fits the current implementation.
<extension
         point="com.ibm.ccl.erf.birt.reporttemplates">
      <reportTemplateFolder          
url="platform:/plugin/com.myplugin.birt/designs">
      </reportTemplateFolder>

    <reportTemplateFolder          
url="platform:/plugin/com.myplugin.birt/metricdesigns">
      </reportTemplateFolder>

</extension>

With Categorization it may look like below:
<extension
         point="com.ibm.ccl.erf.birt.reports">
      <category
            displayName="MyCategory"
            icon="myreportcategory.gif"
            id="com.myplugin.birt.mycategory">
      </category>
      <reportTemplateFolder          
url="platform:/plugin/com.myplugin.birt/designs">
      </reportTemplateFolder>

<reportTemplateFolder          
url="platform:/plugin/com.myplugin.birt/metricdesigns">
      </reportTemplateFolder>

   </extension>

Comment 12 Zhiqiang Qian CLA 2008-04-10 02:35:19 EDT
We can add extension support for template list, but probably no new extension point, just leverage existing adapter extension point.

Rima, do we need a new categorized template list UI design? Or the simplest way is to use a tree view.
Comment 13 Zhiqiang Qian CLA 2008-04-10 06:57:00 EDT
ExpandBar may be a better choice if we do not plan to support sub category.
Comment 14 Cheng-Yee Lin CLA 2008-04-24 17:45:13 EDT
Would this support become available for BIRT 2.3 release?
Comment 15 Rima Kanguri CLA 2008-05-22 23:08:19 EDT
Wenbin, please review the request. Thanks
Comment 16 Wenfeng Li CLA 2008-06-09 19:28:26 EDT
(In reply to comment #12)
> We can add extension support for template list, but probably no new extension
> point, just leverage existing adapter extension point.
> Rima, do we need a new categorized template list UI design? Or the simplest way
> is to use a tree view.

PLease use tree view.
Comment 17 Dazheng Gao CLA 2009-02-04 01:57:36 EST
Fixed.extension point like this,
 <extension
         point="org.eclipse.birt.report.designer.ui.elementAdapters">
      <adaptable
            class="org.eclipse.birt.report.designer.internal.ui.wizards.ExtensionTemplateListProvider">
         <adapter
               class="test.TemplateTest1"
               id="TestPlug.adapter1"
               priority="10"
               type="org.eclipse.birt.report.designer.ui.templates.ITemplateProvider">
         </adapter>
      </adaptable>
   </extension>
Comment 18 Maggie Shen CLA 2009-04-12 22:28:22 EDT
verified. I have attached a simple example.
Comment 19 Maggie Shen CLA 2009-04-12 22:29:23 EDT
Created attachment 131593 [details]
template extension - example
Comment 20 Maggie Shen CLA 2009-06-18 05:48:20 EDT
Created attachment 139527 [details]
updated sample