Difference between revisions of "HTML Presentation Object: Redirect to URL"

From Mea Wiki
Jump to navigation Jump to search
m
(Emphasis)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Follow these steps to create a QPR UI view, which redirects user to another webpage, for example to QPR Suite Portal. This page can be used if QPR UI is used just for authenticating user.  
+
Follow the steps in this page to create a QPR UI view, which redirects user to another webpage when opened, for example to QPR Suite Portal. This QPR UI view can be used if QPR UI is used just for authenticating user.
 +
 
 +
# Create a new view, add a descriptive name, and set an identifier for the view as '''redirectview'''.
 +
# Add a context variable named "'''redirect'''" with value "'''true'''" and behavior "'''Default value'''".
 +
# Add a panel and an HTML presentation object to the view. Use the below defined HTML code, which following modifications:
 +
#* Replace the '''redirectToUrl<#uniqueId>''' variable value with your redirect url.
 +
#* You may also remove ''' + "&xsession=<#expression value="info(\"sessionId\")">"''' if the session id doesn't need to be added to the redirect url.
  
# Create a view, and set an identifier for the view as '''redirectview'''.
 
# Add a panel and an HTML presentation object. Use the following HTML code:<br />
 
 
<pre>
 
<pre>
 
<div id="message<#uniqueId>"></div>
 
<div id="message<#uniqueId>"></div>
 
<script>
 
<script>
 
   var redirectValue<#uniqueId> = "<#redirect>";
 
   var redirectValue<#uniqueId> = "<#redirect>";
   var redirectToUrl<#uniqueId> = "https://demo.qpr.com/QPR2016-1/Portal/QPR.Isapi.dll?PGPLUGIN&*xlink&VTN=flowchart&SID=iOC0O7afk7waLIzws-Xa4G88sWpEALHGk8K060CVuNN&PMAIN=processes&PSUB=PGPLUGIN_processmaps&PPRM=MODELID%3D1684749419%3F3_0_1684749419_0";
+
   var redirectToUrl<#uniqueId> = "https://demo.qpr.com/QPR2017-1/Portal/QPR.Isapi.dll?PGPLUGIN&*xlink&VTN=flowchart&SID=iOC0O7afk7waLIzws-Xa4G88sWpEALHGk8K060CVuNN&PMAIN=processes&PSUB=PGPLUGIN_processmaps&PPRM=MODELID%3D1684749419%3F3_0_1684749419_0";
 
   if (redirectValue<#uniqueId>.toLowerCase() == "true") {
 
   if (redirectValue<#uniqueId>.toLowerCase() == "true") {
 
     window.location.replace(redirectToUrl<#uniqueId> + "&xsession=<#expression value="info(\"sessionId\")">");
 
     window.location.replace(redirectToUrl<#uniqueId> + "&xsession=<#expression value="info(\"sessionId\")">");
Line 15: Line 19:
 
</script>
 
</script>
 
</pre>
 
</pre>
# In the previous code, replace the '''redirectToUrl<#uniqueId>''' variable with your redirect url. You may also remove ''' + "&xsession=<#expression value="info(\"sessionId\")">"''' if the session id doesn't need to be added to the redirect url.
 
 
# Optionally, change the layout of the view so that the view looks as a white page to users: Change the background color to white, remove panel border, hide panel fullscreen icon and hide panel header.
 
# Optionally, change the layout of the view so that the view looks as a white page to users: Change the background color to white, remove panel border, hide panel fullscreen icon and hide panel header.
# Use the following url: '''<nowiki>http://HOSTNAME:8080/ui/#/dashboard?sys:dashboardIdentifier=redirectview&redirect=true&sys:hideViewHeader=true</nowiki>''', where HOSTNAME is replaced by your hostname. Note that the defined identifier is used in the url. Note also the sys:hideViewHeader parameter which hides the QPR UI view header.
+
# Use the following url to point to the created QPR UI view: '''<nowiki>http://HOSTNAME:8080/ui/#/dashboard?sys:dashboardIdentifier=redirectview&redirect=true&sys:hideViewHeader=true</nowiki>''', where HOSTNAME is replaced by your hostname. Note that the previously defined identifier is used in the url. Note also the sys:hideViewHeader parameter which hides the QPR UI view header.
# When the previous url is opened, credentials are first asked. After that the redirect url should automatically open.
+
# When the previous url is opened, user credentials for QPR UI is first asked. After login, the configured redirect url should automatically open without user seeing QPR UI.
 
[[Category: QPR UI]]
 
[[Category: QPR UI]]

Latest revision as of 10:52, 22 March 2019

Follow the steps in this page to create a QPR UI view, which redirects user to another webpage when opened, for example to QPR Suite Portal. This QPR UI view can be used if QPR UI is used just for authenticating user.

  1. Create a new view, add a descriptive name, and set an identifier for the view as redirectview.
  2. Add a context variable named "redirect" with value "true" and behavior "Default value".
  3. Add a panel and an HTML presentation object to the view. Use the below defined HTML code, which following modifications:
    • Replace the redirectToUrl<#uniqueId> variable value with your redirect url.
    • You may also remove + "&xsession=<#expression value="info(\"sessionId\")">" if the session id doesn't need to be added to the redirect url.
<div id="message<#uniqueId>"></div>
<script>
  var redirectValue<#uniqueId> = "<#redirect>";
  var redirectToUrl<#uniqueId> = "https://demo.qpr.com/QPR2017-1/Portal/QPR.Isapi.dll?PGPLUGIN&*xlink&VTN=flowchart&SID=iOC0O7afk7waLIzws-Xa4G88sWpEALHGk8K060CVuNN&PMAIN=processes&PSUB=PGPLUGIN_processmaps&PPRM=MODELID%3D1684749419%3F3_0_1684749419_0";
  if (redirectValue<#uniqueId>.toLowerCase() == "true") {
    window.location.replace(redirectToUrl<#uniqueId> + "&xsession=<#expression value="info(\"sessionId\")">");
  } else {
    $("#message<#uniqueId>").html("To enable redirection, define context variable <b>redirect</b> to be <b>true</b>. Current value is <b>" + $("<div>").text(redirectValue<#uniqueId>).html() + "</b>. Redirect url is " + redirectToUrl<#uniqueId> + ".");
  }
</script>
  1. Optionally, change the layout of the view so that the view looks as a white page to users: Change the background color to white, remove panel border, hide panel fullscreen icon and hide panel header.
  2. Use the following url to point to the created QPR UI view: http://HOSTNAME:8080/ui/#/dashboard?sys:dashboardIdentifier=redirectview&redirect=true&sys:hideViewHeader=true, where HOSTNAME is replaced by your hostname. Note that the previously defined identifier is used in the url. Note also the sys:hideViewHeader parameter which hides the QPR UI view header.
  3. When the previous url is opened, user credentials for QPR UI is first asked. After login, the configured redirect url should automatically open without user seeing QPR UI.