Tuesday, May 2, 2017

CDE CDF components and templates in Pentaho solution directory

CDE CDF components and templates in Pentaho solution directory


Someone brought to my attention that this is a very useful, though undocumented feature. TL;DR,  you can have templates and components in the solution directory and not in the plugin directory, that gets wiped on upgrades


Its a common requirement having to develop templates or components to extend the capabilities of the Ctools. The normal place is to put it in the solution/system/plugin directory, along the others.

However, that has a huge inconvenience - whenever we upgrade / reinstall the plugin we need to copy the resources back, not forgetting to do a backup before.

Thats not actually needed since a while back. If we put the resources directly under the pentaho-solution// all the Ctools will know what to do.

Heres a real life example that can serve as reference:


cde
??? components
?   ??? EmailPrpt
?   ?   ??? component.xml
?   ?   ??? emailPrpt-implementation.js
?   ?   ??? emailPrpt.xaction
?   ??? VideoGallery
?       ??? ceebox-implementation.js
?       ??? component.xml
?       ??? css
?       ?   ??? ceebox.css
?       ??? images
?       ?   ??? cee-close-btn.png
?       ?   ??? cee-next-btn.gif
?       ?   ??? cee-next-btn.png
?       ?   ??? cee-prev-btn.gif
?       ?   ??? cee-prev-btn.png
?       ?   ??? loader.gif
?       ??? jquery.ceebox.js
?       ??? jquery.swfobject.js
??? styles
?   ??? Clean.html
??? templates
?   ??? index.xml
??? widgets
    ??? IncomeStatementDetailTable.cdfde
    ??? IncomeStatementDetailTable.component.xml
    ??? IncomeStatementDetailTable.wcdf
    ??? index.xml
    ??? sample.cda
    ??? sample.cdfde
    ??? sample.wcdf
cdf
??? components
?   ??? jfreechart-cda.xaction
?   ??? traffic.xaction
??? includes
?   ??? index.xml
?   ??? Operations
?       ??? facilityAccount.cda
?       ??? facilityAccount.cdfde
?       ??? facilityAccount.wcdf
?       ??? index.xml
??? index.xml