Linking to a Trend (4.6)

This article applies to versions 4.6 of P2 Explorer. For more, see Release History. For the latest, see Linking to a Trend.

P2 Explorer allows you to link to a trend via a URL. There are 2 ways of doing this:

  • Sharing a link to a trend through the P2 Explorer framework. You can link to a saved trend or a blank trend.
  • Creating a dynamic trend by manually entering a URL, and adding parameters to a URL.

Security considerations

  • When you share a saved trend, it will only be visible to people who have permission to view the workspace in which it is saved. The exception here is your Private Workspace; users can view a trend shared from your private workspace, while not having access to the workspace itself.
  • People who do not have permission to view the included tags or attributes will not be able to view data for those tags or attributes.

Related: Linking to a Page

Option 1. Sharing a link through Explorer

To create a trend link using Explorer, open the trend and then click the Share Link shareicon button on the Trend ribbon tab. This allows you to share the current state of a trend (i.e. with the current selected options such as time range, sample interval, tags, calculations, etc.).

When a user clicks a link shared this way, the trend will either open in a tab inside the P2 Explorer framework, or as a separate tab in the browser.

When the Share Trend dialog box opens, copy and paste the URL into an email, or wherever you intend to use it.

Note: People who do not have permission to view the included tags or attributes will not be able to view data for those tags or attributes.

How the link is constructed

Saved trends are constructed differently to blank trends.

Saved Trends

When a trend is saved, it is assigned a unique number (called a GUID) that identifies the trend. The GUID is represented with a long sequence of letters and numbers. E.g. /Guid/41bed2a6-b21d-4d0e-a32c-8ecae6940d2b

The number after the GUID (e.g. /152) represents the current state of the trend, which is saved in the database with an incrementing ID every time this dialog box is opened. 

Private Trends

A trend that has been saved to My Workspace is assigned a Link Key that identifies the trend, and a State ID. The Link Key is represented by a long sequence of letters and numbers that identifies the trend. The State ID represents the current state of the trend, which is saved in the database with an incrementing ID every time this dialog box is opened..

Blank Trends

Blank trends do not have a GUID; rather they are identified by the state of the trend's variables, represented by the number after the trend (e.g. /8). This number is saved in the database with an incrementing ID every time this dialog box is opened. 

Framed or Frameless URL

In the Share Trend dialog box, the Frameless URL check box is not selected.

If you select the Frameless URL check box, the frameless parameter is automatically appended to the URL. The frameless parameter causes the trend to open outside of the P2 Explorer framework, so that it displays without the header or ribbon.

When the check box is cleared, the frameless parameter is not included, and the resulting URL opens the trend within the Explorer framework (so with the ribbon and headers).


Option 2. Dynamic trend via URL

You can choose to share a dynamic trend via a URL, which uses a list of variables to specify the tags, as well as some of the trend controls. This allows you to link to a trend with certain options already selected, such as tags, time range, sample interval, etc.

How the URL is constructed

The URL can be for a saved trend (where there is a GUID) or for a new, unsaved trend (with no GUID), called "Blank Trend".

Blank Trend URL

The standard format of a blank trend URL is as follows:

[Explorer URL]/trend[?variable list]

If you copy the URL for a particular unsaved trend (Blank Trend) from the Share Link, the state id is included:

[Explorer URL]/trend/[state][?variable list]

Saved Trend URL

The standard format of a saved trend URL is as follows:

[Explorer URL]/Trends/Guid/[GUID]/[state][?variable list]

You can remove the state from the URL, so that it is strictly the saved version of the trend. This is the format it will now have:

[Explorer URL]/Trends/Guid/[GUID][?variable list]

Private Trend URL

The syntax is slightly different for a trend that has been shared from a private workspace (My Workspace):

[Explorer URL]/trends/trends/shared?linkKey=[link key]&stateId=[state]

Adding Variable Parameters

To use a variable in the URL, add a question mark ? followed by the list of variables in the format variable name=variable value. Separate multiple variables with &

Example:

https://perauthor01.petroleumplace.com/P2.Explorer/trend?startTime=2014-11-01T00:00:00&endTime=2014-12-01T00:00:00

Frameless

If you want the trend to be frameless (with no header or ribbon), append &frameless after the list of variables to the URL:

Example:https://perauthor01.petroleumplace.com/P2.Explorer/trend?startTime=2014-11-01T00:00:00&endTime=2014-12-01T00:00:00&frameless

 


Variable Parameters

This table lists the available variables and how to use them. The variables correspond with various controls available on the trend.

Important: The variables you use affect the time range of the chart, data collection method and interval, Y Scale Type, and number of allowable hairlines, as well as trace items such as tags. It is important that you consider the amount of data that your trend will fetch, and how this affects Explorer's performance. For example, do not request three months of data at a five second sample interval. Read more about how P2 Server fetches the data.

 

Note: The URL parameters are case-sensitive. 

Variable Format/Options
endTime

Format: ISO8601 date string.

Example (UTC): endTime=2014-12-01T00:00:00Z
Example (Local Time): endTime=2014-12-01T00:00:00

startTime

Format: ISO8601 date string.

Example (UTC): startTime=2014-12-01T00:00:00Z
Example (Local Time): startTime=2014-12-01T00:00:00

sampleMethod

Options are: Average, LinearInterpolate, LastKnownValue, Raw, AdaptiveRaw

Example: sampleMethod=LinearInterpolate

Related control:

sampleInterval

Format: Number of seconds

