Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/data_source.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/frelard_objects_extension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 17 additions & 7 deletions docs/trex_debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ A dashboard extension embeds a web page and runs a Chromium-based browser inside

## Set up Tableau for debugging (Windows)

1. Start Tableau and drag an extension onto the dashboard.
2. Select the extension in the dashboard.
3. Click the **More Options** button in the upper-left or upper-right corner of the extension. Click **Debug Options** > **Enable Debugging**.
4. After enabling debugging, select **Debug Options** > **Reload** to reinitialize the browser. You might need to stop and restart Tableau for the settings to take effect.

![Enable and reload]({{site.baseurl}}/assets/TcNTYA9566.gif)
If you are using Tableau Desktop on Windows, you need to open a Command Prompt window and run a command to start Tableau with debugging enabled.

1. Open a Command Prompt window.
2. Start Tableau using the following command:

```
"C:\Program Files\Tableau\Tableau\bin\tableau.exe" --remote-debugging-port=8696
```

This command enables remote debugging for all extensions.

After you've done these steps, debugging will be enabled for all extensions until you turn it off.
For convenience, you could also create a shortcut for Tableau and add the remote debugging option to Properties dialog box. Select Tableau from the **Start** menu, and then right-click and select **Properties** or select **Open file location**. If you open the file location, you can create a new shortcut to `Tableau.exe` (call it something like *Tableau - Debug* ). Open the Properties for the new shortcut and append `-remote-debugging-port=8696` at the end of the command in the **Target** text box. The debugging option goes after the closing quotation mark for `"Tableau.exe"`.

![Debug Shortcut]({{site.baseurl}}/assets/Tableau_shortcut_debug.png){:height="40%" width="40%"}

## Set up Tableau for debugging (macOS)

Expand Down Expand Up @@ -62,11 +67,16 @@ It can be difficult to hit breakpoints which occur during the loading of your pa
4. To attach to the browser instance, click the first item listed (it will be completely blank, but it is really there. The cursor changes so you can select it).
4. Click the **Sources** tab in Chromium, under **Event Listener Breakpoints**, click **Script** and enable the **Script First Statement** breakpoint.
5. Back in Tableau, click the extension zone to load your page.
6. The debugger will pause each time the first statement of a script runs allowing you to debug the startup process
6. The debugger will pause each time the first statement of a script runs allowing you to debug the startup process.

![Startup Debugging]({{site.baseurl}}/assets/foucUWBiUJ.gif)

## Known Issues

#### Enabling debugging from the Debug Options menu

Due to changes in the start-up sequence, you can no longer enable remote debugging by selecting **Debugging Enabled** from the **Debug Options** menu in the dashboard. To enable debugging, you must add the `--remote-debugging-port=8696` option to the command used to start Tableau. You can still select the **Pause before Loading** option and set breakpoints to debug initialization and loading issues.

#### Refreshed Page Fails
Unfortunately, due to a bug with our embedded browser, refreshing a loaded page doesn't properly setup the communication between Tableau and the extension. This means that trigger a page reload will cause your extension to stop working. It's important to note that the **Reload** menu option actually tears down and re-creates the browser control, which means you'll need to establish a new debugging sessions whenever you click **Reload**.

4 changes: 2 additions & 2 deletions docs/trex_getstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To use the dashboard extension samples, you need to start up a web server on you

1. Start Tableau and open a workbook that has a dashboard, or open a workbook and create a new dashboard.
2. In the dashboard, under **Objects**, select **Extension** and drag it on to the dashboard.
![]({{site.baseurl}}/assets/frelard_objects_extension.png)
![]({{site.baseurl}}/assets/frelard_objects_extension.png){:height="25%" width="25%"}

3. In the **Select an Extension** dialog box, click **Choose an Extension**.
Every Tableau extension has a manifest file (`.trex`) that describes the extension and identifies the location of the web application.
Expand All @@ -92,7 +92,7 @@ To use the dashboard extension samples, you need to start up a web server on you
The sample extension (web application) appears in the dashboard frame. The DataSources sample finds and displays the data source for each worksheet in the dashboard.
6. In the DataSources extension, click the **Info** (**i**) button. This action opens a dialog box that displays more details about the selected data source.

![]({{site.baseurl}}/assets/data_source.gif)
![]({{site.baseurl}}/assets/data_source.gif)



