Comments

This article applies to versions 4.6.2 and later of P2 Explorer. For more, see Release History.

Overview

The Comments component displays a list of comments on an Explorer page, rather than in the Explore panel.

Unlike the Comments button component, where the user clicks an icon to open the comments in the Explore panel, comments from a Comments component are always on the page: there are no icons to click, and the list is always visible, with vertical scrollbars if the comments don't fit.

The comments list on a page is very similar to that in the Explore panel; the main difference is that a user cannot change the comments time range on the Comments component.

To enable changing the dates for a comments list on a page, a separate date/time control (such as a Date/Time Range Picker) can be added to the page.

The Comments list on an Explorer page

Users can add comments for data and comment context, for a timestamp specified by the page designer (defaulted to the page variable endTime) and can search for comments within the configured time range.

Comments are stored in P2 Server and can be viewed in Explorer trends, and in Explorer pages that have been configured for comments. For example, a comment that is added for entity ABC on Explorer Page 1 can be viewed and replied to on Explorer Page 2 if the page has been configured for comments for that entity, and from Trend 1 if that trend uses the same entity - provided the time ranges overlap.

Related: Comments in Explorer, Formatting Text

Finding the Component

The Comments component is in the Display Display group icon group of the Components Toolbox.

 


Quick Start

You can very quickly configure a Comments component, by giving it a fixed Entity property.

In the Comments component editor, assign a fixed value to the Entity property, then save and finish the page.

1. For the Entity property, select Entity from the drop-down (for a fixed value), and type Abes.Flowrate in the text box (this is a tag name in the Sample Data).

2. Click Finish and Open on the Studio toolbar.

3. In Display Mode, type a comment in the edit box, then click Save or press Enter.

Note: Live Preview only applies to version 4.6.2. In later versions, mentions are supported natively and a text format toolbar is available.

Your new comment appears in the list.

You can add, reply, edit*, and delete* comments in the comments list (no comments shown in this example). See Working with Comments. (*Editing and Deleting options depend on role privileges.)

Related: Using Comments for collaboration in display mode.

 


Configuration

The Comments component and the Comments Button component have a very similar configuration.

The following diagram shows a configured Comments component:

1. Timestamp The comment's timestamp. The default is the page variable: endTime. Comments that are added using this Comments component have this as their timestamp, and relate to the comment's data for this timestamp.
2. Show From and Show To The date/time range for which to display comments. Only comments with a timestamp within this range appear in the Comments list. The default values are the page variables: startTime and endTime.
3. Entity Choose Variable from the drop-down list to use a variable for this property, otherwise Entity. This is the comment's data, and can be a tag, an entity, or an attribute. Comments that are added using this comments component will be for this data.
4. Hierarchy If you choose to use a hierarchy (choose Variable from the drop-down list to use a variable for this property, otherwise Hierarchy), then comments for the component's specified entity, as well as all of its descendent entities in the specified hierarchy, are shown in the comments list. This should only be used if the Entity property is an entity (not a tag or an attribute).
5. Comment Context Optionally type a Comment Context to apply a filter to the comments that are added using this comments component. Read more about Comment Context.
6. Style Select a suitable style from the drop-down list.
7. Position Select a position in Precision Layout or Grid Layout (depending on where the component is placed).

Related: Comments Button

 


Tutorial: Configuring Various Comments components

If you're unfamiliar with the process of building pages, read the article Building an Explorer Page.

In this tutorial, we'll add several Comments components, as well as a Breadcrumb component. We'll also add some Text Labels to label the different configurations used in our Comments components.

For all of the tutorials, we will keep the default values for: Timestamp, Show From and Show To properties.

At the end of the tutorial, your page should look something like this:

If you'd prefer to do just a part of the tutorial, then choose from the list here:

As you finish each section, try it out in preview mode:

Click the preview preview button on the Studio toolbar to see what your page will look like in display mode.

Note: This configuration uses the Sample Data table and datasets that can be optionally made available during initial installation and setup. If you don't have access to this data, you will need to adjust the configuration to suit your data at your site.

Prepare a New Explorer Page

In this section, we're going to add a new Explorer page in Precision Layout, then add two grids, for organising our page.

Step 1. Prepare a Studio Page

Before you start, click the New Page button on the Home tab of the ribbon. Choose the Precision layout.

Step 2. Add Two Grid Layouts

We're going to add two grid layouts to the page: each will have a row of headers (Text Labels), and a row of Comments components- just so we can organise the different comments components in the tutorial sections.

Drag and drop a grid layout onto the top half of the page, and configure it:

  • Add two Columns and one Row.
  • Set the Column Spacing to 20.
  • Resize the Rows Height: 10* for the first row, 90* for the second.
  • Resize the container to give each cell more space.

Now drag and drop a second grid layout onto the bottom half of the page, and configure it in the same way (alternatively, copy the first grid, paste it, then drag it to the bottom half of the page: see Shortcuts and Tips).

Related: Grid Layout

Comments for an Attribute

The most basic configuration for a Comments component is when only the Entity property is specified. This is the time series data that the comment is about, and can be a Tag, an Attribute, or an Entity.

Step 1. Add Text Label and Comments component

In this step, we're going to add a Text Label and a Comments component configured for an attribute.

1. Drag and drop a Text Label into the top left cell of the first Grid Layout. Configure the Text Label: type 'Comments for an Attribute' in the Content text box.

