Skip to content

Commit

Permalink
SAK-50165 Plus remove support for "Single Tool" (#12635)
Browse files Browse the repository at this point in the history
  • Loading branch information
csev authored Jun 10, 2024
1 parent 0f22d03 commit 6d94174
Show file tree
Hide file tree
Showing 30 changed files with 113 additions and 957 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ public interface LTIService extends LTISubstitutionsFilter {
"pl_contextlaunch:checkbox:label=bl_pl_contextlaunch:hidden=true",
"pl_privacy:checkbox:label=bl_pl_privacy:role=admin",
// SAK-49540 - Placements
"pl_placement:header:fields=pl_lessonsselection,pl_assessmentselection,pl_content_editor,pl_importitem,pl_coursenav,pl_fileitem",
"pl_placement:header:fields=pl_coursenav,pl_lessonsselection,pl_contenteditor,pl_assessmentselection,pl_importitem,pl_fileitem",
"pl_coursenav:checkbox:label=bl_pl_coursenav:role=admin",
"pl_lessonsselection:checkbox:label=bl_pl_lessonsselection",
"pl_assessmentselection:checkbox:label=bl_pl_assessmentselection",
"pl_contenteditor:checkbox:label=bl_pl_contenteditor",
"pl_assessmentselection:checkbox:label=bl_pl_assessmentselection",
"pl_importitem:checkbox:label=bl_pl_importitem:role=admin",
"pl_coursenav:checkbox:label=bl_pl_coursenav:role=admin",
"pl_fileitem:checkbox:label=bl_pl_fileitem:role=admin",
"newpage:radio:label=bl_newpage:choices=off,on,content",
"debug:radio:label=bl_debug:choices=off,on,content",
Expand Down
44 changes: 37 additions & 7 deletions basiclti/basiclti-tool/src/webapp/vm/lti_tool_insert.vm
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function checkRadioSettings() {
}

function checkCheckboxCombos() {
var launch = $d("#pl_launch").is(":checked");
var deeplink = $d("#pl_linkselection").is(":checked");
var importitem = $d("#pl_importitem").is(":checked");
var file = $d("#pl_fileitem").is(":checked");
Expand Down Expand Up @@ -209,11 +208,11 @@ function importLTI13Config() {
}
}

// TODO: Issue #59 - top level target_link_uri should be removed
// Grab top level target_link_uri - The first per message uri will replace this
var default_target_link_uri = false;
// TODO: Issue #59 in 1EdTech - top level target_link_uri should be removed
// Grab top level target_link_uri if it exists for legacy
// The first per message uri will replace this
if ( tool.target_link_uri ) {
default_target_link_uri = tool.target_link_uri;
var default_target_link_uri = tool.target_link_uri;
jQuery("#launch").val(tool.target_link_uri);
}

Expand All @@ -226,24 +225,55 @@ function importLTI13Config() {
jQuery("#launch").val(message.target_link_uri);
uri_found = true;
}

if ( message.type == 'LtiResourceLinkRequest' ) {
jQuery("#lti13_on-input").prop("checked", true);

// Message type in Sakai
jQuery("#pl_launch").prop("checked", true);

// Message placements in Sakai
jQuery("#pl_coursenav").prop("checked", true);
jQuery("#pl_lessonsselection").prop("checked", true);
jQuery("#pl_contenteditor").prop("checked", true);
}
if ( message.type == 'LtiDeepLinkingRequest' ) {
jQuery("#lti13_on-input").prop("checked", true);

// Message type in Sakai
jQuery("#pl_linkselection").prop("checked", true);

// Message Placements in Sakai
jQuery("#allowtitle_allow-input").prop("checked", true);
jQuery("#allowlaunch_allow-input").prop("checked", true);
jQuery("#pl_linkselection").prop("checked", true);
jQuery("#pl_launch").prop("checked", false);
jQuery("#pl_lessonsselection").prop("checked", true);
jQuery("#pl_contenteditor").prop("checked", true);
jQuery("#pl_assessmentselection").prop("checked", true);
}
if ( message.type == 'LtiDataPrivacyLaunchRequest' ) {
jQuery("#pl_privacy").prop("checked", true);
}

// Look for Canvas and Sakai extensions in placement list
if ( message.placements && Array.isArray(message.placements) ) {
// Canvas Extensions in case we see them
if ( message.placements.includes("link_selection") ) jQuery("#pl_lessonsselection").prop("checked", true);
if ( message.placements.includes("assignment_selection") ) jQuery("#pl_assessmentselection").prop("checked", true);
if ( message.placements.includes("editor_button") ) jQuery("#pl_contenteditor").prop("checked", true);
if ( message.placements.includes("migration_selection") ) jQuery("#pl_importitem").prop("checked", true);

// Sakai Message Extensions - Set things directly by name
if ( message.placements.includes("coursenav") ) jQuery("#pl_coursenav").prop("checked", true);
if ( message.placements.includes("launch") ) jQuery("#pl_launch").prop("checked", true);
if ( message.placements.includes("privacy") ) jQuery("#pl_privacy").prop("checked", true);

// Sakai Placement Extensions
if ( message.placements.includes("contenteditor") ) jQuery("#pl_contenteditor").prop("checked", true);
if ( message.placements.includes("lessonsselection") ) jQuery("#pl_lessonsselection").prop("checked", true);
if ( message.placements.includes("assessmentselection") ) jQuery("#pl_assessmentselection").prop("checked", true);
}
}

}
}
console.log("closing the modal");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5879,28 +5879,6 @@ rubrics.integration.token-secret=12345678900909091234
# plus.roster.synchronization
# DEFAULT: true

