use of org.olat.core.logging.AssertException in project OpenOLAT by OpenOLAT.
the class AdobeConnectProvider method removeClassroom.
@Override
public boolean removeClassroom(String roomId, VCConfiguration config) {
if (!existsClassroom(roomId, config))
return true;
if (!loginAdmin())
throw new AssertException("Cannot login to Adobe Connect. Please check module configuration and that Adobe Connect is available.");
String scoId = getScoIdFor(roomId);
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("action", "sco-delete");
parameters.put("sco-id", scoId);
Document responseDoc = getResponseDocument(sendRequest(parameters));
if (!evaluateOk(responseDoc))
return false;
logout();
return true;
}
use of org.olat.core.logging.AssertException in project OpenOLAT by OpenOLAT.
the class AdobeConnectProvider method getPrincipalIdFor.
private String getPrincipalIdFor(Identity identity) {
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("action", "principal-list");
parameters.put("filter-type", userType);
parameters.put("filter-type", "user");
parameters.put("filter-login", PREFIX + identity.getName());
String response = sendRequest(parameters);
Document responseDoc = getResponseDocument(response);
boolean success = evaluateOk(responseDoc);
if (!success)
return null;
// get principalId
NodeList nodes = (NodeList) evaluate(responseDoc, "//principal", XPathConstants.NODESET);
// error case
if (nodes == null)
return null;
if (nodes.getLength() == 1) {
String principalId = evaluate(responseDoc, "//principal[1]/attribute::principal-id");
return principalId;
} else if (nodes.getLength() > 1) {
throw new AssertException("Multiple Adobe Connect users with the same login name found: " + identity.getName());
} else
return null;
}
use of org.olat.core.logging.AssertException in project OpenOLAT by OpenOLAT.
the class AdobeConnectProvider method existsClassroom.
@Override
public boolean existsClassroom(String roomId, VCConfiguration config) {
if (!loginAdmin())
return false;
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("action", "sco-search-by-field");
parameters.put("query", PREFIX + roomId);
parameters.put("filter-type", "meeting");
Document responseDoc = getResponseDocument(sendRequest(parameters));
if (!evaluateOk(responseDoc))
return false;
Object result = evaluate(responseDoc, "//sco/url-path[text()='/" + PREFIX + roomId + "/']", XPathConstants.NODESET);
logout();
if (result == null)
return false;
NodeList nodes = (NodeList) result;
if (nodes.getLength() == 1)
return true;
else if (nodes.getLength() > 1)
throw new AssertException("More than one Adobe Connect room found for one course node!");
else
return false;
}
use of org.olat.core.logging.AssertException in project OpenOLAT by OpenOLAT.
the class AuthHelper method createAuthHome.
/**
* Create a base chief controller for the current authenticated user request
* and initialize the first screen after login.
*
* @param ureq The authenticated user request.
* @return The chief controller
*/
public static ChiefController createAuthHome(UserRequest ureq) {
if (!ureq.getUserSession().isAuthenticated())
throw new AssertException("not authenticated!");
BaseFullWebappControllerParts authSitesAndNav = new AuthBFWCParts();
ChiefController cc = new BaseFullWebappController(ureq, authSitesAndNav);
Windows.getWindows(ureq.getUserSession()).setChiefController(cc);
return cc;
}
use of org.olat.core.logging.AssertException in project OpenOLAT by OpenOLAT.
the class AuthHelper method createGuestHome.
/**
* Create a base chief controller for the current anonymous user request
* and initialize the first screen after login. Note, the user request
* must be authenticated, but as an anonymous user and not a known user.
*
* @param ureq The authenticated user request.
* @return The chief controller
*/
private static ChiefController createGuestHome(UserRequest ureq) {
if (!ureq.getUserSession().isAuthenticated())
throw new AssertException("not authenticated!");
BaseFullWebappControllerParts guestSitesAndNav = new GuestBFWCParts();
ChiefController cc = new BaseFullWebappController(ureq, guestSitesAndNav);
Windows.getWindows(ureq.getUserSession()).setChiefController(cc);
return cc;
}
Aggregations