Search in sources :

Example 41 with GoToOrganizer

use of org.olat.modules.gotomeeting.GoToOrganizer in project OpenOLAT by OpenOLAT.

the class EditTrainingController method doSetPersonalAccount.

private void doSetPersonalAccount() {
    availablesOrganizers = meetingManager.getOrganizersFor(getIdentity());
    String selectedKey = null;
    String[] organizerKeys = new String[availablesOrganizers.size()];
    String[] organizerValues = new String[availablesOrganizers.size()];
    for (int i = availablesOrganizers.size(); i-- > 0; ) {
        GoToOrganizer organizer = availablesOrganizers.get(i);
        organizerKeys[i] = Integer.toString(i);
        organizerValues[i] = organizer.getUsername();
        if (organizer.getOwner() != null) {
            selectedKey = organizerKeys[i];
        }
    }
    organizersEl.setKeysAndValues(organizerKeys, organizerValues, null);
    if (selectedKey != null) {
        organizersEl.select(selectedKey, true);
        addMeAsOrganizerButton.setVisible(false);
    }
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer)

Example 42 with GoToOrganizer

use of org.olat.modules.gotomeeting.GoToOrganizer in project OpenOLAT by OpenOLAT.

the class GoToOrganizerListAdminController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (addOrganizerController == source) {
        if (event == Event.DONE_EVENT) {
            updateModel();
        }
        cmc.deactivate();
        cleanUp();
    } else if (updateOrganizerController == source) {
        if (event == Event.DONE_EVENT) {
            updateModel();
        }
        cmc.deactivate();
        cleanUp();
    } else if (confirmRemoveOrganizer == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            GoToOrganizer organizer = (GoToOrganizer) confirmRemoveOrganizer.getUserObject();
            doRemoveOrganizer(organizer);
            updateModel();
        }
        cleanUp();
    } else if (cmc == source) {
        cleanUp();
    }
    super.event(ureq, source, event);
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer)

Example 43 with GoToOrganizer

use of org.olat.modules.gotomeeting.GoToOrganizer in project openolat by klemens.

the class GoToMeetingDAOTest method loadMeetingByKey.

@Test
public void loadMeetingByKey() {
    RepositoryEntry entry = JunitTestHelper.createAndPersistRepositoryEntry();
    String username = UUID.randomUUID().toString();
    String accessToken = UUID.randomUUID().toString();
    String organizerKey = UUID.randomUUID().toString();
    GoToOrganizer organizer = organizerDao.createOrganizer(null, username, accessToken, organizerKey, "Levinus", "Memminger", null, null, 10l, null);
    Assert.assertNotNull(organizer);
    Date start = new Date();
    Date end = new Date();
    String trainingKey = Long.toString(CodeHelper.getForeverUniqueID());
    GoToMeeting training = meetingDao.createTraining("Training by key", null, "Load training by key", trainingKey, start, end, organizer, entry, "d9915", null);
    dbInstance.commitAndCloseSession();
    Assert.assertNotNull(training);
    GoToMeeting reloadedTraining = meetingDao.loadMeetingByKey(training.getKey());
    Assert.assertNotNull(reloadedTraining);
    Assert.assertEquals(training, reloadedTraining);
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer) GoToMeeting(org.olat.modules.gotomeeting.GoToMeeting) RepositoryEntry(org.olat.repository.RepositoryEntry) Date(java.util.Date) Test(org.junit.Test)

Example 44 with GoToOrganizer

use of org.olat.modules.gotomeeting.GoToOrganizer in project openolat by klemens.

the class GoToMeetingDAOTest method getMeetings_withRepositoryEntry.

@Test
public void getMeetings_withRepositoryEntry() {
    RepositoryEntry entry = JunitTestHelper.createAndPersistRepositoryEntry();
    String username = UUID.randomUUID().toString();
    String accessToken = UUID.randomUUID().toString();
    String organizerKey = UUID.randomUUID().toString();
    GoToOrganizer organizer = organizerDao.createOrganizer(null, username, accessToken, organizerKey, "Michael", "Wolgemut", null, null, 10l, null);
    Assert.assertNotNull(organizer);
    Date start = new Date();
    Date end = new Date();
    String trainingKey = Long.toString(CodeHelper.getForeverUniqueID());
    GoToMeeting training = meetingDao.createTraining("New training", null, "Very interessant", trainingKey, start, end, organizer, entry, "d9912", null);
    dbInstance.commit();
    Assert.assertNotNull(training);
    List<GoToMeeting> meetings = meetingDao.getMeetings(GoToType.training, entry, "d9912", null);
    Assert.assertNotNull(meetings);
    Assert.assertEquals(1, meetings.size());
    Assert.assertTrue(meetings.contains(training));
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer) GoToMeeting(org.olat.modules.gotomeeting.GoToMeeting) RepositoryEntry(org.olat.repository.RepositoryEntry) Date(java.util.Date) Test(org.junit.Test)

Example 45 with GoToOrganizer

use of org.olat.modules.gotomeeting.GoToOrganizer in project openolat by klemens.

the class GoToMeetingDAOTest method createMeeting_without.

@Test
public void createMeeting_without() {
    String username = UUID.randomUUID().toString();
    String accessToken = UUID.randomUUID().toString();
    String organizerKey = UUID.randomUUID().toString();
    GoToOrganizer organizer = organizerDao.createOrganizer("My account", username, accessToken, organizerKey, "Lucas", "de Leyde", null, null, 10l, null);
    Assert.assertNotNull(organizer);
    Date start = new Date();
    Date end = new Date();
    String trainingKey = Long.toString(CodeHelper.getForeverUniqueID());
    GoToMeeting training = meetingDao.createTraining("New training", null, "Very interessant", trainingKey, start, end, organizer, null, null, null);
    dbInstance.commit();
    Assert.assertNotNull(training);
    Assert.assertNotNull(training.getKey());
    Assert.assertNotNull(training.getCreationDate());
    Assert.assertNotNull(training.getLastModified());
    Assert.assertEquals("New training", training.getName());
    Assert.assertEquals("Very interessant", training.getDescription());
    Assert.assertNotNull(training.getStartDate());
    Assert.assertNotNull(training.getEndDate());
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer) GoToMeeting(org.olat.modules.gotomeeting.GoToMeeting) Date(java.util.Date) Test(org.junit.Test)

Aggregations

GoToOrganizer (org.olat.modules.gotomeeting.GoToOrganizer)60 Test (org.junit.Test)28 Date (java.util.Date)22 GoToMeeting (org.olat.modules.gotomeeting.GoToMeeting)18 IOException (java.io.IOException)16 HttpResponse (org.apache.http.HttpResponse)16 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)16 RepositoryEntry (org.olat.repository.RepositoryEntry)10 HttpGet (org.apache.http.client.methods.HttpGet)8 Identity (org.olat.core.id.Identity)8 StringEntity (org.apache.http.entity.StringEntity)6 GoToRegistrant (org.olat.modules.gotomeeting.GoToRegistrant)6 HttpPut (org.apache.http.client.methods.HttpPut)4 GoToError (org.olat.modules.gotomeeting.model.GoToError)4 GoToErrorG2T (org.olat.modules.gotomeeting.model.GoToErrorG2T)4 GoToRegistrantG2T (org.olat.modules.gotomeeting.model.GoToRegistrantG2T)4 Calendar (java.util.Calendar)2 Response (javax.ws.rs.core.Response)2 HttpDelete (org.apache.http.client.methods.HttpDelete)2 HttpPost (org.apache.http.client.methods.HttpPost)2