Skip to content

Commit

Permalink
SAK-41887 Remove sakai.gradebook.tool from stealthed tools in kernel.…
Browse files Browse the repository at this point in the history
…properties because is gradebook classic is a contrib tool (#7602)
  • Loading branch information
Miguel Pellicer committed Dec 3, 2019
1 parent a57e866 commit 2b6e19c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 22 deletions.
4 changes: 2 additions & 2 deletions feedback/toolOrder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<tool id = "sakai.assignment" />
<tool id = "sakai.assignment.grades" />
<tool id = "sakai.samigo" />
<tool id = "sakai.gradebook.tool" />
<tool id = "sakai.gradebookng" />
<tool id = "sakai.dropbox" />
<tool id = "sakai.chat" />
<tool id = "sakai.rwiki" />
Expand Down Expand Up @@ -53,7 +53,7 @@
<tool id = "sakai.assignment" />
<tool id = "sakai.assignment.grades" />
<tool id = "sakai.samigo" />
<tool id = "sakai.gradebook.tool" />
<tool id = "sakai.gradebookng" />
<tool id = "sakai.dropbox" />
<tool id = "sakai.chat" />
<tool id = "sakai.rwiki" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ realm.allowed..auth=annc.all.groups,annc.read,asn.read,asn.receive.notifications
rwiki.update,signup.attend,signup.attend.all,signup.view,signup.view.all,site.viewRoster,site.visit,sitestats.view,\
usermembership.view,lessonbuilder.read

[email protected]=sakai.gradebook.tool
[email protected]=

# These tools need to use server saving method as they are on older JSF versions. If upgraded to JSf 1.2+ please remove from this list
# Chat Tool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<tool id = "sakai.assignment" />
<tool id = "sakai.assignment.grades" />
<tool id = "sakai.samigo" />
<tool id = "sakai.gradebook.tool" />
<tool id = "sakai.gradebookng" />
<tool id = "sakai.dropbox" />
<tool id = "sakai.chat" />
<tool id = "sakai.rwiki" />
Expand Down Expand Up @@ -54,7 +54,7 @@
<tool id = "sakai.assignment" />
<tool id = "sakai.assignment.grades" />
<tool id = "sakai.samigo" />
<tool id = "sakai.gradebook.tool" />
<tool id = "sakai.gradebookng" />
<tool id = "sakai.dropbox" />
<tool id = "sakai.chat" />
<tool id = "sakai.rwiki" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,11 @@ public List<SelectItem> getItemTypeSelectList()
if (ToolManager.getTool("sakai.questionbank.client") != null
&& !ServerConfigurationService
.getString(
"[email protected]")
"[email protected]", "")
.contains("sakai.questionbank.client")
&& !ServerConfigurationService
.getString(
"[email protected]")
"[email protected]", "")
.contains("sakai.questionbank.client")) {

list.add(new SelectItem("100",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,7 @@ public boolean isGradebookExist(String siteId)
} catch (Exception ee) {
log.warn(siteId + " contains a page (" + page.getTitle() + ") without a valid tool registration");
}
if (toolId != null && toolId.equalsIgnoreCase("sakai.gradebook.tool")) {
return true;
} else if (toolId != null && toolId.equalsIgnoreCase("sakai.gradebook.gwt.rpc")) {
return true;
} else if (toolId != null && toolId.equalsIgnoreCase("sakai.gradebookng")) {
return true;
}

return toolId != null && toolId.toLowerCase().contains("sakai.gradebook");
}
} catch (Exception e) {
log.warn(e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2948,7 +2948,7 @@ public int compare(String s1, String s2) {

List<String> gradebooksInTargetSite = new ArrayList<String>();
for (String toolId : targetSiteToolIds) {
if (org.apache.commons.lang3.StringUtils.equalsAny(toolId, "sakai.gradebook.tool", "sakai.gradebookng")) {
if (StringUtils.isNotBlank(toolId) && toolId.contains("sakai.gradebook")) {
gradebooksInTargetSite.add(toolId);
}
}
Expand Down Expand Up @@ -15667,14 +15667,13 @@ private Map<String, Set<String>> getSiteImportToolsWithContent(List<Site> sites,

for(String toolId: toolIds) {
if(site.getToolForCommonId(toolId) != null ||
(org.apache.commons.lang3.StringUtils.equalsAny(toolId, "sakai.gradebook.tool", "sakai.gradebookng") &&
(site.getToolForCommonId("sakai.gradebook.tool") != null || site.getToolForCommonId("sakai.gradebookng") != null)))
{
(StringUtils.isNotBlank(toolId) && toolId.contains("sakai.gradebook")) &&
(site.getToolForCommonId("sakai.gradebook.tool") != null || site.getToolForCommonId("sakai.gradebookng") != null)) {
//check the tool has content
if(hasContent(toolId, site.getId())) {
toolsWithContent.add(toolId);
} else {
if (org.apache.commons.lang3.StringUtils.equalsAny(toolId, "sakai.gradebook.tool", "sakai.gradebookng") &&
if ((StringUtils.isNotBlank(toolId) && toolId.contains("sakai.gradebook")) &&
hasContent("sakai.gradebook.tool", site.getId()) || hasContent("sakai.gradebookng", site.getId())) {
toolsWithContent.add(toolId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@
#foreach ($pageTool in $pageTools)
#if ($pageTool.getTool().getId() == $toolId)
#set($toolFound = true)
#elseif (($toolId == "sakai.gradebook.tool" || $toolId == "sakai.gradebookng") && ($pageTool.getTool().getId() == "sakai.gradebook.tool" || $pageTool.getTool().getId() == "sakai.gradebookng"))
#elseif ($toolId.contains("sakai.gradebook") && $pageTool.getTool().getId().contains("sakai.gradebook"))
#set($toolFound = true)
#end
#end
#end

#set ($toolsWithContent = $!siteToolsWithContent.get($site.getId()))
#if(($toolId == "sakai.gradebook.tool" || $toolId == "sakai.gradebookng") && ($toolsWithContent.contains("sakai.gradebook.tool") || $toolsWithContent.contains("sakai.gradebookng")))
#if($toolId.contains("sakai.gradebook") && $toolsWithContent.contains("sakai.gradebook"))
## Take the default
#elseif(!$toolsWithContent.contains($toolId))
#set($toolFound = false)
Expand Down

0 comments on commit 2b6e19c

Please sign in to comment.