Expand Down
9 changes: 8 additions & 1 deletion docs/trex_manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ If a workbook is saved with an extension and then later opened on another comput
<url>SCHEME://SERVER[:PORT][/PATH]</url>
</source-location>
<icon>Base64-Encoded ICON</icon>
<permissions>
<permission>full data</permission>
</permissions>
</dashboard-extension>
<resources>
<resource id="name">
Expand Down Expand Up @@ -114,10 +117,14 @@ The exception is for <code>localhost</code>. In this case, HTTP is allowed. For
<td>If specified, the icon is what appears under <strong>Extensions</strong> on a dashboard sheet. The icon must be a 64x64 pixel PNG file that is Base64 encoded. If you need an encoder, see <a href="https://www.base64-image.de/" class="uri">https://www.base64-image.de/</a></td>
</tr>
<tr class="odd">
<td><code>permissions</code></td>
<td>Declares the types of permissions that this extension requires. The only option is <code>full data</code>. If your extension can access the underlying data or information about the data sources, you must declare full data permission in the manifest. Full data permissions are required if you use any one of the following APIs: <code>Worksheet.getUnderlyingDataAsync()</code>, <code>Datasource.getUnderlyingDataAsync()</code>, <code>Datasource.getActiveTablesAsync()</code>, <code>Datasource.getConnectionSummariesAsync()</code>. If your extension does not use one of these APIs, you do not need include permissions element.</td>
</tr>
<tr class="even">
<td><code>resources</code></td>
<td>Specifies the resources that can be localized.</td>
</tr>
<tr class="even">
<tr class="odd">
<td><code>min-api-version</code></td>
<td>Specifies the minimum API version required to run the extension. This field is not used in this Developer Preview. Versioning support is still in progress.</td>
</tr>
Expand Down
93 changes: 92 additions & 1 deletion docs/trex_release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,101 @@ layout: docs
* TOC
{:toc}


---

### Developer Preview (0.9.0)
*February 14, 2018*

- Update of the Tableau Extensions API
- Tableau Extensions API library: `tableau-extensions-0.9.0.js`
- Tableau Desktop, Tableau Server (from [Extensions API Developer Preview](https://prerelease.tableau.com){:target="_blank"})

Updates in this release:
- [Updates to the UI namespace](#updates-to-the-ui-namespace)
- [Permissions added to access full data](#permissions-added-to-access-full-data)
- [Error codes for extensions](#error-codes-for-extensions)



#### Updates to the UI namespace

This preview release introduces more options for the UI namespace. You can now control the initial sizing (height, width) of a modal dialog box (or *popup*). The modal dialog itself is an extension. Using the `displayDialogAsync()` and `closeDialog()` methods you can pass payloads between the calling extension and the extension running in the modal dialog box. For an example of how you can use the UI namespace to create a configuration dialog box, see the [UINamepace](https://github.com/tableau/extensions-api/tree/master/Samples/UINamepace?=target="_blank") sample. The sample also shows how to use the settings event to capture the new configuration. The sample source code has extensive comments that describe how to use these new features in the Extensions API.

- New sample: [UINamepace](https://github.com/tableau/extensions-api/tree/master/Samples/UINamepace?=target="_blank")


#### Permissions added to access full data

To access the underlying data along with information about the data source, the extension must declare that it requires full data access in the extension manifest file (`.trex`).


An extension requires full data access, if the extension uses any of the following four APIs:

`Worksheet.getUnderlyingDataAsync()`

`Datasource.getUnderlyingDataAsync()`

`Datasource.getActiveTablesAsync()`

`Datasource.getConnectionSummariesAsync()`


If you use any of these APIs, you need to add a `<permissions>` element to the manifest file (`.trex`) and specify full data permission. The XML looks like the following:

```xml

<permissions>
<permission>full data</permission>
</permissions>

```

The `<permissions>` element must be added under `<dashboard-extension>` in the manifest file. For a complete description of the manifest, see the [Tableau Extensions Manifest File]({{site.baseurl}}/docs/trex_manifest.html).

If full data is not declared in the manifest file, and the extensions calls one of the APIs that accesses any underlying data or data source information, the API call fails. In addition, an error is written to the Tableau log file (`log.txt`). If you are debugging the extension with the Chromium web browser, an error is reported the console pane. The error message would look similar to the following:

```
PermissionValidation.ts:26 Extension (name = DataSources Sample, ID = com.tableau.extensions.demo.local) is missing required permission: full-data
Error: internal-error: permission-denied: Missing required permission to run get-underlying-data(...)

```


#### Error codes for extensions

Errors that are returned from the Extensions API are custom Tableau Error objects that extends the standard JavaScript error object.


The Extensions API wraps the standard error object with an `errorCode` property. Any time you encounter an error when you are developing your extension, you can look at this `errorCode` to determine the cause. See [Error Codes]({{site.baseurl}}/docs/enums/errorcodes.html).

For an example of how to handle error conditions, see the [UINamepace](https://github.com/tableau/extensions-api/tree/master/Samples/UINamepace?=target="_blank") sample. The sample shows how you could handle the error condition that occurs if a user dismisses a modal dialog box (`DialogClosedByUser`). The following snippet illustrates this pattern:

```javascript
tableau.extensions.ui.displayDialogAsync(args... ).then((args... ) => {
//
// code that sets up the extension in the modal dialog box
//
}).catch((error) => {
// One expected error condition is when the popup is closed by the user
// (meaning the user clicks the 'X' in the top right of the dialog).
// This can be checked for with:
switch(error.errorCode) {
case tableau.ErrorCodes.DialogClosedByUser:
console.log("Dialog was closed by user");
break;
default:
console.error(error.message);
}
});

```

---


### Developer Preview (0.8.0)
*December 21, 2017*
*January 10, 2017*

- Update of the Tableau Extensions API.
- Tableau Extensions API library: `tableau-extensions-0.8.0.js`
Expand Down