RESTful API

Using weather REST API ..

Accurate weather information and forecasts are essential elements in critical decision-making scenarios. Both enterprises and individual consumers rely on current and future weather patterns to run their daily operations and manage risks successfully.

As such, the increased demand for accurate weather information has pushed the developer community to invest in building reliable weather apps.

So in this workshop we're going to:

• use a weather API.

• pull the data into PDI.

• display dataset in a CDE dashboard - Pentaho Server service.

The following section is for Reference only.

The CDE has been activated.

You may require to create an Openweathermap account.

Follow the steps outlined below to activate CDE and test the API call with Postman.

To activate the Community Dashboard Editor (CDE) plugin, you will need to change the configuration of several .xml files in the Pentaho solutions folder as described below. Verify that you have the appropriate permissions to read, write, and execute commands in the specified directories in the instructions.

  1. Ensure the Pentaho Server is stopped.

cd
cd /opt/pentaho/server/pentaho-server
sudo ./stop-pentaho.sh
  1. Uncomment the following lines:

/opt/pentaho/server/pentaho-server/pentaho-solutions/system/pentaho-cdf-dd/plugin.xml

cd
cd /opt/pentaho/server/pentaho-server/pentaho-solutions/system/pentaho-cdf-dd
sudo nano plugin.xml
  1. Locate the following two commented blocks in this file and remove the comment tags from these blocks.

<operation>
    <id>EDIT</id>
    <perspective>wcdf.edit</perspective>
</operation>
<overlays>
    <overlay id="launch" resourcebundle="content/pentaho-cdf-dd/lang/messages">
        <button id="launch_new_cde" label="${Launcher.CDE}" command="Home.openFile('${Launcher.CDE}', '${Launcher.CDE_TOOLTIP}', 'api/repos/wcdf/new');$('#btnCreateNew').popover('hide');"/>
    </overlay>
    <overlay id="startup.cde_dashboard"  resourcebundle="content/pentaho-cdf-dd/lang/messages" priority="1">
        <menubar id="newmenu">
            <menuitem id="new-cde_dashboard" label="${Launcher.CDE}" command="mantleXulHandler.openUrl('${Launcher.CDE}','${Launcher.CDE_TOOLTIP}','api/repos/wcdf/new')" />
        </menubar>
    </overlay>
</overlays>
  1. Save.

CTRL + O
Enter
CTRL + X
  1. Uncomment the following lines:

/opt/pentaho/server/pentaho-server/pentaho-solutions/system/pentaho-cdf-dd/settings.xml

cd
cd /opt/pentaho/server/pentaho-server/pentaho-solutions/system/pentaho-cdf-dd
sudo nano settings.xml
  1. Locate the block at end of the file, 'Defining the new-toolbar-button' and remove the comments tags from this block

<new-toolbar-button>1,New CDE Dashboard,CDE Dashboard,api/repos/wcdf/new</new-toolbar-button>
  1. Locate the block at end of the file, 'Defining the new-toolbar-button' and remove the comments tags from this block.

  2. Save.

CTRL + O
Enter
CTRL + X
  1. Save your changes.

  2. Restart the Pentaho Server.

cd
cd /opt/pentaho/server/pentaho-server
sudo ./start-pentaho.sh

Community Dashboard Editor (CDE)

To verify CDE is activated, do the following.

  1. Log on to the Pentaho User Console.

  2. From the Home page, click the Create New button.

  3. From the menu that displays, select the New CDE Dashboard option. You can now begin creating your first CDE dashboard.

Resources

REST API documentation API information for building custom solutions of Pentaho products.

CDF API Pentaho Data Integration and Analytics CDF API documentation.

Pentaho Data Integration and Analytics Platform JavaScript API.

Last updated