Note: The number of seconds must correspond to one of the options available in the related trend control.

Options are: 

Seconds Corresponds to this Sample Interval
1 1 second
5 5 seconds
10 10 seconds
20 20 seconds
60 1 minute
120 2 minutes
300 5 minutes
600 10 minutes
1200 20 minutes
1800 30 minutes
3600 1 hour
28800 8 hours
43200 12 hours
86400 1 day
604800 7 days
1209600 14 days
2592000 1 month
7862400 3 months
15811200 6 months

Example: sampleInterval=3600

Related control:

scaleType

Describes the way the points are distributed in the y-axis direction.

Options are: Linear, Log

Example: scaleType=Linear

Related control:

interpolationType

Specifies the line drawing algorithm to use to join the data points up.

Options are: Linear, Log

Example: interpolationType=Linear

Related control: There is no specific control that relates to this parameter.

hairlineMode

Specify how many hairlines should be allowed.

Options are: None, Single, Dual, Multiple

Example: hairlineMode=Single

Related control (ribbon):

isNow

Sets the end time time of the traces to the current time.

Options are: True, False

Example: isNow=True

Related control:

duration

Sets the duration of the trace. In order for this to work correctly, you also need to sepcify the start time and end time of the trace; the difference between start time and end time should equal the duration. Include the isNow=false parameter, unless you want the Now check box selected.

Options are: 5 minutes, 10 minutes, 30 minutes, 1 hour, 4 hours, 8 hours, 12 hours, 1 day, 3 days, 5 days, 1 week, 4 weeks, 1 month, 3 months, 6 months, 9 months, 1 year, 2 years

Example: duration=1 week

Full example showing start time and end time as well: https://perauthor01.petroleumplace.com/P2.Explorer/trend/27606?duration=1 week&startTime=2 weeks ago&endTime=2014-12-01T00:00:00

To ensure that the start time and end time are applied, you also need to specify that the isNow paramter is false:

Try the moderated example: https://perauthor01.petroleumplace.com/P2.Explorer/trend/27606?duration=1 week&startTime=2 weeks ago&endTime=2014-12-01T00:00:00&isNow=false

Related controls:

showControls

Shows or hides the trend controls:

Options are: True, False

Example: showControls=True

Related control:

showRangeSelector

Shows or hides the trend's range selector:

Options are: True, False

Example: showRangeSelector=True

Related control:

 

showTraceTable

Shows or hides the trend's trace table.

Options are: True, False

Example: showTraceTable=True

Related control:

tags

The comma separated list of tags to show in the trace. Each tag name must be enclosed in curly brackets {}.

Format: Tag name
Example (single tag): tags={PIPERPV01.001}

To specify a list of tags, use tags=tag1,tag2 etc
Example (multiple tags): tags={PIPERPV01.001},{PIPERPV02.001}

selectedEntities

The comma separated list of entities to show in the trace.

Note: The URL parameters selectedEntities, templates, attributes, and attributeValues are all designed to be used together. These parameters do not work when used in isolation, although the URL will still be valid. When using these parameters, selectedEntities and attributes are both required.

Format: Entity name
Example (single entity): selectedEntities=Anstey

To specify a list of entities, use selectedEntities=entity1,entity2 etc
Example (multiple entities): selectedEntities=Anstey,Archer

templates

The comma separated list of templates to show in the trace.

Note: The URL parameters selectedEntities, templates, attributes, and attributeValues are all designed to be used together. These parameters do not work when used in isolation, although the URL will still be valid. If template is omitted, the entity's primary template will be used.

Format: Template name
Example (single template): templates=Region

To specify a list of templates, use templates=template1,template2 etc
Example (multiple templates): templates=Region,Area

attributes

The comma separated list of attributes to show in the trace.

Note: The URL parameters selectedEntities, templates, attributes, and attributeValues are all designed to be used together. These parameters do not work when used in isolation, although the URL will still be valid. When using these parameters, selectedEntities and attributes are both required.

Format: Attribute name
Example (single attribute): attributes=Choke

To specify a list of attributes, use attributes=attribute1,attribute2 etc
Example (multiple attributes): attributes=Choke,Temperature

attributeValues

The comma separated list of attribute values to show in the trace.

Note: The URL parameters selectedEntities, templates, attributes, and attributeValues are all designed to be used together. These parameters do not work when used in isolation, although the URL will still be valid. If attributeValue is omitted, the default value of the attribute will be used.

Format: Attribute value name
Example (single attribute value): attributeValues=Actual

To specify a list of attribute values, use attributeValues=attributevalue1,attributevalue2 etc
Example (multiple attribute values): attributeValues=Actual,Planned

 


Release History

  • Linking to a Trend 4.6 (this release)
    • Updated screenshots to reflect changes in the Trend ribbon and changes to the Trace Table.
  • Linking to a Trend 4.5.5
    • Updated screenshots to reflect changes in the Trend ribbon.
    • Updated with Adaptive Raw sample method, introduced in version 4.5.4.
  • Linking to a Trend 4.5.2
    • The Frameless URL check box is no longer selected by default, in the Share Trend dialog box.
    • The refreshRate variable parameter is no longer available. Trends that range to Now are refreshed at the chosen Sample Interval, with the fastest refresh rate being 30 seconds.
    • Some of the variable parameter options for sampleInterval and duration have changed, to match the various options available in the corresponding trend controls.
    • New link construction for sharing private trends, introduced in version 4.5.0.
  • Linking to a Trend 4.3.1

 

Comments are closed