Perspective Subsystem Page FlowThis page discusses how perspective pages from perspective webapps outside rhq.ear will be embedded in the core GUI, and how the perspective webapp will notify the RHQ Server that a page flow is complete.
Extension Point URLs and Their TargetsExtension points typically have a URL associated with them. This URL could be either a link to some other core UI page, e.g.: /Dashboard.do
, a link to a page in a co-located perspective WAR, e.g.: /rhel-perspective/provision-server.xhtml , or a link to some arbitrary external page, which may or may not be a Java-based webapp, e.g.: http://foobar.com/do-something
The URL would usually (always?) displayed in a portion of the page, rather than taking over the entire page. The portion of the page that the URL would target would vary depending on the type of extension point, e.g.:
We may also allow certain extension points to take over the entire page, though I currently am in favor of always maintaining the menu bar for the sake of continuity. Embedding the Content of Extension Point URLsSo the obvious question is how do we embed the content of an arbitrary URL within some portion of a core GUI page? Based on my research so far, I think there are two options:
For an overview of these two tags and their differences, see: http://www.w3.org/TR/REC-html40/struct/objects.html#embedded-documents And for more details, see the following links:
It's still up in the air which one to use. Here are some potential advantages of each: Advantages of object
Advantages of iframe
Accessing the Embedded Page via JavaScriptWhichever element is used, some JavaScript/DOM trickery will be required to set the height correctly on the object or iframe element, so it doesn't always get rendered with its own vertical scrollbar. By default, this trickery is only permitted when the perspective URL is located on the RHQ Server (to prevent cross-site scripting attacks). However, this can be worked around by setting the document.domain property to the same value in both the outer and inner pages (see http://www.nczonline.net/blog/2009/09/15/iframes-onload-and-documentdomain/). Navigation Back to Core GUI From Embedded Perspective PageAfter the form submit button has been clicked within an embedded perspective page, we need a mechanism for the perspective to report the outcome back to the RHQ Server, and a way for the RHQ Server to redirect the GUI to a new page, whose URL would depend on the outcome reported by the perspective. This URL could be some page in the core GUI (e.g. /Dashboard.do) or it could be another perspective page (e.g. /rhel-perspective/provision-server-step2.xhtml) in the case of a multi-page perspective workflow (i.e. a wizard). These outcome-based page flows could be defined in the perspective descriptor, e.g.: <resourceTask name="restart-app-server" displayName="Restart this Apppliation Server" href="/jboss-perspective/restart-app-server.seam" target="body" category="Provision"> <!-- one or more Resource types that this task should be displayed for --> <resourceType plugin="JBossAS" name="JBossAS Server"/> <resourceType plugin="JBossAS5" name="JBossAS Server"/> <outcome name="success" redirectUrl="/rhq/resource/summary/overview.xhtml" target="fullPage"/> <outcome name="failure" redirectUrl="/jboss-perspective/restart-app-server.seam" target="body"/> </resourceTask> Then there would be a method provided by the PerspecticeManager remote API: void advancePageFlow(String perspectiveContextId, String outcome); whose impl would look something like: String redirectUrl = getRedirectUrl(outcome);
org.jboss.seam.faces.Redirect redirect = org.jboss.seam.faces.Redirect.instance();
redirect.setViewId(redirectUrl)
redirect.execute();
The outcome abstraction could also be removed, but this would have the disadvantage of the redirect URLs being hard-coded in the perspective WARs rather than being defined in the perspective descriptor. That is, there would be no outcome elements in the descriptor, and the remote API method would look like this instead: void advancePageFlow(String perspectiveContextId, String redirectUrl); |
