Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 402663

Summary: provide a delegated UI mechanism for Shell page plug-ins
Product: [ECD] Orion Reporter: Grant Gayed <grant_gayed>
Component: ClientAssignee: Grant Gayed <grant_gayed>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M1   
Hardware: PC   
OS: All   
Whiteboard:

Description Grant Gayed CLA 2013-03-07 10:25:55 EST

    
Comment 1 Grant Gayed CLA 2013-03-07 10:44:24 EST
A first implementation of this is released > 20130307, commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=fe2eb76796b90fd164fbdfb2bf0c12ce6d459bd6 .

It uses an identical approach to the orion.edit.command delegated UI, which is described in https://orion.eclipse.org/help/index.jsp?topic=%2Forg.eclipse.orion.doc.isv%2FWikiDoc%2FOrion%2FDocumentation%2FDeveloper_Guide%2FPlugging_into_the_editor%2Forion-edit-command.html&cp=0_0_6_1 .  A Shell command that needs a delegated UI should return an Orion Deferred as its result, and then some time later send a "progress" on that deferred whose object has the uriTemplate:/width:/height: values.  Example:

{the command}
callback: function(args) {
    var result = new orion.Deferred();
    var url = window.location.href;
    url = url.substring(0, url.lastIndexOf('/')); //$NON-NLS-0$
    setTimeout(function() {
        result.progress({uriTemplate: url + "/authenticationPrompter.html", width: "400px", height: "100px"});
    });
    return result;
}

{authenticationPrompter.html}
<head>
<script>
function doit() {
    var result = "Authenticated user: " + document.getElementById("username").value;
    window.parent.postMessage(JSON.stringify({pageService: "orion.page.delegatedUI", source: "login", result: result}), "*");
    return true;
}
</script>
</head>
<body>
User name:<input type="text" id="username"><br>
Password:<input type="password" id="password">
<button type="button" onclick="doit();" value="Submit">Submit</button>
</body>
Comment 2 Grant Gayed CLA 2013-04-05 16:00:18 EDT
Closing report as fixed, will log subsequent bugs for revisions to this as appropriate.