Skip to content
Snippets Groups Projects
Commit 14f8a33b authored by uhensler's avatar uhensler
Browse files

OO-3797: Button to check the configurations

Configuration is ok, if a user is able to log in edu-sharing.
parent 51a219b9
No related branches found
No related tags found
No related merge requests found
...@@ -29,8 +29,6 @@ import org.olat.core.id.Identity; ...@@ -29,8 +29,6 @@ import org.olat.core.id.Identity;
*/ */
public interface EdusharingClient { public interface EdusharingClient {
void test(Identity identity);
public EdusharingProperties getRepoConfig(); public EdusharingProperties getRepoConfig();
public String createTicket(Identity identity) throws EdusharingException; public String createTicket(Identity identity) throws EdusharingException;
......
...@@ -34,8 +34,6 @@ import org.olat.core.id.OLATResourceable; ...@@ -34,8 +34,6 @@ import org.olat.core.id.OLATResourceable;
*/ */
public interface EdusharingService { public interface EdusharingService {
void test(Identity identity);
/** /**
* Get the configuration values used to register OpenOLAT as an edu-sharing application. * Get the configuration values used to register OpenOLAT as an edu-sharing application.
* *
......
...@@ -47,12 +47,6 @@ public class EdusharingClientImpl implements EdusharingClient { ...@@ -47,12 +47,6 @@ public class EdusharingClientImpl implements EdusharingClient {
@Autowired @Autowired
private EdusharingSoapClient soapClient; private EdusharingSoapClient soapClient;
@Override
public void test(Identity identity) {
soapClient.test(identity);
}
@Override @Override
public EdusharingProperties getRepoConfig() throws EdusharingException { public EdusharingProperties getRepoConfig() throws EdusharingException {
return httpClient.getMetadata(); return httpClient.getMetadata();
......
...@@ -76,11 +76,6 @@ public class EdusharingServiceImpl implements EdusharingService { ...@@ -76,11 +76,6 @@ public class EdusharingServiceImpl implements EdusharingService {
@Autowired @Autowired
private EdusharingSecurityService securityService; private EdusharingSecurityService securityService;
@Override
public void test(Identity identity) {
client.test(identity);
}
@Override @Override
public Properties getConfigForRegistration() { public Properties getConfigForRegistration() {
Properties props = new Properties(); Properties props = new Properties();
......
...@@ -21,7 +21,6 @@ package org.olat.modules.edusharing.manager; ...@@ -21,7 +21,6 @@ package org.olat.modules.edusharing.manager;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID;
import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriBuilder;
import javax.xml.ws.BindingProvider; import javax.xml.ws.BindingProvider;
...@@ -32,7 +31,6 @@ import javax.xml.ws.handler.PortInfo; ...@@ -32,7 +31,6 @@ import javax.xml.ws.handler.PortInfo;
import org.edu_sharing.webservices.authbyapp.AuthByApp; import org.edu_sharing.webservices.authbyapp.AuthByApp;
import org.edu_sharing.webservices.authbyapp.AuthByAppService; import org.edu_sharing.webservices.authbyapp.AuthByAppService;
import org.edu_sharing.webservices.authbyapp.AuthenticationException; import org.edu_sharing.webservices.authbyapp.AuthenticationException;
import org.edu_sharing.webservices.authentication.AuthenticationException_Exception;
import org.edu_sharing.webservices.authentication.AuthenticationResult; import org.edu_sharing.webservices.authentication.AuthenticationResult;
import org.edu_sharing.webservices.types.KeyValue; import org.edu_sharing.webservices.types.KeyValue;
import org.edu_sharing.webservices.usage2.Usage2; import org.edu_sharing.webservices.usage2.Usage2;
...@@ -61,31 +59,6 @@ class EdusharingSoapClient { ...@@ -61,31 +59,6 @@ class EdusharingSoapClient {
@Autowired @Autowired
private EdusharingModule edusharingModule; private EdusharingModule edusharingModule;
void test(Identity identity) {
log.info("Test started");
try {
tryCreateUsage(identity);
tryTest(identity);
} catch (Exception e) {
log.error("", e);
}
log.info("Test finished");
}
private void tryCreateUsage(Identity identity) throws Usage2Exception_Exception {
CreateUsageParameter params = new CreateUsageParameter(
UUID.randomUUID().toString(),
"ccrep://OpenOLAT/633e6c18-7780-4d1a-bdf5-8bcce1acc50a", // KISS
identity.getName(),
UUID.randomUUID().toString()
);
createUsage(params);
}
private void tryTest(Identity identity) throws AuthenticationException_Exception, AuthenticationException {
createTicket(identity);
}
String createTicket(Identity identity) throws AuthenticationException { String createTicket(Identity identity) throws AuthenticationException {
return authenticate(identity).getTicket(); return authenticate(identity).getTicket();
} }
......
...@@ -50,6 +50,7 @@ import org.olat.modules.edusharing.EdusharingModule; ...@@ -50,6 +50,7 @@ import org.olat.modules.edusharing.EdusharingModule;
import org.olat.modules.edusharing.EdusharingProperties; import org.olat.modules.edusharing.EdusharingProperties;
import org.olat.modules.edusharing.EdusharingSecurityService; import org.olat.modules.edusharing.EdusharingSecurityService;
import org.olat.modules.edusharing.EdusharingService; import org.olat.modules.edusharing.EdusharingService;
import org.olat.modules.edusharing.Ticket;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/** /**
...@@ -239,7 +240,16 @@ public class EdusharingAdminController extends FormBasicController { ...@@ -239,7 +240,16 @@ public class EdusharingAdminController extends FormBasicController {
} }
private void doTest() { private void doTest() {
edusharingService.test(getIdentity()); try {
} Ticket ticket = edusharingService.createTicket(getIdentity());
if (ticket != null) {
showInfo("admin.test.successful");
return;
}
} catch (Exception e) {
log.error("", e);
}
showInfo("admin.test.unsuccessful");
}
} }
...@@ -12,6 +12,8 @@ admin.soap.key.generate.confirm=Wollen Sie wriklich neue Schl\u00FCssel generier ...@@ -12,6 +12,8 @@ admin.soap.key.generate.confirm=Wollen Sie wriklich neue Schl\u00FCssel generier
admin.soap.key.generate.error=Es konnten keine neue Schl\u00FCssel generiert werden. admin.soap.key.generate.error=Es konnten keine neue Schl\u00FCssel generiert werden.
admin.soap.key.generate=Schl\u00FCssel generieren admin.soap.key.generate=Schl\u00FCssel generieren
admin.soap.key.public=\u00D6ffentlicher Schl\u00FCssel von OpenOLAT admin.soap.key.public=\u00D6ffentlicher Schl\u00FCssel von OpenOLAT
admin.test.successful=Die Anmeldung bei edu-sharing war erfolgreich.
admin.test.unsuccessful=Die Anmeldung bei edu-sharing war nicht erfolgreich.
admin.ticket.valid=G\u00FCltickeitsdauer Ticket (Sekunden) admin.ticket.valid=G\u00FCltickeitsdauer Ticket (Sekunden)
admin.title=edu-sharing admin.title=edu-sharing
admin.url=URL admin.url=URL
......
...@@ -12,6 +12,8 @@ admin.soap.key.generate.confirm=Do you want to generate new keys? The old keys w ...@@ -12,6 +12,8 @@ admin.soap.key.generate.confirm=Do you want to generate new keys? The old keys w
admin.soap.key.generate.error=Error while generating new keys. admin.soap.key.generate.error=Error while generating new keys.
admin.soap.key.generate=Generate keys admin.soap.key.generate=Generate keys
admin.soap.key.public=Public key of OpenOLAT admin.soap.key.public=Public key of OpenOLAT
admin.test.successful=Login to edu-sharing successful.
admin.test.unsuccessful=Login to edu-sharing not successful.
admin.ticket.valid=Valid time of ticket (seconds) admin.ticket.valid=Valid time of ticket (seconds)
admin.title=edu-sharing admin.title=edu-sharing
admin.url=URL admin.url=URL
......
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