Leveraging feeds in a web component
In this tutorial, you will learn how to embed another webpage directly into a dashboard or low-code app using a web component. You will also find out how you can configure HTML code, the language behind any web page, and you will explore how to utilize feeds to dynamically enhance both approaches.
In the tutorial, a low-code app is used, but this component works in exactly the same way in a dashboard.
Expected duration: 5 minutes
Note
The content and screenshots for this tutorial have been created with the DataMiner 10.4.5 web apps.
Tip
See also: Kata #34: Leverage feeds in a web component on DataMiner Dojo
Prerequisites
A DataMiner System that is connected to dataminer.services.
Version 10.4.5 or higher of the DataMiner web apps.
Overview
Step 1: Install the tutorial package
Go to https://catalog.dataminer.services/details/7d78f8c4-323f-4d30-bc27-c9a7194c2f5f.
Click the Deploy button to deploy the Dashboard web component tutorial package onto your DMS.
This package contains a Web component tutorial low-code app and a GQI ad hoc data source with information about DataMiner katas.
Step 2: Configure static web components
Go to your DataMiner landing page (e.g. https://myDataMiner/root/), and click the Web component tutorial low-code app.
Go to edit mode.
Make sure you are on the Static page. Depending on your DataMiner version, you may need to click the pencil icon next to the title "Static" on the left.
On this page, you will find two assignments.
Scroll down to the first assignment, which is to embed a web page by specifying a static URL:
Click the web component to select it.
On the right, open the Settings pane.
Set Type to Webpage.
Enter the URL of the website you would like to embed.
For example, you could use
https://docs.dataminer.services
.Preview or publish the app to see the embedded webpage.
Go back to edit mode and make sure you are again on the Static page. Depending on your DataMiner version, you may need to click the pencil icon next to "Static".
Scroll down to the second assignment, which is to embed a web page by specifying custom HTML code:
Click the web component, and open the Settings pane.
Set Type to Custom HTML, and enter the desired HTML code.
For example, you could enter
<h1>Hello there!</h1>
.Preview or publish the app to see your configured content.
Step 3: Leverage feeds
Go to edit mode.
Go to the Using feeds page of the low-code app. Depending on your DataMiner version, you may need to click the pencil icon next to the title "Using feeds" on the left.
On this page, you will find a table component containing different katas and two assignments.
In the first assignment, you will make sure the video linked to the item selected in the dropdown component is visualized in the web component:
Click the web component, and open the Settings pane.
You will notice a partial URL has already been entered.
Place your mouse cursor at the end of the URL so that you can extend it, and type a curly bracket ("{") to show the feed intellisense.
This will guide you in configuring a placeholder that will be replaced by the corresponding feed value.
Enter
{FEED."Current view"."Dropdown 2"."Selected item"."Query rows".VideoId}
to link to the VideoId property of the item selected in the dropdown component.Preview or publish the app to see the selected kata embedded in the page.
In the second assignment, you will make sure that in your HTML code, the title, the number of views, and the length of the video will be replaced by the title, the number of views, and the length of the video for the item selected in the dropdown component.
Click the web component, and open the Settings pane.
In the HTML box, you will see preconfigured HTML code.
Make the following changes to the preconfigured HTML code:
In the
<h1>
tag, replace the staticTitle
by the following feed placeholder:{FEED."Current view"."Dropdown 9"."Selected item"."Query rows".Title}
.In the
<h2>
tag, replace the staticViews
by the following feed placeholder:{FEED."Current view"."Dropdown 9"."Selected item"."Query rows".Views}
.In the
<h2>
tag, replace the staticDuration
by the following feed placeholder:{FEED."Current view"."Dropdown 9"."Selected item"."Query rows".Length}
.
Preview or publish the app to see the selected kata embedded in the page.
Learning paths
This tutorial is part of the following learning path: