Comments Button (4.5.0)

This article applies to versions 4.5.0 and later of P2 Explorer. For more, see Release History. For the latest, see Comments Button.

Overview

The Comments Button displays a small icon (commenticonempty or image024) which, when clicked, launches a window that allows users to enter and view comments relating to a specific entity, attribute value, or tag (including calculation tags) and context.

Note: In this article, we use entity to mean entity, attribute value, tag, or calculation tag. We use Entity to specifically mean entity only. 

The comments are stored in P2 Server and can be viewed anywhere in Explorer where the same context is used.

The white icon indicates that no comments have yet been made for that entity and context within the page's default start and end times, whereas the black icon indicates that comments have already been made. When the button is clicked, a floating comments window appears on the page. 

Note: The colour of the icon may change depending on the style used.

Users can add and view comments for an entity and context, within a time range specified by the page designer. Users cannot enter comments outside that time range. However, users can search for and view additional comments within other time ranges.

Related: Using Comments for collaboration in display mode, Adding a new Comments Button style, Comments: Communicating with Context

 


Configuring the Comments Button 

There are 2 configuration modes for the Comments Button. Basic mode (shown below) shows the options most commonly used. Advanced mode (which we will use in the tutorial) allows you to change the type of properties used.

Basic Mode

Start Date/Time: The date/time from which to display comments. This will be entered as the default start of the search date range.
End Date/Time: The date/time at which to stop displaying comments. This will be entered as the default end of the search date range.
Comment Start Time: The start of the time range for which a comment applies. Users will still be able to search for comments outside this time (according to the start and end date/time fields), but they will not be able to enter comments that start before this time.
Comment End Time: The end of the time range for which a comment applies. Users will still be able to search for comments outside this time (according to the start and end date/time fields), but they will not be able to enter comments that end after this time. To make the comment apply for a single day, make the Comment End Time the same as the Comment Start Time.
Entity: The entity, attribute value, tag, or calculation tag that all these comments apply to. If an Entity is specified here and a hierarchy is also specified in the next field, comments will be fetched for the Entity plus its child Entities in the hierarchy. 
Hierarchy: The hierarchy for which to get comments. This only applies when an Entity is specified above, and the Entity is part of this hierarchy. 
Context: The situation in which these comments apply. All comments entered in this box will have this context. If another comment button is placed on another page, with this same context and for the same entity, the comments for both will appear in both comment windows. If the entity is the same but the context is different, the comments will be shown independently.
Style: The style you want to apply to the Comments Button. If you are a Style Administrator, you can add a new Comments Button style.
Alignment: If the alignment in the selected style is not appropriate, you can override the alignment here by clicking one of the boxes.  

Advanced Mode

In Advanced mode, you have the option of switching between variable and text fields for many of the component's properties. Initially, they are set to variables, and have default values associated with them. For the date and time fields, you can supply a specific date/time. For the Entity field, you can supply a specific entity.

Related: Variables, Default Values


What is Context?

Context is the mechanism by which P2 Explorer exposes all comments related to a specific entity, and this is something that the page designer does when creating a page.

A comment’s context is some extra information that is added to the comment, and is used to associate comments with other comments made for the same entity and context.

As an entity can be used on lots of different pages, adding context to a comment means that you can see  all of the comments that have been made for that entity with that context, every time you open the comments box, no matter which page you are looking at.

All comments entered via a Comments Button component on a page have the context that is specified by the page designer. For example, if the comments on a page all have the context of “Report”, Explorer can apply filtering to all the comments in the system to only show comments for that entity with the "Report" context. 

Taking this a step further, a page designer can use the same context for the same entity on a completely different page. When a comment is applied to that entity, users will see all comments for that entity and context (e.g. Report), even though they are displayed on different pages.

We will explore context in more detail in Part 2 of the tutorial below.

 SEE IT IN ACTION! Watch this video to see how comments with context work on a page.


Start Time and End Time

The Comments Button allows the page designer to specify two types of time ranges for the user:

  • A time range for the search
  • A time range for entering comments

Search Time Range

The Start Date/Time and End Time settings determine the dates displayed for Search times in the comments window. 

Users can change these times to search for comments made at different times.

When these times are changed, comments will appear in the window if the comment time or time range falls completely or partially within the search time range.

Comment Time Range

When users enter comments, the start and end time of the comment is determined by the Comment Start Time and Comment End Time settings. 

All comments entered will have these comment times, and users cannot use the search times in the comments window to change this.

BEST PRACTICE

To avoid confusion, we recommend that page designers clearly indicate the comment times on a page. One way of doing this is to use a time picker that drives a variable for the Comment Start Time and Comment End Time settings.

 


Tutorial: Adding Comments Buttons for a Schematic Page

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

This tutorial in is 3 parts, and we will create 2 pages. In part 1, we’ll add some Comments Buttons to an image of a well head. In part 2, we'll create another page to show how the context allows the comments to appear on different displays in P2 Explorer, and in Part 3 we'll explore rolling up comments within a hierarchy. At the end of the tutorial, your pages should look like this:

Page 1:
Page 2:

Let’s go through this process, step-by-step.

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.


Part 1. Displaying Comments

In this part, we’ll create a simple schematic page, and add an attribute value and some Comments Buttons to it. 

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.

Related: Precision Layout tutorial

Note: We need to spend a bit of time setting up so you can see the comments in context.

 

Step 2. Add a Background Image

A background image is often used in schematic-style pages, and we use the Image component to do this. Drag the Image component onto the canvas, and resize it so that it fits the page.

Configure the image as follows:

Display Center  
Default Image GasLift Click the  ellipsis button to add the image from the image gallery. If the image is not in your image gallery, you can enter the following URL: 
https://e4helpcenter.petroleumplace.com/help/Images/gaslift.png or change it to one that is available at your site.
Position in Precision Layout X: 0
Y: 0
Width: 805
Height: 568
Tip: Manually adjusting the size and location of the line using the drag handles can get a bit tricky, and it's often easier to use the arrow keys and move the other components on the page so they are correctly lined up with the line, rather than the other way around. 

Related: Image tutorial

 

Step 3. Add an Attribute to the Page

In this step, we will drag and drop an attribute value onto the canvas, and position it near the diagram. This will become a data label.

  1. Open the Hierarchy Navigator.
  2. Search for the entity: Archer.
  3. Archer will be revealed in the hierarchy, click on it.
  4. Open the attributes panel.
  5. Drag the THP Actual attribute onto the canvas.

Click on the attribute value, and in the Data Label component editor on the right, ensure the following configuration:

  • Decimals: 0
  • Units Location: Suffix

Related: Data Label tutorial, Data Selector 

 

Step 4. Add the Comments Buttons

Close the Hierarchy Navigator and drag and drop 3 Comments Button components onto the canvas, positioning them near the Data Label on the diagram. The Comments Button is in the Display Display group icon group.

Keep the default values for the first 4 fields, and configure the rest of the fields as follows.

Note: The startTime and endTime variables are specified on the page's Default Values. You may change these if you wish.

  Button 1 Button 2 Button 3
Entity Archer[Oil Producing Well]:THP!Actual Archer[Oil Producing Well]:THP!Actual Archer[Oil Producing Well]:THP!Actual
Comment Context  THP1  THP2  

These configurations allow you to add comments for the THP Actual attribute value for the Archer well. They will also be used to show you how comments work with context, which we will investigate further in the rest of this tutorial.

 

Step 5. Add Some Comments

 

Now we're going to add some comments against the THP, for each of the buttons, so we can see how it works.

  • Click the Finish and Open livemode button on the Studio toolbar to save your page (with the name Comments Button Tutorial Page 1) and open it in display mode.
  • Click the first Comments Button (the one with context THP1).
  • Type a comment in the comment box and press Enter. Remember this comment because we will refer to it later in Step 8.
    • Notice that the comments button now turns black - this indicates that there are comments for this attribute.
    • Notice that the date for the comment is different to that in the search range. This is because the Comment Start Time and Comment End Time are different to the search range dates. When the Comment Start Time is the same as the Comment End Time, all comments will be entered for that point in time.
  • Enter comments for the other Comments Buttons, so we have some comments for later. Try some different date ranges and observe what happens.

Part 2. Adding Context

In this part, we'll create another page to show how the context allows the comments to appear on different pages in P2 Explorer.

Step 6. Create a New Page with Text Labels

Click the New Page button on the Home tab of the ribbon. Choose the Grid layout, and create 3 columns and 5 rows. We will add 3 Text Labels to help us remember how the Comments Buttons (which we will add in the next step) have been configured.   

  • Drag a Text Label to each cell in the first row.
  • Configure the content for the Text Labels as follows:
    • 1st column: THP1 for Archer[Oil Producing Well]:THP!Actual
    • 2nd column: THP2 for Archer[Oil Producing Well]:THP!Actual
    • 3rd column: No Context for Archer[Oil Producing Well]:THP!Actual

Related: Text Label tutorial

 

Step 7. Add Comments Buttons

  • Drag a Comments Button to each cell in the second row.
  • Configure the Comments Buttons as follows:
  THP1 THP2 No Context
Entity Archer[Oil Producing Well]:THP!Actual Archer[Oil Producing Well]:THP!Actual Archer[Oil Producing Well]:THP!Actual
Comment Context  THP1  THP2  

 

Step 8. Review the results

  • Click the Finish and Open livemode button on the Studio toolbar to save your page (with the name Comments Button Tutorial Page 2) and open it in display mode.
  • Click the THP1 Comments Button. You should see the first comment that you entered in Step 5.
  • Click the THP2 Comments Button. You should NOT see the first comment that you entered in Step 5, despite the entity being the same. This is because the context is different.
  • Click the No Context Comments Button. You should see the first comment that you entered in Step 5, and any other comments for Archer[Oil Producing Well]:THP!Actual that you entered in Step 5, regardless of context.
  • Try changing up the configuration and adding more comments, to get a feel for how context works.

Part 3. Hierarchy Roll-up

In this part, we'll explore how to roll up comments within a hierarchy. We will roll up comments for attributes of an Entity, and also roll up all Entities to a higher level in the hierarchy. Remember that hierarchical comments only apply to Entities within a hierarchy, and their attributes. Tags and calculation tags cannot be directly added to a hierarchy.

Step 9. Add Another Attribute

Open the page Comments Button Tutorial Page 1 in Studio. We will add another attribute to this page, as we did back in Step 3.

  1. Open the Hierarchy Navigator.
  2. Search for the entity: Brumby.
  3. Brumby will be revealed in the hierarchy, click on it.
  4. Open the attributes panel.
  5. Drag the THT Actual attribute onto the canvas, and position it below the THP attribute we added earlier.

Click on the attribute value, and in the Data Label component editor on the right, ensure the following configuration:

  • Decimals: 0
  • Units Location: Suffix

 

Step 10. Add Another Comments Button

Close the Hierarchy Navigator and drag and drop another Comments Button component onto the canvas, positioning it near the THT Data Label on the diagram. 

Keep the default values for the first 4 fields, and configure the rest of the fields as follows.

Entity Brumby[Oil Producing Well]:THT!Actual
Comment Context  THT

This configuration allows you to add comments for the THT Actual attribute value for the Brumby well. This will be used to show you how comments work with a hierarchy, which we will investigate in the rest of this tutorial.

 

Step 11. Add Text Labels

Open the Comments Button Tutorial Page 2 in Studio. We will add more text labels to this page, as we did back in step 6. 

  • Drag a Text Label to each cell in the 4th row.
  • Configure the content for the Text Labels as follows:
    • 1st column: Archer - Comments for attributes of Archer, rolled up to the entity
    • 2nd column: Queensland - All comments for all child entities of Queensland
    • 3rd column: Queensland - Comments that have context of THP1, for all child entities of Queensland

Step 12. Add Comments Buttons

  • Drag a Comments Button to each cell in the 5th row.
  • Configure the Comments Buttons as follows:
  Archer Queensland 1 Queensland 2
Entity Archer Queensland Queensland
Hierarchy P2 Corporate P2 Corporate P2 Corporate
Comment Context     THP1 

Step 13. Review the results

  • Click the Finish and Open livemode button on the Studio toolbar to open the page in display mode.
  • Click the Archer Comments Button. You should see comments for Archer as well as comments for any of Archer's attributes.
  • Click the Queensland 1 Comments Button. You should see comments for both Brumby and Archer, and any of their attributes, as well as any other Entities in the Queensland hierarchy.
  • Click the Queensland 2 Comments Button. You should only see comments for Entities in the Queensland hierarchy, that have a context of THP1.
  • Try adding more comments on both pages and see how these are reflected Page 2.

Here are some examples of the comments that could have been entered:

Comments for attributes of Archer, rolled up to the entity All comments for all child Entities of Queensland Comments that have context of THP1, for all child Entities of Queensland

Step 14. All done!  

Congratulations! You now have two pages with labels and Comments Buttons. You can enter comments against the Entities and attributes that they have been configured for. You can also view the comments made against the Entities on another page. Try changing the configuration, and see what happens when you change the Entity names or contexts.


Release History

  • Comments Button 4.5.0 (this release)
    • Removed the 'Add' button from the comments window
    • Start and end times now only apply to searches within the comments window
    • Configure start and end times for comments separately from search times
    • Configure comments for an Entity rolled up by hierarchy, and also comments for attributes, rolled up to the Entity
  • Comments Button 4.4.0
  • Comments Button 4.3.2

Leave a Reply

Your email address will not be published. Required fields are marked *