Skip to content

Commit

Permalink
Merge branch 'hotfix/2019.2.4' into stable-2019.2
Browse files Browse the repository at this point in the history
  • Loading branch information
PenghaiZhang committed Jul 1, 2020
2 parents 5174f99 + 3f5c1f9 commit 513742d
Show file tree
Hide file tree
Showing 28 changed files with 1,104 additions and 304 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@
*/
@Entity
@AccessType("field")
@Table(
uniqueConstraints = {
@UniqueConstraint(columnNames = {"username", "institutionId"}),
@UniqueConstraint(columnNames = {"uniqueId", "institutionId"})
})
@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"uniqueId", "institutionId"})})
public class UserInfoBackup implements UserBean {
private static final long serialVersionUID = 1L;

Expand Down
9 changes: 9 additions & 0 deletions Source/Plugins/Core/com.equella.core/plugin-jpf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4271,6 +4271,10 @@
<parameter id="type" value="blackboardrest" />
<parameter id="class" value="bean:com.tle.core.connectors.blackboard.service.BlackboardRESTConnectorService" />
</extension>
<extension plugin-id="com.tle.web.core" point-id="webServlet" id="blackboardRestOAuthServlet">
<parameter id="bean" value="bean:com.tle.web.connectors.blackboard.servlet.BlackboardRestOauthSignonServlet" />
<parameter id="url-pattern" value="/blackboardrestauth" />
</extension>
<extension plugin-id="com.tle.core.connectors" point-id="connectorType" id="blackboardConnector">
<parameter id="id" value="blackboard" />
<parameter id="nameKey" value="com.equella.core.connector.name" />
Expand Down Expand Up @@ -5144,6 +5148,11 @@
<parameter id="bean" value="bean:com.tle.core.institution.migration.v20192.AddLastOwnerMigration" />
<parameter id="date" value="2019-09-17" />
</extension>
<extension plugin-id="com.tle.core.migration" point-id="migration" id="RemoveLastKnownUserConstraint">
<parameter id="id" value="com.tle.core.institution.migration.v20192.RemoveLastKnownUserConstraint" />
<parameter id="bean" value="bean:com.tle.core.institution.migration.v20192.RemoveLastKnownUserConstraint" />
<parameter id="date" value="2020-06-15" />
</extension>
<extension plugin-id="com.tle.core.migration" point-id="migration" id="increaseThumbnailColumnMigration">
<parameter id="id" value="com.tle.core.institution.migration.v64.IncreaseThumbnailLength" />
<parameter id="bean" value="bean:com.tle.core.institution.migration.v64.IncreaseThumbnailLength" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
/com.tle.core.entity.services.migration.v64.thumbnail.columnsize.title=Increasing column size for item thumbnails
/com.tle.core.entity.services.migration.v20192.unknownuser.lastowner=Add last owner to item
/com.tle.core.entity.services.migration.v20192.unknownuser.alluser=Create a new table for all users
/com.tle.core.entity.services.migration.v20192.removelastknownuserconstraint=Remove last known user composite constraint (username and institution ID)
/com.tle.core.entity.services.query.contains={0} is {1}
/com.tle.core.entity.services.query.date.after={0} after {1}
/com.tle.core.entity.services.query.date.before={0} before {1}
Expand Down Expand Up @@ -1716,8 +1717,12 @@ export.added.summary.singleresource.contentpackage=This content package
export.added.summary.singleresource.resourcesummary=This summary page
export.added.summary.singleresourcemultilocations={0} was published to {1} locations
export.attachments=Include files
export.authorization.newtab.description=This external connector needs to be launched in a new tab. Once the authorization flow is complete, close the new tab, and click OK in this dialog.
export.authorization.newtab.launch=Launch Authorization in New Tab
export.authorization.newtab.receipt=Authorization is complete. Please close this tab and click OK in the dialog in the original tab.
export.button.auth=Authorise external system
export.button.export=Add selected resources
export.button.refreshcache=Refresh Course Cache
export.error.accessdenied=Access denied
export.error.nolocationsselected=No locations are selected to add resources to
export.error.noresourcesselected=No resources are selected to add
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,12 @@

<@css "blackboardconnector.css" />

<@setting label='' help=b.key('bb.editor.help.installmodule')>
<hr>
</@setting>

<@ajax.div id="blackboardsetup">
<@ajax.div id="blackboardrestsetup">

<#include "/com.tle.web.connectors@/field/serverurl.ftl" />

<#if m.testedUrl??>

<@ajax.div id="testdiv">

<@setting
label=''
error=m.errors["blackboardwebservice"]
help=b.key('editor.help.testwebservice')
rowStyle="testBlackboardRow">

<@button section=s.testWebServiceButton showAs="verify" />
<#if m.testWebServiceStatus??>
<span class="status ${m.testWebServiceStatus}">${b.key('bb.editor.label.testwebservice.' + m.testWebServiceStatus)}</span>
</#if>
</@setting>
</@ajax.div>

<@setting label=b.key('blackboardrest.editor.label.apikey')
error=m.errors["apikey"]
help=b.key('blackboardrest.editor.help.apikey')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,24 @@
<@css "auth.css" />

<div id="auth_container">
<iframe frameBorder="0" src="${m.authUrl?html}"></iframe>
</div>
<#if m.showReceipt >
<p>${b.key('export.authorization.newtab.receipt')}</p>
<#else>
<#if m.showNewTabLauncher >
<p>${b.key('export.authorization.newtab.description')}</p>

<button onclick="newTabAuth()" class="btn btn-equella">
${b.key('export.authorization.newtab.launch')}
</button>

<script>
function newTabAuth() {
window.open(
"${m.authUrl}", "_blank", "noopener,noreferrer");
}
</script>
<#else>
<iframe frameBorder="0" src="${m.authUrl?html}"></iframe>
</#if>
</#if>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,18 @@
</div>
</div>
</div>



<#if m.courseCaching>
<div class="button-strip">
<@render s.refreshCourseCacheButton />
</div>
</#if>

<div class="button-strip">
<@render s.publishButton />
</div>

</#if>

</@div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ Contribution wizard inputs

/************************/
.wizard-controls .indent1 {
width: 556px;
width: 95%;
}

.wizard-controls .indent2 {
Expand Down Expand Up @@ -848,6 +848,24 @@ a[title="move-down"]:before {
width: 476px;
}

@media only screen and (max-width: 768px) {
.wizard-layout .indent0 .shuffle-box-inner select {
width: 30%;
}
}

@media only screen and (min-width: 769px) and (max-width: 1200px) {
.wizard-layout .indent0 .shuffle-box-inner select {
width: 38%;
}
}

@media only screen and (min-width: 1201px) {
.wizard-layout .indent0 .shuffle-box-inner select {
width: 45%;
}
}

.wizard-layout .indent1 .shuffle-box-inner select {
width: 236px;
}
Expand Down Expand Up @@ -1906,11 +1924,17 @@ div.skinnysearch {

.autocompleteControl .autocomplete-container {
float: left;
width: 513px;
// 120px for width of the select button and padding with default text 'select'.
width: calc(100% - 120px);
}

.autocompleteControl .btn {
float: right;
}

#wizard-controls .autocompleteControl input[type="text"] {
height: 34px;
width: 100%;
}

.ac_odd {
Expand Down Expand Up @@ -2652,7 +2676,17 @@ Contribution wizard styling
.wizard-layout #col2,
#affix-div {
width: 221px;
top: 55px;
}

.wizard-layout .contribution-rightNav {
position: fixed;
right: 30px;
}

.wizard-layout .moderation-rightNav {
position: fixed;
right: 30px;
top: 70px;
}

.wizard-layout #col2 {
Expand Down Expand Up @@ -2721,14 +2755,9 @@ Contribution wizard styling
#wizard-navigation input[type="button"] {
margin: 0 0 0 3px;
}
#wizard-major-actions {
display: flex;
}

