For this blog, we will be creating our own website and we will include DV contents as a part of the website. We will also explore the various steps involved to do DV embedding. Let us start with a bare minimum HTML code for our website displaying the name and a few texts.
- project-path: Specify project in repository to render.
- active-page: Optional and options to choose are Canvas or Narrate
- active-tab-id: Optional. Specify the id of the canvas.
- filters: Optional.
- project-options: Optional. Below are the options you can pass:
- bShowFilterBar: Values should be true or false;Shows or hides filter bar.
- bDisableMobileLayout: Values should be true or false; Disables or enables mobile layout.
We will be using project-path attribute to embed the DV content into our website.
Now coming back to the code, the next step is include <oracle-dv> tag and set the project-path attribute to the path of the project that we want to embed. Now our HTML code for the website should look something like this.
Also included towards the bottom of the HTML code are the Knockout bindings. We are using the knockout model's declarative bindings to assign the value to the project-path attribute. Knockout bindings are generally executed either in a body onload handler or in a <script> tag after the <oracle-dv> tag. In this case we have used a <script> tag after the <oracle-dv> tag.
We are now one step away from including DV content into our website. The final step is to include the domain name of our website into the list of safe domains in the OAC instance from which we want to embed a DV project.
Since we are hosting the website on a localserver, we have added an entry for 127.0.0.1 along with the port number. If we want to do DV embedding on a public web server, add the domain name/ ip address of the web server to the list of safe domains. A refresh of the OAC instance is needed for the safe domains to kick in and now our website should look something like this
The rest of this blog will be focused on how to pass filters from our website to the embedded DV contents.
As mentioned before, <oracle-dv> supports filter attributes. In order to pass filters to the embedded DV content, we need to construct filter object with the following attributes.
- sColFormula: Specify the three-part column formula of the column to be used as a filter. This MUST BE three parts. Create a project within DV using the column, then go to the Developer menu item and look up the column formula to get the three part forumula.
- sColName: Specify a unique name for this column. This must be non-empty.
- sOperator: One of in, notIn, between, lessOrEqual, greaterOrEqual. in and notIn apply to List filters. between, lessOrEqual, greaterOrEqual apply to numeric filters
- isNumericCol: Whether or not this is a numeric filter or a list filter. Values should be true or false.
- isDateCol : Flag indicating whether date column - values should be true or false and is a mandatory attribute - Note: This is set to true only for date and not for year, month,quarter etc. If this flag is set, fill aDisplayValues attribute with the date/s.
- bIsDoubleColumn: Whether or not this column has double column values behind the display values. Values should be true or false.
- aCodeValues: When bIsDoubleColumn is true, this array will be used.
- aDisplayValues: When bIsDoubleColumn is false, this array will be used for filtering and for displaying values within the UI.