Skip to content

Commit

Permalink
SAK-28145
Browse files Browse the repository at this point in the history
Teach the registration process to handle inline and not inline scenarios.



git-svn-id: https://source.sakaiproject.org/svn/basiclti/trunk@315763 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
csev committed Nov 30, 2014
1 parent b870f8f commit e816d85
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
7 changes: 6 additions & 1 deletion basiclti/basiclti-tool/src/bundle/ltitool.properties
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,9 @@ search.url=Search by URL
search.siteid=Search by Site ID
search.uses=Search by Usage
register.may.popup=The registration process may open a popup window. If it opens a popup window, when registration is complete, come back to this page and manually activate the deployment.
register.external.pre.launch=We will now launch an external web site in a new window to do the actual installation. When that process completes, come back to this window and either continue to the Activation process or go back to the deployment list.
register.external.post.launch=If the registration process was successful, your next step is to Activate the registration. If the registration process had a problem, you may need to restart the registration.
register.popup.text=Continue to registration web site
register.done=The external tool has completed its registration process. If the registration process was successful, your next step is to Activate the registration. If the registration process had a problem, you may need to restart the registration.
register.close=Close this window
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ public String buildDeployRegisterPanelContext(VelocityPortlet portlet, Context c
return "lti_error";
}

Long reg_state = foorm.getLongNull(deploy.get(LTIService.LTI_REG_STATE));
Long reg_state = foorm.getLongNull(deploy.get(LTIService.LTI_REG_STATE));
String reg_key = (String) deploy.get(LTIService.LTI_REG_KEY);
String reg_password = (String) deploy.get(LTIService.LTI_REG_PASSWORD);
String consumerkey = (String) deploy.get(LTIService.LTI_CONSUMERKEY);
Expand All @@ -751,7 +751,7 @@ public String buildDeployRegisterPanelContext(VelocityPortlet portlet, Context c
// Extract the reg_state to make it view only
String fieldInfo = foorm.getFormField(mappingForm, "reg_state");
fieldInfo = fieldInfo.replace(":hidden=true","");
String formStatus = ltiService.formOutput(deploy, fieldInfo);
String formStatus = ltiService.formOutput(deploy, fieldInfo);
context.put("formStatus", formStatus);

String formOutput = ltiService.formOutput(deploy, mappingForm);
Expand All @@ -760,11 +760,21 @@ public String buildDeployRegisterPanelContext(VelocityPortlet portlet, Context c
String registerURL = "/access/basiclti/site/~admin/deploy:" + key + "?placement=" + placement.getId();

context.put("registerURL",registerURL);
context.put("isInlineRequest",new Boolean(ToolUtils.isInlineRequest(data.getRequest())));
context.put("id",key);

state.removeAttribute(STATE_SUCCESS);
return "lti_deploy_register";
}

public String buildPostRegisterPanelContext(VelocityPortlet portlet, Context context,
RunData data, SessionState state)
{
context.put("tlang", rb);
context.put("includeLatestJQuery", PortalUtils.includeLatestJQuery("LTIAdminTool"));
return "lti_deploy_post_register";
}

public String buildActivatePanelContext(VelocityPortlet portlet, Context context,
RunData data, SessionState state)
{
Expand Down
11 changes: 11 additions & 0 deletions basiclti/basiclti-tool/src/webapp/vm/lti_deploy_post_register.vm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="portletBody">
#if ($messageSuccess)<div class="messageSuccess">$tlang.getString("gen.success") $validator.escapeHtml($messageSuccess)</div><div class="clear"></div>#end
#if ($alertMessage)<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div><div class="clear"></div>#end
<p>
$tlang.getString('register.done')
</p>
<p>
<a href="#" onclick="window.close();">
$tlang.getString('register.close')
</a>
</p>
14 changes: 12 additions & 2 deletions basiclti/basiclti-tool/src/webapp/vm/lti_deploy_register.vm
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@
<form action="#toolForm("")" method="post" name="customizeForm" >
$!formStatus
$formOutput
<p id="pre_launch">$tlang.getString('register.external.pre.launch')</p>
<p id="post_launch" style="display:none">$tlang.getString('register.external.post.launch')</p>
<p>
<a href="$registerURL" target="_blank" onclick="
document.getElementById('activate_button').style.display='inline';
document.getElementById('pre_launch').style.display='none';
document.getElementById('post_launch').style.display='inline';
">$tlang.getString('register.popup.text')</a>
</p>
<p class="act">
<input type="submit" accesskey ="r" class="active" name="$tlang.getString('gen.register')"
value="$tlang.getString('gen.register')" onclick="location = '$registerURL';return false;"/>
<input type="submit" accesskey ="x" id="activate_button" style="display: none"
name="$tlang.getString('gen.activate')" value="$tlang.getString('gen.activate')"
onclick="location = '$sakai_ActionURL.setPanel("Activate")&id=$id';return false;">
<input type="submit" accesskey ="x" name="$tlang.getString('gen.cancel')" value="$tlang.getString('gen.cancel')"
onclick="location = '$sakai_ActionURL.setPanel("DeploySystem")';return false;">
</p>
Expand Down

0 comments on commit e816d85

Please sign in to comment.