# Enable / disable supporting incoming deep link requests in the Plus provider servlet. This should be
# left on unless you want to really lock down what aspects of LTI Advantage you want to support in your
# server.
# plus.deeplink.enabled
# DEFAULT: true

# List the default list of tools that are made available via the provider. Each tenant has the same
# list, this property is used if the tenant entry leaves its list blank. The list is a colon-separated list
# list of Sakai tool registration identifiers like
# sakai.resources:sakai.conversations:sakai.site
# Note that "sakai.site" is a vitural tool id that indicates the creation and launching of an entire SakaiPlus
# site and showing the entire Sakai UI. Since this default is no tools, in effect this is required to use Sakai
# Plus.
# plus.tools.allowed
# DEFAULT: null

# A colon separated list of Sakai tool ids that absolutely cannot be run inside and iframe
# in the controlling LMS. This will cause Sakai to detect an iframe and generate a popup link
# to escape the iframe.
# plus.tools.new.window
# DEFAULT: null

# Specify the template site to be used to copy when making a new site in response to the
# first Plus launch to a site or tool.
# plus.new.site.template
Expand Down
6 changes: 0 additions & 6 deletions library/src/webapp/js/headscripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -963,12 +963,6 @@ function tsugi_window_close(message)
setTimeout(function(){ console.log("Notifying the user."); alert(message); open("about:blank", '_self').close(); }, 2000);
}

function inPlusPortal()
{
// There is no navigation and so no portal-container div to get moved around
return (document.querySelector("div.portal-container") == null);
}

