Skip to content
Snippets Groups Projects
Commit 4abb8814 authored by srosse's avatar srosse
Browse files

FXOLAT-282: remove customer id field in admin, fix the URL to Vitero

--HG--
branch : FXOLAT-282-virtualclassroom
parent 9f24aa35
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@
<!-- Definition of the providers -->
<bean id="viteroModule" class="com.frentix.olat.vitero.ViteroModule">
<constructor-arg index="0" ref="schedulerFactoryBean"/>
<property name="cronExpression" value="*/15 * * * * ?" />
<property name="cronExpression" value="0 15 */12 * * ?" />
<property name="deleteVmsUserOnUserDelete" value="${vc.vitero.deleteVmsUserOnUserDelete}" />
<property name="persistedProperties">
......
......@@ -1210,7 +1210,7 @@ public class ViteroManager extends BasicManager implements UserDataDeletable {
private final String getStartPoint(String sessionCode) {
UriBuilder builder = UriBuilder.fromUri(viteroModule.getVmsURI() );
builder.path("start.html");
builder.path("start.htm");
if(StringHelper.containsNonWhitespace(sessionCode)) {
builder.queryParam("sessionCode", sessionCode);
}
......
......@@ -67,7 +67,6 @@ public class ViteroConfigurationController extends FormBasicController {
private TextElement urlEl;
private TextElement loginEl;
private TextElement passwordEl;
private TextElement customerIdEl;
private MultipleSelectionElement viteroEnabled;
private SingleSelection timeZoneEl;
......@@ -144,8 +143,7 @@ public class ViteroConfigurationController extends FormBasicController {
String password = viteroModule.getAdminPassword();
passwordEl = uifactory.addPasswordElement("vitero-password", "option.adminpassword", 32, password, moduleFlc);
String customerId = Integer.toString(viteroModule.getCustomerId());
customerIdEl = uifactory.addTextElement("vitero-customerId", "option.customerId", 32, customerId, moduleFlc);
customersEl = uifactory.addDropdownSingleselect("option.customerId", moduleFlc, customerKeys, customerValues, null);
if(StringHelper.containsNonWhitespace(customerId) && Arrays.asList(customerKeys).contains(customerId)) {
customersEl.select(customerId, true);
......@@ -176,7 +174,7 @@ public class ViteroConfigurationController extends FormBasicController {
String password = passwordEl.getValue();
viteroModule.setAdminPassword(password);
String customerId = customerIdEl.getValue();
String customerId = customersEl.getSelectedKey();
viteroModule.setCustomerId(Integer.parseInt(customerId));
if(timeZoneEl.isOneSelected()) {
......@@ -223,18 +221,18 @@ public class ViteroConfigurationController extends FormBasicController {
passwordEl.setErrorKey("form.legende.mandatory", null);
allOk = false;
}
String customerId = customerIdEl.getValue();
customerIdEl.clearError();
if(StringHelper.containsNonWhitespace(customerId)) {
customersEl.clearError();
if(customersEl.isOneSelected()) {
try {
String customerId = customersEl.getSelectedKey();
Integer.parseInt(customerId);
} catch(Exception e) {
customerIdEl.setErrorKey("error.customer.invalid", null);
customersEl.setErrorKey("error.customer.invalid", null);
allOk = false;
}
} else {
customerIdEl.setErrorKey("form.legende.mandatory", null);
customersEl.setErrorKey("form.legende.mandatory", null);
allOk = false;
}
......@@ -258,7 +256,7 @@ public class ViteroConfigurationController extends FormBasicController {
String url = urlEl.getValue();
String login = loginEl.getValue();
String password = passwordEl.getValue();
String customerId = customerIdEl.getValue();
String customerId = customersEl.isOneSelected() ? customersEl.getSelectedKey() : "";
try {
boolean ok = viteroManager.checkConnection(url, login, password, Integer.parseInt(customerId));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment