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

From Mea Wiki
Jump to navigation Jump to search
(Created page with "Use this HTML presentation object to create a QPR UI view, which redirects user to another webpage. This page can be used when QPR UI is used just to authenticate user. Foll...")
 
Line 2: Line 2:
  
 
Follow these steps:
 
Follow these steps:
# Create a view, add a panel, and add a HTML presentation object. Use the following HTML code:
+
# Create a view, add a panel, and add a HTML presentation object. Use the following HTML code:<br />
 
<pre>
 
<pre>
 
<div id="message<#uniqueId>"></div>
 
<div id="message<#uniqueId>"></div>
Line 15: Line 15:
 
</script>
 
</script>
 
</pre>
 
</pre>
 
+
# Set an identifier for the view as '''redirectview'''.
 
# Optionally change the layout of the view so that the view shows as empty. That's how the user doesn't see the QPR UI view during redirection. Change 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 shows as empty. That's how the user doesn't see the QPR UI view during redirection. Change background color to white, remove panel border, hide panel fullscreen icon and hide panel header.
# Use the following url: '''http://HOSTNAME:8080/ui/#/dashboard?sys:dashboardIdentifier=redirectview&redirect=true&sys:hideViewHeader=true''', where HOSTNAME is replaced by your hostname.
+
# 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.

Revision as of 15:41, 12 December 2017

Use this HTML presentation object to create a QPR UI view, which redirects user to another webpage. This page can be used when QPR UI is used just to authenticate user.

Follow these steps:

  1. Create a view, add a panel, and add a HTML presentation object. Use the following HTML code:
<div id="message<#uniqueId>"></div>
<script>
  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";
  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. Set an identifier for the view as redirectview.
  2. Optionally change the layout of the view so that the view shows as empty. That's how the user doesn't see the QPR UI view during redirection. Change background color to white, remove panel border, hide panel fullscreen icon and hide panel header.
  3. Use the following url: http://HOSTNAME:8080/ui/#/dashboard?sys:dashboardIdentifier=redirectview&redirect=true&sys:hideViewHeader=true, 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.