Linking to a Page

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

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

  • Sharing the page through the P2 Explorer framework
  • Manually entering the URL - this is suitable for other applications that want to link to P2 Explorer pages

Security considerations

  • When you share a page, 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 page 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 Trend


Option 1. Sharing a link through Explorer

To create a page link using Explorer, open the page in display mode, then click the Share Link shareicon button on the Page ribbon tab. This allows you to share the current state of the page (i.e. with the current selected options such as entity, sample interval, etc).

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

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

How the link is constructed

When a page is saved, it is assigned a unique number, called a GUID, that identifies the page. The GUID is represented with a long sequence of letters and numbers. E.g. /Guid/1fb11b18-c10a-48b4-8a82-224eef769280

The number after the GUID (e.g. /147) represents the current state of the page, which is saved in the database with an incrementing ID every time this dialog box is opened. If you remove the state ID from the URL, the page will open with the default variable values instead of the current variable values.

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

If you select the Frameless URL check box, the parameter ?frameless is automatically appended to the URL. The ?frameless parameter causes the page 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 page within the Explorer framework (so with the ribbon and headers).

Note: In earlier versions of Explorer, the standard format of a page URL was:
[Explorer URL]/Workspaces/[workspace name]/Pages/[page name]/[state]
This format has been retained for backward compatibility, but should not used when sharing a new page link.

 


Option 2. Manual link via URL

You can choose to share a page via a URL, which uses a list of variables to specify the value of the variables on the page. This allows you to link to a page with different default variables set, such as startTime, endTime, selectedEntity, etc. 

Related: Variables

How the URL is constructed

The standard format of the page URL is as follows:

[Explorer URL]/Pages/Guid/[guid]?[variable list]

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

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

You should obtain the GUID by clicking the Share Link button on the ribbon. Remember to remove the state ID from the link, otherwise your variables will clash.

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/Pages/88254609-b0b5-407e-8b1d-25b759f7790c?
startTime=2017-11-01T00:00:00&endTime=2017-12-01T00:00:00&selectedEntities=Archer

If you want the page to be frameless, append &frameless after the list of variables.

Example:

https://perauthor01.petroleumplace.com/P2.Explorer/Pages/88254609-b0b5-407e-8b1d-25b759f7790c?
startTime=2017-11-01T00:00:00&endTime=2017-12-01T00:00:00&selectedEntities=Archer&frameless

 


Variable Parameters

This table lists the available variable parameters and how to use them. Note that page variables may be changed by the page designer, or new variables may be added, so you should refer to the actual variables configured on the page.

Note: The URL parameters are case-sensitive. 

Variable Format/Options
startTime

Format: UTC or string. For a full list of string formats, see sugarjs.com/dates or sugarjs.com/date_formats.

Example (UTC): startTime=2014-11-01T00:00:00
Example (String): startTime=now

This is a default variable used in many components.

endTime

Format: UTC or string. For a full list of string formats, see sugarjs.com/dates or sugarjs.com/date_formats.

Example (UTC): endTime=2014-12-01T00:00:00
Example (String): endTime=last month

This is a default variable used in many components.

duration

Format: String

Example: duration=1 hour

This is a default variable for the Duration Picker component.

Options are: 

  • 5 minutes
  • 10 minutes
  • 30 minutes
  • 1 hour
  • 4 hour
  • 8 hour
  • 12 hours
  • 24 hours
  • 3 days
  • 5 days
  • 1 week
  • 2 weeks
  • 4 weeks
  • 1 month
  • 2 months
  • 3 months
  • 6 months
  • 9 months
  • 1 year
  • 2 years

isNow

Sets the end time to the current time.

Options: true, false

Example: isNow=true

This is a default variable for the Current Date/Time Toggle component.

pageSampleMethod

Options are: Average, LinearInterpolate, LastKnownValue, Raw

Example: pageSampleMethod=LinearInterpolate

This is available as a default variable for all pages, but only applies to time series data and is usually specified in the Data Selector.

pageSampleInterval

Format: Number of seconds

Example: sampleInterval=3600

This is available as a default variable for all pages, but only applies to time series data and is usually specified in the Data Selector.

Note: The number of seconds must correspond to one of the following intervals: 

Seconds Corresponds to this Sample Interval
1 1 second
5 5 seconds
10 10 seconds
30 30 seconds
60 1 minute
300 5 minutes
600 10 minutes
1800 30 minutes
3600 1 hour
21600 6 hours
43200 12 hours
86400 1 day
604800 1 week
1209600 2 weeks
2419200 4 weeks

confidenceThreshold

The confidence level below which P2 Explorer filters the incoming data.

This is available as a default variable for all pages, but only applies to time series data.

Format: Number between 0-100.

Example: confidenceThreshold=80

selectedHierarchy

Format: The name of a hierarchy in P2 Server

Example: selectedHierarchy=P2 Corporate

This is a default variable for the following components: Breadcrumb, Entity Selector, Hierarchy, Hierarchy Picker.

selectedEntity

Format: The display name of an entity in P2 Server

Example: selectedEntity=Archer

This is a default variable for the following components: Breadcrumb, CommentsComments Button, Entity SelectorHierarchy.

selectedEntities

Format: Comma separated list of entity names

Example: selectedEntities=Archer,Beardy

This is a default variable for the following components: Entity Selector, Hierarchy.

selectedOption

Format: Name of the option

Example: selectedOption=High

This is a default variable for the following components: Combo BoxOption Links, Selection List.

selectedOptions

Format: Comma separated list of options

Example: selectedOptions=Today, Yesterday

This is a default variable for the Selection List component.

pageNumber

The number that is published when the user clicks through the page control. This is effectively the page of data that the user is viewing. This variable applies to paging-enabled datasets.

Format: A number (integer)

Example: pageNumber=2

This is a default variable for the Paging Control component.

pageSize

The number of rows of data to display in the table. This variable applies to paging-enabled datasets.

Format: A number (integer)

Example: pageSize=10

This is a default variable for the Paging Control component.

totalRecordCount

The total number of records in the dataset, rounded up. This variable applies to paging-enabled datasets.

Format: A number (integer)

Example: totalRecordCount=500

This is a default variable for the Paging Control component.

 


Release History

  • Linking to a Page 4.5.4 (this release)
    • Duration format has changed from number to string
  • Linking to a Page 4.5.2
    • The Frameless URL check box is no longer selected by default, in the Share Page dialog box.
  • Linking to a Page 4.3.1

 

Comments are closed