In this post I would like to share my view on few challenges I faced by embarking on a large project powered by Jedox, which incorporated writing of several thousand lines of code (macro):
1. Editor Simplicity: Jedox is more geared towards business users providing the functionality they require as a BI product, than providing functionality for the developers to write better code. No problems, I guess they do best at what they deliver, and for the solutions area I have made out a way where I can leverage the same old friend’s of developer tools such as Eclipse for PHP (Macro) development.
2.Code Re-use: This was a major roadblock for me until I figured out a way to achieve the building of complete application styled solution for the projects delivered by Jedox. As when you write macro, it is encapsulated in its own shell, so if you want to achieve the same functionality for multiple spreadsheets (which is written once and used multiple times across spreadsheets) in the native installation of Jedox its hard to achieve, unless you expose out a single piece of functionality making tweaks to the “macro_engine_config.xml” file as mentioned in their admin manual.
The magic bullet to resolve all and more issue as mentioned above and you may face, following illustrates a way , which helped me big time to write better code is as follows:
1. Create a folder “shared_macro” or any name you like, which will be the entry point for your macro based application, nested sub folders and php files representing macros (comprising your application) all can be created and referenced relatively beneath this folder. This is the folder which will be configured with Jedox to represent the entry point for your custom code.
“C:\Program Files (x86)\Jedox\Jedox Suite\httpd\app\shared_macro”
2. Edit the “macro_engine_config.xml” for the following enteries
“C:\Program Files (x86)\Jedox\Jedox Suite\core\macro_engine_config.xml”
Add the highlighted enteries into the above configration file and re-start the service : “JedoxSuiteCoreService”
to reload the configuration.
That’s it , now Jedox can peek into this folder and utilize any php based files as macros, how to achive it is as follows:
- Create a file inside the folder created in the step 1 above as “dummy.php”, with the code content as follows:
- Reference the file from any spreadsheet macro and call upon the file contained function as follows:
And finally when you hit the button, you get the following output as desired:
Now, we have configured our Jedox to peek and utilize files from out custom folder, how now we edit amend and build a comprehensive complete PHP project styled application via eclipse:
That’s easy enough to achieve as well :
First download the eclipse package and install the necessary software as illustrated,
Then create a PHP project and add the above create “shared_macro” directory to the newly created project as follows:
(Ignore the name, it can be any thing, as I already have the project previously created for illustration i had to suffix the name with “.1″)
Once the project is successfully created, then attached the “shared_macro” folder as follows:
And that’s it, your project is now fully configured in eclipse to rock-n-roll out some comprehensive macros with all the benefits of code-reuse, intensense and more benefits available to the developers for their development purposes.
Hope the above steps, helps you go overdrive with Jedox…