Tuesday, April 17, 2012

Pentaho User Console now working with all REST services

Over the past week or so I've been busy rewriting parts of the Pentaho User Console (PUC aka Mantle) to talk with REST services and move away from GWT-RPC. The primary motivation to do this work was to make the system more accessible to system integrators and OEM developers.

I have broken MantleService into several logical REST end points.

Themes (/pentaho/api/theme)


A new service allowing you to list the available themes as well as set / get the current theme for the authenticated user.

User Settings (/pentaho/api/user-settings)


A general purpose user settings service API which lets you list settings (for the authenticated user) as well as get / set user settings.

Version (/pentaho/api/version)


Simple service to return the current product version and also provide a software updates list (if applicable).

System Refresh (/pentaho/api/system/refresh)


A collection of resource refresh/reload services for global actions, metadata, system settings, repository, mondrian and reporting.

User Console (/pentaho/api/mantle)


This was my dumping ground for services which I did not feel provided value to be separated into their own endpoint.  The service is able to return mantle settings (different than user settings), list mondrian cubes, and get/set the locale for the authenticated user.

This work has simplified the User Console from a development standpoint, we have less ivy dependencies and the debug configuration is much more simple. All of the services return XML or JSON (determined by request headers) except for the extremely simple services which just return a string (text/plain), such as getting the current theme. I had to change the client code in PUC to consume JSON rather than the convenience/luxury we had before with GWT-RPC. The approach I took was to create JSON overlay objects (which extend JavaScriptObject). These JSON overlays are returned from the JSON eval/parsing and we then re-gain all of the richness we once had, at the expense of rewriting our POJO mutators as JNI.

For example, in the simple case of themes, which have an id and a value we now have a JsTheme:

public class JsTheme extends JavaScriptObject {
  protected JsTheme() {
  }
  public final native String getId() /*-{ return this.id; }-*/; //
  public final native String getName() /*-{ return this.name; }-*/; //
}

Once we return a list of JsTheme from JSON, our GWT app can go on enjoying life pretty much the same way as before. As a point of completeness, here is how we return get the themes from the JSON string:

JsArray<JsTheme> themes = JsonUtils.safeEval(JsonUtils.escapeJsonForEval(response.getText()));

As of Friday, April 13, 2012 the entire use of GWT-RPC has been replaced with REST. Enjoy!

Monday, April 16, 2012

New modules in the Administration perspective



Thanks goes out to Ezequiel Cuellar for being my ghost writer for this post.

The Administration perspective just got more love from the Sugar team. In an effort to migrate all the functionality from the Enterprise Console into Sugar the following two administration modules have been created: Users/Roles and Email/SMTP Server.

The User/Roles new UI allows you to easy administer users by creating or editing them and change their password, you can also create new roles and assign them to a user either one by one or by performing a multi selection.



In a similar way the roles section allow you to assign users.



The Email/SMTP Server module allows you to administer the BI Platform internal email settings (email_config.xml), you can test your changes by sending test emails before saving them and it also features a new error notification mechanism.