Customizing the Web Applications links
By default, Web Applications shows the following application links: Dashboards, Diagrams, Trends, Alarms, Reports, Settings. You can add custom links, hide/unhide links, re-order links, and delete links.
Default links:
Example customized links:
notice
inoperable database
Back up the database before executing SQL scripts.
Failure to follow these instructions can result in an inoperable database and loss of data.
To add a custom link:
- On the PME application server, find the
Add_PQPerf_To_Web.sql
script file in...\Power Monitoring Expert\diagnostic\PowerQuality\
- On the database server, open SQL Server Management Studio (SSMS).
- Open the
Add_PQPerf_To_Web.sql
script in SSMS.NOTE: You can also copy and paste the example script below into SSMS.
- Update the script settings, in the marked areas in the script, to meet your needs.
NOTE: The order value determines the order in which the links are arranged in the web page banner. The order numbers increase from left to right. The numbers for the default links are: Dashboards (10), Diagrams (20), Trends (30), Alarms (40), Reports (50). The location of the SETTINGS link is not controlled by the order value. It is always in the right most position.
- Execute the script on the ApplicationModules database.
TIP: You can execute this query repeatedly to change any of the settings for the custom link.
- Close SSMS.
- Reload Web Applications if it is open in a browser.
Example script to create a MY CUSTOM LINK link between the REPORTS and SETTINGS links in the Web Applications banner that opens a custom web page:
USE ApplicationModules
DECLARE @id NVARCHAR(255)
DECLARE @name NVARCHAR(255)
DECLARE @displayName NVARCHAR(255)
DECLARE @description NVARCHAR(255)
DECLARE @order NVARCHAR(100)
DECLARE @target NVARCHAR(400)
----------------------------------------------------------------------
-- Edit the following values to define your custom settings
----------------------------------------------------------------------
-- Custom application link (internal) name.
SET @id = 'MyCustomLink'
-- Custom application link description
SET @description = 'My custom link shows my custom content'
-- Display Name
set @displayName = 'My Custom Link'
-- Custom application link order. Less than 10 will bring new link to
-- first left position.
SET @order = 60
-- Target URL can be provided in single quote here,
-- e.g. 'https://www.mypage.com'
-- If on the same machine, should be the relative path.
-- e.g., '/myApp/index.html'
SET @target = 'https://www.mypage.com'
----------------------------------------------------------------------
-- DO NOT MODIFY CONTENT BELOW
----------------------------------------------------------------------
DECLARE @configurationValue NVARCHAR(MAX)
SET @configurationValue =
'<FrameworkApplication id="' + @id + '"'
+ ' displayName="' + @displayName + '"'
+ ' description="' + @description + '"'
+ ' resourceSet="ApplicationFrameworkResources"'
+ ' target="' + @target + '"'
+ ' privilege=""'
+ ' order="' + @order + '"'
+ ' enabled="true"'
+ ' xmlns="uri:application-modules/power/framework/application#" />'
EXECUTE [ApplicationModules].[Configuration].[WriteConfigurationValue]
'ApplicationFramework'
,'Applications'
,@id
,@description
,@configurationValue
,NULL
,0
To hide or unhide a link:
- On the database server, open SQL Server Management Studio (SSMS).
- Copy the following SQL script into a query window in SSMS:
SELECT *
FROM [ApplicationModules].[Configuration].[ConfigurationSettings]
WHERE ItemType ='ApplicationFramework' AND Item = 'Applications' - Execute the query on the ApplicationModules database. This returns the settings for the Web Applications links.
- Copy the content of the Value column for the link you want to hide or unhide, into a text editing tool such as Notepad. For example:
<FrameworkApplication id="MyCustomLink" displayName="My Custom Link" description="My custom link shows my custom content" resourceSet="ApplicationFrameworkResources" target="https://www.mypage.com" privilege="" order="60" enabled="true" xmlns="uri:application-modules/power/framework/application#" />
- Change the enabled property value to "false" in the text editor to hide a link, or to "true" if to unhide a link
- Copy the following SQL script into a query window in SSMS:
UPDATE [ApplicationModules].[Configuration].[ConfigurationSettings]
SET Value = '<Copy entire data from notepad with the modified enabled property here>'
WHERE [key]= '<Type the custom application link (internal) name here, in our example this is MyCustomLink>' - Update the query settings as described in the script above.
- Execute the script on the ApplicationModules database.
- (Optional) Repeat steps 4-8 to hide or unhide additional links.
- Close SSMS.
- Reload the Web Applications if they are open in a browser.
To re-order links:
- On the database server, open SQL Server Management Studio (SSMS).
- Copy the following SQL script into a query window in SSMS:
SELECT *
FROM [ApplicationModules].[Configuration].[ConfigurationSettings]
WHERE ItemType ='ApplicationFramework' AND Item = 'Applications' - Execute the query on the ApplicationModules database. This returns the settings for the Web Applications links.
- Copy the content of the Value column for the link you want to reorder, into a text editing tool such as Notepad. For example:
<FrameworkApplication id="MyCustomLink" displayName="My Custom Link" description="My custom link shows my custom content" resourceSet="ApplicationFrameworkResources" target="https://www.mypage.com" privilege="" order="60" enabled="true" xmlns="uri:application-modules/power/framework/application#" />
- Change the order property value to a new value in the text editor.
NOTE: The order value determines the order in which the links are arranged in the web page banner. The order numbers increase from left to right. The numbers for the default links are: Dashboards (10), Diagrams (20), Trends (30), Alarms (40), Reports (50). The location of the SETTINGS link is not controlled by the order value. It is always in the right most position.
- Copy the following SQL script into a query window in SSMS:
UPDATE [ApplicationModules].[Configuration].[ConfigurationSettings]
SET Value = '<Copy entire data from notepad with the modified order property here>'
WHERE [key]= '<Type the custom application link (internal) name here, in our example this is MyCustomLink>' - Update the query settings as described in the script above.
- Execute the script on the ApplicationModules database.
- (Optional) Repeat steps 4-8 to re-order additional links.
- Close SSMS.
- Reload the Web Applications if they are open in a browser.
To delete a link:
- On the database server, open SQL Server Management Studio (SSMS).
- Copy the following SQL script into a query window in SSMS:
DELETE FROM [ApplicationModules].[Configuration].[ConfigurationValue]
WHERE ConfigurationKeyId = (Select id from [ApplicationModules].[Configuration].[ConfigurationKey] where Name='<Type the custom application link (internal) name here, in our example this is MyCustomLink>')
DELETE FROM [ApplicationModules].[Configuration].[ConfigurationKey]
WHERE Name='<Type the custom application link (internal) name here, in our example this is MyCustomLink>' - Update the query settings as described in the script above.
- Execute the query on the ApplicationModules database. This deletes the Web Applications link.
- (Optional) Repeat steps 3-4 to delete additional links.
- Close SSMS.
- Reload the Web Applications if they are open in a browser.