#wizard-major-actions .action-button.save {
background-image: url("../../images/baseline_save_white_18dp.png");
text-align: left;
padding-left: 42px;
}

#wizard-major-actions .action-button.edit {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,53 @@
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0, (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var WizardCtrl = {
setMessage : function(ctrlid, message)
{
var $ctrl = $("#" + ctrlid);
var $content = $ctrl.children("div:first-child");
var $msg = $content.children("p.ctrlinvalidmessage");
if (!message)
{
$content.removeClass("ctrlinvalid");
$msg.empty();
}
else
{
$content.addClass("ctrlinvalid");
$msg.html(message);
}
},
affixDiv: function() {
var ad = $("#affix-div");
ad.attr("data-spy", "affix");
var offset = (ad.offset().top) - 55;
ad.attr("data-offset-top",offset);
}
};
setMessage: function (ctrlid, message) {
var $ctrl = $("#" + ctrlid);
var $content = $ctrl.children("div:first-child");
var $msg = $content.children("p.ctrlinvalidmessage");
if (!message) {
$content.removeClass("ctrlinvalid");
$msg.empty();
} else {
$content.addClass("ctrlinvalid");
$msg.html(message);
}
},
affixDiv: function () {
var ad = $("#affix-div");
ad.attr("data-spy", "affix");
var offset = ad.offset().top - 55;
ad.attr("data-offset-top", offset);
},
affixDivNewUI: function () {
const moderationPanel = $("#moderate");
const affixDiv = $("#affix-div");
if (moderationPanel.length > 0) {
$(window).on("scroll", function () {
// Use outerHeight to include margin.
const moderationPanelHeight = moderationPanel.outerHeight(true);
const currentWindowYPos = $(window).scrollTop();
currentWindowYPos >= moderationPanelHeight
? affixDiv.addClass("moderation-rightNav")
: affixDiv.removeClass("moderation-rightNav");
});
} else {
affixDiv.addClass("contribution-rightNav");
}
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ void logItemContentViewed(

void logItemPurged(Item item);

// Note: This is specific to the Blackboard REST connector,
// however, no other connector uses the audit log yet. Maybe need to refactor in the future
void logExternalConnectorUsed(
String externalConnectorUrl,
String requestLimit,
String requestRemaining,
String timeToReset);

void logGeneric(
String category, String type, String data1, String data2, String data3, String data4);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class AuditLogServiceImpl implements AuditLogService {
private static final String ENTITY_CATEGORY = "ENTITY";
private static final String SEARCH_CATEGORY = "SEARCH";
private static final String ITEM_CATEGORY = "ITEM";
private static final String EXTERNAL_CONN_CATEGORY = "EXTERNAL_CONNECTOR";

private static final String CREATED_TYPE = "CREATED";
private static final String MODIFIED_TYPE = "MODIFIED";
Expand All @@ -60,6 +61,8 @@ public class AuditLogServiceImpl implements AuditLogService {

private static final String SEARCH_FEDERATED_TYPE = "FEDERATED";

private static final String USED_TYPE = "USED";

private static final String TRUNCED = "...";

private PluginTracker<AuditLogExtension> extensionTracker;
Expand Down Expand Up @@ -197,6 +200,21 @@ public void logItemPurged(Item item) {
null);
}

@Override
public void logExternalConnectorUsed(
String externalConnectorUrl,
String requestLimit,
String requestRemaining,
String timeToReset) {
logGeneric(
EXTERNAL_CONN_CATEGORY,
USED_TYPE,
externalConnectorUrl,
requestLimit,
requestRemaining,
timeToReset);
}

private void logEntityGeneric(String type, long entityId) {
logGeneric(ENTITY_CATEGORY, type, CurrentUser.getUserID(), Long.toString(entityId), null, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,28 @@

package com.tle.core.connectors.blackboard;

/** @author Aaron */
@SuppressWarnings("nls")
public final class BlackboardRESTConnectorConstants {
private BlackboardRESTConnectorConstants() {
throw new Error();
}

public static final String AUTHENTICATIONCODE_SERVICE_URI_PATH =
"/learn/api/public/v1/oauth2/authorizationcode";

public static final String SESSION_KEY_USER_ID = "BbRest.UserId";
public static final String SESSION_COURSES = "BbRest.UserCourses";
public static final String SESSION_CODE = "BbRest.Code";
public static final String SESSION_TOKEN = "BbRest.Token";

public static final String CONNECTOR_TYPE = "blackboardrest";

public static final String FIELD_TESTED_WEBSERVICE = "testedWebservice";
public static final String FIELD_API_KEY = "apiKey";
public static final String FIELD_API_SECRET = "apiSecret";

public static final String STATE_KEY_FORWARD_URL = "forwardUrl";
public static final String STATE_KEY_POSTFIX_KEY = "postfixKey";

public static final String AUTH_URL = "blackboardrestauth";

private BlackboardRESTConnectorConstants() {
throw new Error();
}
}
Loading

0 comments on commit 513742d

Please sign in to comment.