Bookmark favorites
General principles
By default, when displaying an empty container, ActiveUI displays categorized tiles for each available widget.
The tiles displayed can be modified in three ways:
- Adding new tiles which are bookmark favorites
- Adding new tiles, which changes the default widget configurations
- Removing tiles that a user does not want to see, or should not have access to
Adding a new Bookmark Favorite Tile
The bookmark favorites feature let's users add custom tiles in the empty container, providing quick access to the bookmarks they need the most.
From the UI
To do so, right-click on a bookmark favorite in the bookmarks tree, and select "Add to favorites".
- Fill-out the category section, by either selecting an already existing category, or type a new category name.
- Fill-out the name you want to give to your favorite, and submit.
Programmatically:
The bookmark favorites feature is based on the Settings mechanism and the Content Server.
Therefore, a bookmark favorite defined in the:
default
preferences/permissions will be seen by all users (if not overridden at a more granular level).roles/ROLE_USER
preferences/permissions will only be seen by the members of thisROLE_USER
role.user/USER_A preferences/permissions
will only be seen byUSER_A
.
To create a new bookmark favorite, add a new key, starting with the mandatory prefix bookmarks.favorites.*
.
A suffix is needed, but there is no constraints on it, except that it must be unique, and not contain any more dots.
Regarding the value of the setting, the mandatory attributes are:
- A
type
attribute, corresponding to the plugin key of the widget (pivot-table
,chart
, etc) - Either an
id
or avalue
attribute
If an id
attribute is specified, then the bookmark favorite will reference the existing bookmark having this id.
Here is an example of a bookmark favorite referencing a bookmark id:
{
"map": {
"bookmarks.favorites.pivot-table-18f": {
"category": "data",
"id": "18f",
"name": "PnL per Desk",
"type": "pivot-table"
}
}
}
If the value
attribute is specified, then the bookmark favorite is defined as a new bookmark (though it will not appear in the bookmarks tree):
{
"bookmarks.favorites.pivot-table-by-value": {
"category": "data",
"name": "PivotTable v2",
"type": "pivot-table",
"value": {
"style": {},
"showTitleBar": false,
"containerKey": "pivot-table",
"body": {
"serverUrl": "",
"mdx": "SELECT ...",
"contextValues": {},
"updateMode": "once",
"configuration": {
"...": "..."
}
}
}
}
Adding new Tiles Changing the Default Configuration of Widgets
Note: this feature is targeting programmers and not end-users.
The bookmark favorites feature also allows users to change the default configuration of a widget. It basically uses the same principle described in the previous section, but the key part is that now a bookmark can be described partially. By "partially", we mean that some attributes of a bookmark which are needed for ActiveUI to be able to render a widget, like the MDX or the server URL for a pivot table, can be omitted. If some of these needed attributes are not present in the bookmark, then the user will be displayed the Server Chooser for this particular example. This means that if you try to load a pivot table bookmark which contains a valid configuration in its body, but without the MDX attribute, then it will behave just like the regular pivot table, but with your custom configuration. In other words, you can redefine at will your bookmark body field to change the configuration of your widgets.
Example 1: Adding a Modified Pivot Table Tile from the UI
In this example, we will be adding a new pivot table tile, and make it load with the wizard hidden by default and without line numbers.
- Open a regular pivot table
- Hide the wizard
- Go to state and change
lineNumbers
tofalse
- Click on the save as new bookmark icon
- Give it a relevant name
At this stage, the bookmark is fully defined. We are going to remove the mandatory attributes so that clicking the tile behaves exactly like the default pivot table, i.e. ask for the cube first:
- Remove the
serverUrl
andmdx
attributes - Submit to save
- Go to the bookmarks tree, right-click on your new bookmark, and add it to the favorites!
Eventually, if your goal is to completely override the default pivot table, you can right-click on the default pivot table, and click "Hide default widget".
Final note: from the UI, the changes only apply to the current user. In order to propagate this to a bigger group of users, a developer can start with this method, then go to the Content Server, and move the created setting to the preferences file of a bigger group.
Example 2: Adding a Modified Pivot Table tile Manually from the Content Server
First, start off the example describing how to create a bookmark favorite by value (see Adding a new Bookmark Favorite Tile).
In the bookmark value.body.configuration
field, copy-paste the default pivot table configuration, that you can find here.
Change the minimum row size to 25 pixels: "minRowSize": 25
.
Internationalization
You can also use the titleCaptionPath
and descriptionCaptionPath
attributes to have your title and description internationalized correctly:
If you use these two caption paths, then the name
attribute is no longer mandatory. Not defining a name
attribute will generate a new random name for the widget every time it is created.
Here for example:
{
"...": "...",
"bookmarks.favorites.pivot-table-18f": {
"category": "data",
"descriptionCaptionPath": "bookmarks.new.pivot-table.description",
"id": "18f",
"titleCaptionPath": "bookmarks.new.pivot-table.title",
"type": "pivot-table"
},
"...": "..."
}
Removing Tiles
From the UI, users can remove tiles they do not want to see, by right-clicking on them and selecting Hide default widget, or Delete favorite if the tile was added as a favorite by themself. Default widgets can be un-hidden by using the dock action Show all default widgets. However, deleting a user favorite is not a recoverable operation.
It is also possible to hide tiles that are regular widgets, like the drillthrough or the pivot table, by proceeding the same way.
In this case, a new setting key is written in the Content Server, with the following template: "bookmarks.favorites.container-key.hidden": true
A Content Server admin can delete this key, and the widget will show-up again in the user's dock.
Let's say that a bookmark favorite with key bookmarks.favorites.pivot-table-example
was created in the default/preferences
file (so everyone can see it), but you want to hide it from USER_A
.
Then add the following setting "bookmarks.favorites.pivot-table-example.hidden": true
in the USER_A/preferences
file.