2. Drag and drop a Comments component into the cell below the Text Label.

3. Configure the Comments component as follows, keeping the default values for all other properties of the component:

Entity Select Entity from the drop-down list Type Beardy[Oil Producing Well]:THP!Actual in the text box

Step 2. Preview the Changes

In Preview mode:

Type a comment in the edit box, then click Save or press Enter.

The new comment is saved and appears in the Comments list. If you hover over the comment's data name, you can see the full name in a tooltip.

Related: Text Label tutorial

Comments with Comment Context

You can specify a Comment Context to apply a filter to the comments that are added to this comments component, and returned in the comments list. Read more about Comment Context.

Step 1. Add Text Labels and Comments components

In this section, we're going to add three Text Labels and three Comments components, each with the same tag. We'll configure the comments components to filter for context, using Comment Context in three different ways.

1. Drag and drop a Text Label into each of the cells in the first row of the second grid. Configure the three Text Labels as follows:

Text Label 1 Content Comments for Tag Abes.ChokePos, with context comment context 'High Values'
Text Label 2 Content Comments for Tag Abes.ChokePos, with comment context 'Low Values'
Text Label 3 Content Comments for Tag Abes.ChokePos, with NO comment context

2. Drag and drop a Comments components into each of the cells below the Text Labels.

3. Configure the three Comments components as follows:

Comments component 1 Entity Abes.ChokePos  
  Comment Context High Values  
Comments component 2 Entity Abes.ChokePos  
  Comment Context Low Values  
Comments component 3 Entity Abes.ChokePos  
  Comment Context (leave blank)  

Defining the Entity and Comment Context for the first Comments component in this group

Step 2. Preview the Changes

In Preview mode:

1. Type a comment in the edit box for the first of the new comments components, then click Save or press Enter.

2. Type a comment in the edit box for the second of the new comments components, then click Save or press Enter.

The comments in the first two are filtered by their Comments Context. The third comments component has no comment context filter, so all of the comments against this tag (and for this time range) appear in the comments list.

Note how the comments context appears next to the data name, separated by a comma.

Comments for a Hierarchy Section

If you choose to specify the Hierarchy property, then comments for the component's specified entity, as well as all of its descendent entities in the specified hierarchy, are shown in the comments list.

This should only be used if the Comments component's Entity property is an entity.

In this section, we're going to add two Text Labels, as well as two Comments components that are each configured for a variable entity, selectedEntity, while one also has a hierarchy. We're going to add a Breadcrumb component for changing the selectedEntity variable at different levels. Finally, we'll set a default for selectedEntity.

Step 1. Add Text Labels and Comments components

1. Drag and drop a Text Label into the top 2nd and 3rd cells of the first Grid Layout. Configure the two Text Labels as follows:

Text Label 1 Content Comments for Entity
Text Label 2 Content Comments for Hierarchy Section

2. Drag and drop a Comments component into each of the cells below the new Text Labels.

3. Configure the two Comments components as follows (keeping the default values for the remaining properties):

Comments component 1 Entity Select Variable from the drop-down list; select selectedEntity from the drop-down list (this is the default)  
Comments component 2 Entity Select Variable from the drop-down list; select selectedEntity from the drop-down list (this is the default)  
  Hierarchy Select Hierarchy from the drop-down list; type P2 Corporate in the text box  

Defining the Entity and Hierarchy for the second Comment component in this group

Step 2. Add a Breadcrumb

1. Drag and drop a Breadcrumb component onto the top left of the page, and resize to fit about half of the page (horizontally).

2. Configure the Breadcrumb as follows, keeping the default values for all other properties of the component:

Entity Name Select Variable from the drop-down list; select selectedEntity from the drop-down list (this is the default)  
Hierarchy Name Select P2 Corporate from the drop-down list  

 

Step 3. Set the Default Values

We are going to set a default for the selectedEntity variable.

  • Click the Default Values button on the Studio toolbar.
  • For the selectedEntity variable, update it to specify New South Wales (this is in the P2 Corporate hierarchy).

Step 4. Preview the Changes

We're going to start by adding comments to various entities selected using the Breadcrumb component, and then we'll finish by seeing how those comments appear for the Comments Button with a Hierarchy specified.

In Preview mode:

1. Select Glen Innes in the breadcrumb.

2. Type a comment in the edit box for the Comments component under the label Comments for Entity, then click Save or press Enter.

3. Select Beardy in the breadcrumb.

4. Type a comment in the edit box for the Comments component under the label Comments for Entity, then click Save or press Enter.

5. Select New South Wales in the breadcrumb.

6. Type a comment in the edit box for the Comments component under the label Comments for Entity, then click Save or press Enter.

7. In the Comments component under the label Comments for Hierarchy Section, note how all of the comments that we added for the entities and attributes in this sub-section of the hierarchy are in the comments list. This is because the Hierarchy is specified in the Comments component.

Related: Breadcrumb tutorial, Variables, Default Values

 


Release History

  • Comments Button 4.6.2 (this release)
    • Comments can now include hashtags # in the content, for creating an entity 'pill'
    • Comments can now include mentions @ in the content, for sending a notification to another user
    • 'Live Preview' tab when adding or editing comments or replies. Note that Live Preview only applies to version 4.6.2, in later versions mentions are supported natively.
    • In version 4.6.4, a text format toolbar was added
  • Comments Button 4.4

 

Comments are closed