// LTI frame management code shared with tsugi-static/js/tsugiscripts.js
var DE_BOUNCE_LTI_FRAME_RESIZE_TIMER = false;
var DE_BOUNCE_LTI_FRAME_RESIZE_HEIGHT = false;
Expand Down
2 changes: 0 additions & 2 deletions library/src/webapp/js/jquery/qtip/tutorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ const dialogPosition = {

function startTutorial(opts) {

if (inPlusPortal()) return;

const isRedirectNeeded = opts.userInitiatedTutorial && window.location.pathname !== '/portal';
const isRedirectedForTutorial = sessionStorage.getItem(sakai.triggerTutorial) === 'true';

Expand Down
55 changes: 7 additions & 48 deletions plus/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Sakai Plus
==========

"Sakai Plus" is an LTI 1.3 / LTI Advantage "tool provider" built in to Sakai 23.
"Sakai Plus" is an LTI 1.3 / LTI Advantage "tool provider" built in to Sakai
23 and later.

SakaiPlus allows a school to use Sakai as a "secondary LMS" without requiring you to
switch the entire campus to Sakai. Once installed, the instructors and students have
Expand All @@ -21,7 +22,7 @@ make suggestions on how to improve the product and be part of an open source com
that will listen to, care about, and implement their suggestions in a future version.

SakaiPlus has many hosting options. SakaiPlus is just a feature in every instance
of Sakai 23 waiting to be enabled, configured and used. SakaiPlus is multi-tenant
of Sakai 23 and later waiting to be enabled, configured and used. SakaiPlus is multi-tenant
and efficient so it is possible to provide a free or low cost cloud service that
would allow a school to test SakaiPlus or run a small pilot. You can get a small
single-tenant vendor supported cloud instance of SakaiPlus from a Sakai Commercial
Expand Down Expand Up @@ -69,49 +70,20 @@ Enabling SakaiPlus in sakai.properties
Overall Strategy
----------------

There are several use cases that SakaiPlus is designed to support - these can be used in combination
depending on the capability of the LMS that will launch SakaiPlus.
There are several LTI message types that SakaiPlus is designed to support.

* A simple left navigation launch from the enterprise LMS to "SakaiPlus" to make a Sakai site, enroll all
the students in the site, and launch students into the site. This is either a `LtiResourceLinkRequest` to
the endpoint base or by adding `sakai.site` to the endpoint. If you send a `LtiContextLaunchRequest` (emerging spec)
to the base endpoint regardless of tool id, it is treated as a `sakai.site` request.
* A `LtiContextLaunchRequest` or `LtiResourceLinkRequest` launch from
the enterprise LMS to "SakaiPlus" to make a Sakai site, enroll all the students in the site, and
launch students into the site.

https://trunk-mysql.nightly.sakaiproject.org/plus/sakai/
https://trunk-mysql.nightly.sakaiproject.org/plus/sakai/sakai.site

* A `LtiDeepLinkingRequest` sent to the the base endpoint or the `sakai.deeplink` endpoint. This will
check the `plus.allowedtools` list and go through a deep linking flow to choose and install an
individual Sakai tool. You can install a link to `sakai.site` through deep linking if `sakai.site`
is included in the `plus.allowedtools` property

https://trunk-mysql.nightly.sakaiproject.org/plus/sakai/
https://trunk-mysql.nightly.sakaiproject.org/plus/sakai/sakai.deeplink

* You can launch to a single Sakai tool without any portal mark-up by hard-coding the `target_uri` to
include the Sakai tool id like `sakai.resources` and sending that end point an `LtiResourceLinkRequest`.

https://trunk-mysql.nightly.sakaiproject.org/plus/sakai/sakai.resources

If you have exactly one tool enabled in the allowed tools list (i.e. like sakai.conversations) and do not
even have sakai.site enabled, a `LtiResourceLinkRequest` sent to the base URL will be sent to that tool.
This feature would allow you to put up a server like conversations.sakaicloud.org and serve one and
only one tool.

* You can also send a `LtiDataPrivacyLaunchRequest`, SakaiPlus checks the following properties (in order)
and redirects the user to the correct URL:

plus.server.policy.uri
plus.server.tos.uri

At a high level some effort has been made to make it so that the `target_link_uri` is the base launch point

https://trunk-mysql.nightly.sakaiproject.org/plus/sakai

And the launch `message_type` determines that happens - except of course for launches directly to a single
tool. This reflects the (good) general trend in LTI Advantage to use message type rather than URL patterns
for different kinds of launches.

It might be necessary to install SakaiPlus more than once so that it shows up in all the right placements
in a particular LMS.

Expand Down Expand Up @@ -152,19 +124,6 @@ as part of Dynamic Registration. For other systems a new `Deployment ID` is gen
You can set the `Deployment ID` to `*` if you can accept any `Deployment ID` for a particular
`Client ID`. See the per-LMS installation instructions above for details.

*Allowed Tools*

This field is a colon-separated list of Sakai tool ids like "sakai.resources". There is a special
"sakai.site" tool id which controls the availability of the "entire site" launch". A simple default
for this is "sakai.site" or "sakai.site:sakai.resources: ...". This field is required.

*New Window Tools*

This field is a colon-separated list of Sakai tool ids which will be forced to always open in a
new window. The "sakai.site" is always launched in a new window. This is typically left blank unless
it is known that a particular tool just does not work well in an iframe. Or perhaps you are setting
up a single tool server and want it to always be in a new window.

*Trust Email*

If the Learning system that is calling SakaiPlus for this tenant sends email, you *should* trust the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ public interface PlusService {
public static final String PLUS_ROSTER_SYCHRONIZATION = "plus.roster.synchronization";
public static final boolean PLUS_ROSTER_SYCHRONIZATION_DEFAULT = true;

public static final String PLUS_DEEPLINK_ENABLED = "plus.deeplink.enabled";
public static final boolean PLUS_DEEPLINK_ENABLED_DEFAULT = true;

// plus.allowedtools=sakai.resources:sakai.site
public static final String PLUS_TOOLS_ALLOWED = "plus.tools.allowed";
public static final String PLUS_TOOLS_ALLOWED_DEFAULT = "";
public static final String PLUS_TOOLS_NEW_WINDOW = "plus.tools.new.window";
public static final String PLUS_TOOLS_NEW_WINDOW_DEFAULT = "";
public static final String PLUS_NEW_SITE_TEMPLATE = "plus.new.site.template";
public static final String PLUS_NEW_SITE_TEMPLATE_DEFAULT = "!plussite";
public static final String PLUS_NEW_SITE_TEMPLATE_BACKUP = "!worksite";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ public class Tenant extends BaseLTI implements PersistableEntity<String> {
@Column(name = "TIMEZONE", length = 100, nullable = true)
private String timeZone;

@Column(name = "ALLOWED_TOOLS", length = 500, nullable = true)
private String allowedTools;
// Deleted SAK-50165 - Remove single tool use case
// @Column(name = "ALLOWED_TOOLS", length = 500, nullable = true)
// private String allowedTools;

@Column(name = "NEW_WINDOW_TOOLS", length = 500, nullable = true)
private String newWindowTools;
// Deleted SAK-50165 - Remove single tool use case
// @Column(name = "NEW_WINDOW_TOOLS", length = 500, nullable = true)
// private String newWindowTools;

@Column(name = "VERBOSE")
private Boolean verbose = Boolean.FALSE;
Expand Down
16 changes: 11 additions & 5 deletions plus/docs/INSTALL-SAKAI.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ For fresh installs, Plus Admin is automatically added to Administration Workspac
If this is an upgraded server, you may need to add the Plus Admin (sakai.plus) tool to
the Administration Workspace using the Sites tool.

Add a tenant, give it a title and set the issuer, set "Trust Email", set "Verbose Logging", set
Allowed Tools to `sakai.resources:sakai.site`, and Registration Lock to 42.
Add a tenant, give it a title and set the issuer, set "Trust Email", set "Verbose Logging",
and Registration Lock to 42.

Save the Tenant - it is "draft" because it is missing a lot of fields that will be set when
LTI Dynamic Provisioning runs.
Expand All @@ -50,18 +50,24 @@ and run the process. Make sure to enable:
* Send email
* Send name
* Give access to services
* Choose the various placements (Lessons, etc.)
* Tool Supports LTI 1.3
* Allow popup to be changed

before saving the external tool.

You can select both of the types of launches (and even the privacy placement) as long as the tool
url is something like "http../plus/sakai/" with no suffix like sakai.site or sakai.resources.
You can select thees types of launches:

* The tool URL can receive an LTI launch
* Tool supports the privacy launch message (experimental)

Do not set:

* The tool can receive a Content-Item or Deep-Link launch

In terms of placements, the best placement is site level navigation.

* Allow the tool to be placed in site-level navigation

Once the tool (or tools) are configured, save the tool.

Testing SakaiPlus
Expand Down
17 changes: 0 additions & 17 deletions plus/docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,3 @@ As a note, SakaiPlus handles numeric scores. Letter scores and pass/fail scores
will not be transported to the Main site.


TODO
----

Document a test plan for the Deep Link / Content Item use cases with Plus

Test with zero, one and two allowedTools - it treats these use cases quite differently.
If there is > 1 tool, you see a set of cards (like Tsugi) to allow you to choose which
Sakai tool to install. With 1 tool, it just auto-chooses that tool and installs it with
no list of cards. If there are zero tools (not a very useful use case) it falls back to
installing `sakai.site`.

You need to launch tools in an iframe and then in a new window. It is easy to do this in
Lessons. Neither should show any of the site list or tool list navigation (see screenshots
in JIRA)



13 changes: 5 additions & 8 deletions plus/provider/src/bundle/plus.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ plus.plusservice.not.persisted=Required parameters must be saved / persisted
plus.server.title=Sakai Plus
plus.server.description=Open source LMS and tools available for integration into your LMS.

plus.deeplink.details=Details
plus.deeplink.tool.not.selected=No tool selected
plus.deeplink.sakai.plus=Sakai Plus
plus.deeplink.deep.link=Sakai Tools
plus.deeplink.context.launch=Sakai Plus
plus.deeplink.privacy.launch=Privacy Launch
plus.provision.sakai.plus=Sakai Plus
plus.provision.context.launch=Sakai Plus
plus.provision.privacy.launch=Privacy Launch

plus.dynamic.welcome=Welcome to SakaiPlus LTI Dynamic Registration
plus.dynamic.request.missing=Missing required parameters for LTI Dynamic Registration
Expand Down Expand Up @@ -163,8 +160,8 @@ content_item.install.button = Install
content_item.return_url.notfound = Missing content_item_return_url from launch data
content_item.back.to.store = Back to List
canvas.title = Sakai Tools
canvas.description = This server hosts Sakai tools that you can launch from Canvas.
plus.canvas.title = Sakai Tools
plus.canvas.description = This server hosts Sakai tools that you can launch from Canvas.
canvas.error.missing.domain = Unable to parse domain (internal error)
Expand Down
Loading

0 comments on commit 6d94174

Please sign in to comment.